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

Questions IPA Japan published in 令和6年度 基本情報技術者試験 科目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 answer to be inserted into blank in the program.

The function maximum receives three different integers as arguments, and returns the maximum value among them.

[Program]
○ integer: maximum(integer: x, integer: y, integer: z)
if (blank)
return x
elseif (y > z)
return y
else
return z
endif

Answer group

Question 2

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

The function convDecimal receives as an argument a string of one or more characters that consists only of “0” and “1”, and returns the integer value obtained by interpreting the string as an unsigned binary number. For example, when “10010” is given as an argument, 18 is returned.
The function int, which is used by the function convDecimal, returns the integer value 0 if the character given as an argument is “0”, and returns the integer value 1 if it is “1”.

[Program]
○ integer: convDecimal(string: binary)
integer: i, length, result ← 0
length ← the number of characters in binary
for (increase i from 1 to length by 1)
result ← blank
endfor
return result

Answer group

Question 3

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 vertices of the graph shown in Figure 1 are numbered with integers in order, starting from 1. The graph is an undirected graph, and there is at most one edge between any two vertices. One edge can be represented by an integer-type array with two elements, whose elements are the numbers of the vertices at both ends. For example, {1, 3} represents the edge whose end points are vertex 1 and vertex 3. The whole graph can be represented by an array that stores all the two-element arrays representing the edges contained in the graph (hereinafter referred to as the array of edges). The number of elements in the array of edges is equal to the number of edges in the graph. The graph in Figure 1 can be represented as the array of integer-type arrays {{1, 3}, {1, 4}, {3, 4}, {2, 4}, {4, 5}}.

31425

Figure 1 Example of a graph

The function edgesToMatrix converts an array of edges into an adjacency matrix. An adjacency matrix is a square matrix whose numbers of rows and columns are equal to the number of vertices contained in the graph, and its element in row i, column j is 1 when there is an edge connecting vertex i and vertex j, and 0 otherwise. The diagonal elements of the matrix are all 0, and in the case of an undirected graph, it is a symmetric matrix. Figure 2 shows the adjacency matrix that represents the graph in Figure 1.

0011000010100101110100010

Figure 2 Adjacency matrix that represents the graph in Figure 1

The function edgesToMatrix receives the array of edges as the argument edgeList and the number of vertices of the graph as the argument nodeNum, and returns an integer-type two-dimensional array that represents the adjacency matrix.

[Program]
○ integer [,]: edgesToMatrix(integer [][]: edgeList,
integer: nodeNum)
integer [,]: adjMatrix ← {nodeNum rows and nodeNum columns of 0}
integer: i, u, v
for (increase i from 1 to the number of elements in edgeList by 1)
u ← edgeList[i][1]
v ← edgeList[i][2]
blank
endfor
return adjMatrix

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 merge receives the integer-type arrays data1 and data2, which are sorted in ascending order, and returns an integer-type array sorted in ascending order that is made by merging them.
When the function merge is called as merge({2, 3}, {1, 4}), the line /*** α ***/ is blank.

[Program]
○ integer []: merge(integer []: data1, integer []: data2)
integer: n1 ← the number of elements in data1
integer: n2 ← the number of elements in data2
integer []: work ← {(n1 + n2) undefined}
integer: i ← 1
integer: j ← 1
integer: k ← 1
while ((i ≤ n1) and (j ≤ n2))
if (data1[i] ≤ data2[j])
work[k] ← data1[i]
i ← i + 1
else
work[k] ← data2[j]
j ← j + 1
endif
k ← k + 1
endwhile
while (i ≤ n1)
work[k] ← data1[i]
i ← i + 1
k ← k + 1
endwhile
while (j ≤ n2)
work[k] ← data2[j] /*** α ***/
j ← j + 1
k ← k + 1
endwhile
return work

Answer group

Question 5

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

There is order data that records, for each order, the list of the items purchased in one order. The table shows an example of the order data.

Table Example of order data

Order numberList of purchased items
1A, B, D
2A, D
3A
4A, B, E
5B
6C, E

From the order data, the degree of association Lxy, which shows the tendency of item x and item y to be purchased in the same order, is calculated by the following formula.

Lxy = Mxy × total number of ordersKx × Ky

Here, Mxy represents the number of orders in which item x and item y were purchased in the same order, Kx represents the number of orders in which item x was purchased, and Ky represents the number of orders in which item y was purchased. In the example in the table, MAB is 2, the total number of orders is 6, KA is 4, and KB is 3, so the degree of association LAB between item A and item B is (2 × 6) / (4 × 3) = 1.0.
The procedure putRelatedItem outputs, based on the order data stored in the global variable orders, one of the items that have the largest degree of association with the item given as the argument, and that degree of association. In the program, an item is represented by a string, an order by an array of the purchased items, and the order data by an array of orders. The order data is assumed to contain two or more kinds of items. In addition, no item other than the items in the order data is given as the argument.

[Program]
// Order data (here, the example in the table is given)
global: string [][]: orders ← {{"A", "B", "D"}, {"A", "D"}, {"A"},
{"A", "B", "E"}, {"B"}, {"C", "E"}}
○putRelatedItem(string: item)
string []: allItems ← an array that stores the strings contained in orders
without duplicates, in dictionary order
// {"A", "B", "C", "D", "E"} in the example in the table
string []: otherItems ← a copy of allItems from which the elements whose value is item
are removed
integer: i, itemCount ← 0
integer []: arrayK ← {as many 0s as the number of elements in otherItems}
integer []: arrayM ← {as many 0s as the number of elements in otherItems}
real: valueL, maxL ← −∞
string []: order
string: relatedItem
for (assign the elements of orders to order one by one)
if (the value of one of the elements of order is equal to the value of item)
increase the value of itemCount by 1
endif
for (increase i from 1 to the number of elements in otherItems by 1)
if (the value of one of the elements of order is equal to the value of otherItems[i])
if (the value of one of the elements of order is equal to the value of item)
increase the value of A by 1
endif
increase the value of B by 1
endif
endfor
endfor
for (increase i from 1 to the number of elements in otherItems by 1)
valueL ← (arrayM[i] × C) ÷ (itemCount × arrayK[i])
/* calculated as real numbers */
if (valueL is greater than maxL)
maxL ← valueL
relatedItem ← otherItems[i]
endif
endfor
output the value of relatedItem and the value of maxL in this order, separated by a comma

Answer group

OptionABC
Question 6

Company A is a trading company with 450 employees, and since last year it has been promoting telework from home as part of its work style reform. Figure 1 shows the system environment of Company A.

•Each employee is lent one desktop PC (hereinafter, in-house PC).•The systems that employees use include, in addition to the business system that Company A developed in-house and installed at Company A, the following two SaaS (hereinafter, the two SaaS are referred to as Company A’s cloud services).        1. Groupware with mail, chat and cloud storage functions            (hereinafter, Company A’s groupware)        2. Online meeting service•For telework, business use (BYOD) of employees’ personally owned PCs (hereinafter, private PCs) is permitted.•For telework, dedicated application software (hereinafter, dedicated app) is installed on each of the in-house PCs and the private PCs, and a remote desktop method is adopted in which the screen of the in-house PC’s desktop is transferred to the private PC.•The dedicated app has a function that prohibits downloading files from the remote desktop to the PC and copying and pasting files, character strings, images, etc. (hereinafter, save prohibition function), and Company A has enabled this function for private PCs.•Employees log in to the business system from the desktop of the in-house PC by entering their user ID and password.•Login to Company A’s cloud services is restricted, by settings on the side of Company A’s cloud services, so that it is possible only from Company A’s internal network. A user ID and password are used for login.

Figure 1 System environment of Company A (excerpt)

As telework became established, employees asked whether the situation could be improved, because connections from the in-house PCs to the internet had become extremely slow and were hindering their work. An investigation of the traffic between Company A’s internal network and the internet revealed that, compared with before telework was introduced, it had increased markedly during business hours. Therefore, the Information Systems Department decided to make a change to the network settings that enables a direct connection to Company A’s cloud services during telework, without going through either Company A’s internal network or the in-house PC.
When B, the information security leader of Company A, examined whether the setting change would cause any information security problems, B found that there were several problems. One of them is that the risk of unauthorized access to Company A’s cloud services increases. B therefore decided to ask the Information Systems Department to take a countermeasure to reduce the risk.

QuestionWhich of the following countermeasures did B decide to ask the Information Systems Department for? From the answer group, select the most appropriate one.

Answer group

LearnIPA
Review
History
Profile