Questions IPA Japan published in 令和8年度 基本情報技術者試験 科目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 answer to be inserted into blank in the program. Here, the array index starts at 1.
The following program moves the value of the last element of the integer-type array data to the first element. In doing so, the value of each element other than the last one is moved to the element one position after it.
Answer group
From the answer group below, select the correct answer to be inserted into blank in the program.
The function complement receives an 8-bit type value x as an argument, and returns the value that gives 00000000 when added to x. Addition of 8-bit type values is performed by regarding the values as unsigned binary numbers, and when an overflow occurs, the overflowed digit is ignored. The operators ∧, ∨, and ▽ represent bitwise logical product, logical sum, and exclusive logical sum, respectively.
Answer group
From the answer group below, select the correct answer to be inserted into blank in the program. Here, the array index starts at 1.
When the argument given to the function func1 and the argument given to the function func2 are the same, the two functions return the same value. The program must not refer to any area outside the bounds of the array.
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.
A singly linked list is represented by two arrays, the array dataList and the array pointerList. dataList stores the values of the elements of the list, and pointerList stores the index of the element of dataList that corresponds to the next element of the list. The head of the singly linked list is the pair of dataList[1] and pointerList[1]. The element of pointerList that corresponds to the tail of the singly linked list is undefined. The elements of dataList that do not store values of elements of the singly linked list, and the corresponding elements of pointerList, are undefined.
The contents of dataList and pointerList handled by the program are shown in Figure 1. The index of the element next to the head is 3, stored in pointerList[1], and its value is 20, stored in dataList[3]. The index of the element after that is 2, stored in pointerList[3], and its value is 30, stored in dataList[2].
Figure 1 Contents of dataList and pointerList
The function orderList returns an array that stores the values of the singly linked list represented by dataList and pointerList in Figure 1, in order, following the singly linked list from its head. The array returned by the function orderList is shown in Figure 2.
Figure 2 Array returned by the function orderList
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.
In this question, a representation by an integer-type array in which only one element is 1 and the other elements are 0 is called a One-Hot representation. As shown in the figure, the function oneHotEncoding receives as its argument a string-type array of one or more elements in which names of colors are stored, converts each element into a One-Hot representation based on the names of colors contained in the array (three kinds in the example in the figure), and stores them in an array of integer-type arrays and returns it. An example of conversion by the function oneHotEncoding is shown in the figure.
Example of argument: {"Red", "Green", "Blue", "Red"}
↓
One-Hot representation of "Red": {1, 0, 0}
One-Hot representation of "Green": {0, 1, 0}
One-Hot representation of "Blue": {0, 0, 1}
↓
Return value corresponding to the example of argument: {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}, {1, 0, 0}}
Figure Example of conversion by the function oneHotEncoding
Answer group
Company A is an advertising agency with 1,000 employees. At Company A, the file server that each department has installed on Company A’s internal network is managed by the operations staff of the department that installed it. When a department uses a new cloud service, the department signs the contract with the approval of the person responsible for the department, and the department’s operations staff manage the service.
The Sales Department uses a file server that the Sales Department installed on Company A’s internal network (hereinafter, server Y) and a cloud service for customer management (hereinafter, service Z). Each employee of the Sales Department is assigned a general user account of server Y, and can edit all files on server Y. In addition, each employee of the Sales Department is assigned a general user account of service Z, and the operations staff of the Sales Department are assigned administrator accounts of server Y and service Z.
In preparation for the occurrence of information security incidents related to cloud services, the information security department established rules on the management of logs of the cloud services used by each department, as shown in Figure 1.
Figure 1 Rules on the management of logs of the cloud services used by each department
Section Manager B, the information security leader of the Sales Department, investigated whether the rules in Figure 1 were complied with, with the cooperation of Chief C of the operations staff and the information security department.
Section Manager B summarized the current operations of service Z that violate the rules in Figure 1, as shown in Table 1.
Table 1 Current operations that violate the rules in Figure 1
Answer group