LearnIPAReviewHistoryAI
Profile
AboutHow I passedFeedback
LearnIPA
Review
History
Profile
LearnIPAReviewHistoryAI
Profile
AboutHow I passedFeedback
IPA FE Subject B 2023

Questions IPA Japan published in 令和5年度 基本情報技術者試験 科目B 公開問題, translated into English, with IPA's answers. ITPEC is based on the same exams, so they are good practice for ITPEC too.

Question 1

From the answer group below, select the correct combination of answers to be inserted into A and B in the program. Here, the array index starts at 1.

The function findPrimeNumbers returns an array that stores all the prime numbers, and only the prime numbers, less than or equal to the integer given as the argument. Here, the integer given to the argument is 2 or greater.

[Program]
○ integer []: findPrimeNumbers(integer: maxNum)
integer []: pnList ← {} // array with 0 elements
integer: i, j
boolean: divideFlag
for (increase i from 2 to A by 1)
divideFlag ← true
/* The loop is not executed when the integer part of the positive square root of i is less than 2 */
for (increase j from 2 to the integer part of the positive square root of i by 1) // α
if (B)
divideFlag ← false
exit the for block marked α
endif
endfor
if (divideFlag is equal to true)
add the value of i to the end of pnList
endif
endfor
return pnList

Answer group

OptionAB
Question 2

From the answer group below, select the correct answer to be inserted into blank in the description.

In the following program, when the procedure proc2 is called, blank are output in this order.

[Program]
○ proc1()
output "A"
proc3()
○ proc2()
proc3()
output "B"
proc1()
○ proc3()
output "C"

Answer group

Question 3

From the answer group below, select the correct answer to be inserted into blank in the description. Here, the array index starts at 1.

The following procedure sort sorts the elements of the global integer-type array data, from the index given by the argument first to the index given by the argument last, in ascending order. Here, first < last. When the procedure sort is called as sort(1, 5), the output when the line /*** α ***/ is executed for the first time is “blank”.

[Program]
global: integer []: data ← {2, 1, 3, 5, 4}
○ sort(integer: first, integer: last)
integer: pivot, i, j
pivot ← data[the quotient of (first + last) ÷ 2]
i ← first
j ← last
while (true)
while (data[i] < pivot)
i ← i + 1
endwhile
while (pivot < data[j])
j ← j - 1
endwhile
if (i ≥ j)
terminate the iteration process
endif
swap the values of data[i] and data[j]
i ← i + 1
j ← j - 1
endwhile
output the values of all elements of data in the order of the indexes, separated by spaces /*** α ***/
if (first < i - 1)
sort(first, i - 1)
endif
if (j + 1 < last)
sort(j + 1, last)
endif

Answer group

Question 4

From the answer group below, select the correct answer to be inserted into blank in the description. Here, the array index starts at 1.

The function add stores the positive integer value specified by the argument in the global integer-type array hashArray. It returns true if the value has been stored, and returns false if the value could not be stored. Here, which element of hashArray the integer value should be stored in is determined by using the functions calcHash1 and calcHash2.
The procedure test calls the function add to store positive integers in hashArray. The content of hashArray immediately after the processing of the procedure test has finished is blank.

[Program]
global: integer []: hashArray
○ boolean: add(integer: value)
integer: i ← calcHash1(value)
if (hashArray[i] = -1)
hashArray[i] ← value
return true
else
i ← calcHash2(value)
if (hashArray[i] = -1)
hashArray[i] ← value
return true
endif
endif
return false
○ integer: calcHash1(integer: value)
return (value mod the number of elements in hashArray) + 1
○ integer: calcHash2(integer: value)
return ((value + 3) mod the number of elements in hashArray) + 1
○ test()
hashArray ← {5 elements of -1}
add(3)
add(18)
add(11)

Answer group

Question 5

From the answer group below, select the correct combination of answers to be inserted into A and B in the program. Here, the array index starts at 1.

Cosine similarity is a measure of the similarity of the directions of two vectors. The function calcCosineSimilarity receives the real-type arrays vector1 and vector2, each of which has n (n ≥ 1) elements, and returns the cosine similarity of the two arrays. When the array vector1 is {a1, a2, …, an} and the array vector2 is {b1, b2, …, bn}, the cosine similarity is calculated by the following formula. Here, it is assumed that neither the array vector1 nor the array vector2 has 0 stored in all of its elements.

a1b1 + a2b2 + … + anbn√a21 + a22 + … + a2n √b21 + b22 + … + b2n

[Program]
○ real: calcCosineSimilarity(real []: vector1,
real []: vector2)
real: similarity, numerator, denominator, temp ← 0
integer: i
numerator ← 0
for (increase i from 1 to the number of elements in vector1 by 1)
numerator ← numerator + A
endfor
for (increase i from 1 to the number of elements in vector1 by 1)
temp ← temp + vector1[i] squared
endfor
denominator ← the positive square root of temp
temp ← 0
for (increase i from 1 to the number of elements in vector2 by 1)
temp ← temp + vector2[i] squared
endfor
denominator ← B
similarity ← numerator ÷ denominator
return similarity

Answer group

OptionAB
Question 6

Company A runs an advertising production business for broadcasting companies and transportation companies. To improve the efficiency of its human resources operations, Company A decided to consider outsourcing its human resources operations. Figure 1 shows the work that Company A will outsource (hereinafter, work B).

•Convert documents mailed by prospective employees, such as the written pledge submitted on joining the company and the withholding tax slip from the previous employer, into PDF files, and store them on a file server.(Omitted)

Figure 1 Work B

Company C, a candidate outsourcing contractor, made the following proposal to Company A about work B.

  • •Assign dedicated employees who are engaged only in work B.
  • •In work B, use the scan function of the multifunction printer shown in Figure 2.
•When using the scan function, enter on the panel the user ID and password assigned to each employee.•Convert the scanned data into a PDF file.•Encrypt the PDF file with a key that differs for each employee, and attach it to an email.•Send the email to the person who performed the scan.•If the PDF file is large, instead of attaching the PDF file, automatically save it on a server installed on the company’s own internal network (hereinafter, server B)1), and send the email with the URL of the save location written in the body of the email.
Note 1)Accessing server B requires the user ID and password of each employee.

Figure 2 Scan function of the multifunction printer (excerpt)

Before concluding an outsourcing contract with Company C, Company A concluded a non-disclosure agreement. After that, Company A sent a questionnaire to Company C, received the answers, and conducted an assessment of the information security risks in the outsourcing. As a result, the findings in Figure 3 were made.

•In the scan function of the multifunction printer, the sender address, subject, body and attachment file name of the email are used in the state of the initial settings1), and they are the same no matter who performs the scan.•The information on the initial settings of the scan function of the multifunction printer is published on the vendor’s website, and anyone can view it.
Note 1)Only the Information Systems Department of Company C can change the initial settings of the multifunction printer.

Figure 3 Findings

Therefore, Company A assessed that leaving the initial settings as they are poses an information security risk to Company A, and that a countermeasure of changing them from the initial settings is necessary.

QuestionWhich is the information security risk for which Company A assessed that a countermeasure is necessary? From the answer group, select the most appropriate one.

Answer group

LearnIPA
Review
History
Profile