All mock tests are FREE till 31 December — register to save your progress

Directions (Q91–95): A program computes the average of each column of a table T with 17 rows and 1024 columns:
for j = 0 … 1023 {
temp = 0;
for i = 0 … 16
temp = temp + T[i][j];
print(temp / 17.0);
}
T[i][j] and temp are 32-bit floating-point values, memory is word addressable, and temp is kept in a register. Main memory is paged and holds 16 pages of 1024 words; page replacement is LRU. Unless stated otherwise, T is stored in row-major order.

How many page faults will be encountered?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 17,408

Explanation

Row-major: each row is one page. Each column pass touches 17 different pages, but only 16 frames are available, so LRU evicts the page needed next and every reference faults: 17 × 1024 = 17,408.

More System Software and Operating System questions