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

Questions IPA Japan published in 令和7年度 基本情報技術者試験 科目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.

When the arguments received by the function function1 and the arguments received by the function function2 are the same, the two functions return the same value. Here, the arguments n and m are positive integers, and the argument m is a number that is greater than the argument n by 10 or more.

[Program]
○ integer: function1(integer: n, integer: m)
integer: count ← 0
integer: i
for (increase i from n to m by 1)
if ((i mod 4) is equal to 0)
count ← count + 1
endif
endfor
return count
○ integer: function2(integer: n, integer: m)
integer: count ← 0
integer: tempN ← n
integer: i, j
for (A)
if ((tempN mod 4) is equal to 0)
terminate the iteration process
endif
tempN ← tempN + 1
endfor
for (B)
count ← count + 1
endfor
return count

Answer group

OptionAB
Question 2

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

The function change receives an integer greater than 10 as the argument n, and returns the total number of combinations of 1-yen coins, 5-yen coins, and 10-yen coins that make exactly n yen.
For example, the combinations that make 12 yen are counted as follows. When no 10-yen coins are used, exactly 12 yen must be made with 1-yen coins and 5-yen coins only. Since the number of 5-yen coins that can be used is 0 or more and (the quotient of 12 ÷ 5) or less, there are (the quotient of 12 ÷ 5) + 1 = 3 such combinations. Similarly, when one 10-yen coin is used, exactly 2 yen must be made with 1-yen coins and 5-yen coins only, and there is (the quotient of 2 ÷ 5) + 1 = 1 such combination. There are no combinations that use two or more 10-yen coins. Therefore, there are 3 + 1 = 4 combinations that make exactly 12 yen with 1-yen coins, 5-yen coins, and 10-yen coins.

[Program]
○ integer: change(integer: n)
integer: count ← 0
integer: rest ← n
while (blank)
count ← count + (the quotient of rest ÷ 5) + 1
rest ← rest - 10
endwhile
return count

Answer group

Question 3

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 push stores the integer given as an argument in the stack. It returns true if the integer could be stored, and returns false if it could not be stored.
The function pop takes out a value from the stack and returns it. When the stack is empty, it returns the undefined value.

The stack is represented by the global integer-type array stack, whose number of elements is 4, and the global variable stackPos, which indicates the position where a value is stored next. The initial state of the stack is shown in the figure.

In the program, areas outside of the array must not be referenced.

Index1234stack43stackPos
Note:Shading indicates that the element is undefined.

Figure Initial state of the stack

[Program]
global: integer: stackPos ← 3
global: integer []: stack ← {4, 3, undefined, undefined}
○ boolean: push(integer: inputData)
if (stackPos ≤ the number of elements in stack)
stack[A] ← inputData
stackPos ← stackPos + 1
return true
else
return false
endif
○ integer: pop()
integer: popData ← undefined
if (stackPos > 1)
stackPos ← B
popData ← stack[stackPos]
stack[stackPos] ← undefined
endif
return popData

Answer group

OptionAB
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 search receives two character-type arrays as the arguments data and key respectively, searches data for all the sequences that are the same as the sequence of the elements of key, and returns an array that stores all the indexes of the first elements of those sequences. If none is found, it returns an array with 0 elements.
When the function search is called as search({"a", "b", "a", "b", "c", "a", "b", "c"}, {"a", "b", "c"}), the number of times the conditional expression on the line /*** β ***/ is true is blank.

[Program]
/* key is an array with one or more elements */
○ integer []: search(character []: data, character []: key)
integer: i, j, lenData, lenKey
integer []: result ← {} // array with 0 elements
lenData ← the number of elements in data
lenKey ← the number of elements in key
/* The loop is not executed when (lenData - lenKey + 1) is 0 or less */
for (increase i from 1 to (lenData - lenKey + 1) by 1)
for (increase j from 1 to lenKey by 1) // α
if (data[i + j - 1] is equal to key[j]) /*** β ***/
if (j is equal to lenKey)
add the value of i to the end of result
endif
else
exit the for block marked α
endif
endfor
endfor
return result

Answer group

Question 5

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

Based on the tabulated results of data collected to investigate the preventive effect of a vaccination against disease X, the number of persons is calculated on the assumption that whether a person contracts disease X is not affected by whether or not the person received the vaccination. This number of persons is called the theoretical frequency. Table 1 shows an example of the tabulated results, and Table 2 shows the theoretical frequencies calculated based on Table 1.
The function f returns the theoretical frequencies calculated based on the tabulated results received in the argument data. The argument and the return value are two-dimensional arrays, whose rows correspond to the rows of the table and whose columns correspond to the columns of the table.

Table 1 Example of tabulated results

Unit: persons

 Did not contract disease XContracted disease X
Vaccinated826
Not vaccinated588

Table 2 Theoretical frequencies calculated based on Table 1

Unit: personsDid not contractdisease XContracteddisease XVaccinatedNot vaccinatedAB
Note:The shaded parts are not shown.
[Program]
○ real [,]: f(real [,]: data)
real: t ← the sum of the elements of data
integer: row ← the number of rows of data
integer: col ← the number of columns of data
real [,]: result ← {row rows and col columns of undefined values}
integer: r, c
for (increase r from 1 to row by 1)
for (increase c from 1 to col by 1)
result[r, c] ← (the sum of the elements in row number r of data) ×
(the sum of the elements in column number c of data) ÷ t
endfor
endfor
return result

Answer group

OptionAB
Question 6

Company A is an electronic equipment manufacturer with 200 employees. Its head office is in Tokyo, and it has a factory in Niigata.
Company A operates its file servers as shown in Figure 1.

•The file servers are installed in the server rooms of the head office and the factory.•The file servers acquire backups of files by using magnetic tapes.•A full backup is acquired starting at 2:00 a.m. on Saturday, and incremental backups are acquired starting at 2:00 a.m. on Tuesday and Thursday of the following week.•Every Monday, Tuesday, and Thursday at around 10:00 a.m., the person in charge in the Information Systems Department checks the execution results of the backup jobs and replaces the magnetic tapes, and keeps the magnetic tapes in a fireproof safe.•Backups are acquired on the magnetic tapes in overwrite mode, and one month’s worth of magnetic tapes is managed in generations.•So far, a restore from a full backup has taken 4 hours on average, and a restore from one incremental backup 0.25 hours on average.•Company A conducts tests for ICT continuity, and the file servers are also subject to the tests.
Note:Based on the results of a business impact analysis, a recovery point objective (RPO) of 72 hours and a recovery time objective (RTO) of 120 hours are defined as requirements for the file servers.

Figure 1 Operation of the file servers at Company A

Company A has acquired ISMS certification, works on information security with the Chief Information Security Officer (CISO) at the center, and regularly conducts information security risk assessments. Now that the ISMS certification criteria have been revised to JIS Q 27001:2023, B, the information security leader, is to prepare for the transition audit to the new criteria. For the information security controls newly added by the revision, B checked the status of the efforts with the person in charge in the Information Systems Department, and summarized the evaluation results in Table 1.

Table 1 Evaluation results by B (excerpt)

Item No.Information security controlEvaluation result
1(ICT readiness for business continuity) Based on business continuity objectives and ICT continuity requirements, ICT readiness shall be planned, implemented, maintained and tested.Implemented

In the internal audit before the transition audit, B received several questions from the Internal Audit Office about the operation of the file servers related to item No. 1 in Table 1, and answered as shown in Table 2.

Table 2 B’s answers to the Internal Audit Office (excerpt)

Item No.B’s answer
1For example, if a failure occurs at noon on Friday, at least the data as of A1 must be restored.
2For example, if a failure occurs at noon on Thursday and all the data on the file servers is lost, the restore from the backups is expected to take A2 hours.
3The ICT continuity plan is approved by A3.
QuestionFrom the answer group for A below, select the appropriate combination of words to be inserted into A1 through A3 in Table 2.

Answer group for A

OptionA1A2A3
LearnIPA
Review
History
Profile