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.
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.
Answer group
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.
Answer group
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.
Figure Initial state of the stack
Answer group
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(, the number of times the conditional expression on the line /*** β ***/ is true is blank.
Answer group
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
Table 2 Theoretical frequencies calculated based on Table 1
Answer group
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.
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)
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)
Answer group for A