Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Test: Page Replacement Algorithm - Computer Science Engineering (CSE) MCQ

Test: Page Replacement Algorithm - Computer Science Engineering (CSE) MCQ


Test Description

10 Questions MCQ Test - Test: Page Replacement Algorithm

Test: Page Replacement Algorithm for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Test: Page Replacement Algorithm questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Page Replacement Algorithm MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Page Replacement Algorithm below.
Solutions of Test: Page Replacement Algorithm questions in English are available as part of our course for Computer Science Engineering (CSE) & Test: Page Replacement Algorithm solutions in Hindi for Computer Science Engineering (CSE) course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Page Replacement Algorithm | 10 questions in 30 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Page Replacement Algorithm - Question 1

Which of the following Page Replacement Algorithm suffers from the belady's anomaly?

Detailed Solution for Test: Page Replacement Algorithm - Question 1

In FIFO Page Replacement Algorithm, page fault rate may increase as the number of allocated frames increase. Hence its suffer from the belady's anomaly

Test: Page Replacement Algorithm - Question 2

Consider a main memory with five page frames and the following sequence of page references: 3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3. Which one of the following is true with respect to page replacement policies First In First Out (FIFO) and Least Recently Used (LRU)?

Detailed Solution for Test: Page Replacement Algorithm - Question 2

LRU:

9-page faults:

FIFO:

9-page faults:

Hence LRU and FIFO will have 9-page faults.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Page Replacement Algorithm - Question 3

Recall that Belady’s anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:

S1: Random page replacement algorithm (where a page chosen at random is replaced)
Suffers from Belady’s anomaly
S2: LRU page replacement algorithm suffers from Belady’s anomaly

Which of the following is CORRECT?

Detailed Solution for Test: Page Replacement Algorithm - Question 3

S1: Random page replacement algorithm (where a page chosen at random is replaced)
Suffers from Belady’s anomaly.
Random page replacement algorithm can behave like any replacement algorithm. It may behave as FIFO, LRU, MRU etc.). When random page replacement algorithm behaves like a FIFO page replacement algorithm in that case there can be chances of belady’s anamoly.
For this let us consider an example of FIFO case, if we consider the reference string 3  2 1 0 3 2 4 3 2 1 0 4 and 3 frame slots, in this we get 9 page fault but if we increase slots to 4, then we get 10 page faults.
So, page faults are increasing by increasing the number of frame slots. It suffers from belady’s anamoly.

S2: LRU page replacement algorithm suffers from Belady’s anomaly
It doesn’t suffers from page replacement algorithm because in LRU, the page which is least recently used is replaced by the new page. Also, LRU Is a stack algorithm. (A stack algorithm is one that satisfies the inclusion property.) and stack algorithm doesn’t suffer from belady’s anamoly.

Test: Page Replacement Algorithm - Question 4

A system uses FIFO policy for page replacement. It has 4 page frames with no pages loaded to begin with. The system first accesses 50 distinct pages in some order and then accesses the same 50 pages in reverse order. How many page faults will occur?

Detailed Solution for Test: Page Replacement Algorithm - Question 4

Page frames = 4
Pages: 1, 2, 3, 4 .... 45, 46, 47, 48, 49, 50, 50(H), 49(H), 48(H), 47(H), 46, 45, .....4, 3, 2, 1
First 50-page accesses will cause page fault but in reverse order page number 50, 49, 48, and 47 will not cause a page fault.
Hence total page faults are 50 + 46.

Test: Page Replacement Algorithm - Question 5

Consider a fully-associative data cache with 32 blocks of 64 bytes each. The cache uses LRU (Least Recently Used) replacement. Consider the following C code to sum together all of the elements of a 64 by 64 two-dimensional array of 64-bit double-precision floating point numbers.

double sum (double A [64] [64] ) {
int i, j ;
double sum = 0 ;
for (i = 0 ; i < 64; i++)
for (j = 0; j < 64; j++)
sum += A [i] [j] ;
return sum ;
}

Assume all blocks in the cache are initially invalid. How many cache misses will result from the code?

Detailed Solution for Test: Page Replacement Algorithm - Question 5

Least Recently Used (LRU) page replacement algorithm:
LRU policy follows the concept of locality of reference as the base for its page replacement decisions. LRU policy says that pages that have not been used for the longest period of time will probably not be used for a long time.

The given data, 
Array size= 64 x64 x size of each element.
Array size=64 x64x 64-bit
Array size= 64 x64 x8 bytes
The data cache with 32 blocks of 64 bytes each.
Data cache= 64 bytes
Initially, the data cache loads blocks when i=0 and j=0 and one cache miss after that till i=0 and j=8 there is no cache misses because at one-time cache loads the 64 bytes of data.
So number for 64 bytes 1 miss then,
64 x64 x8 bytes=?
Number of miss= 64 x64 x8 bytes / 64
The number of miss= 512.
Hence the correct answer is 512.

Test: Page Replacement Algorithm - Question 6

A process refers to 5 pages, A, B, C, D, E in the order :
A, B, C, D, A, B, E, A, B, C, D, E

If the page replacement algorithm is FIFO, the number of page transfers with an empty internal store of 3 frames is: 

Detailed Solution for Test: Page Replacement Algorithm - Question 6

From the table below, we can see that pages have been transferred into frames 9 times.

Test: Page Replacement Algorithm - Question 7

A system uses FIFO policy for page replacement. It has 4 page frames with no pages loaded to begin with. The system first accesses 100 distinct pages in some order and then accesses the same 100 pages but now in the reverse order. How many page faults will occur?

Detailed Solution for Test: Page Replacement Algorithm - Question 7

Given that page frame size = 4
As there are 100 distinct pages which are first accessed → 100 page faults
when it accesses the same 100 pages but now in the reverse order → (100-4)
Because page frame size is four.
There fore, Total number of page faults = 100+ (100-4)= 196

Test: Page Replacement Algorithm - Question 8

How many page faults will occur if FIFO Page replacement algorithm is used for the following reference string with three-page frames?

7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1

Detailed Solution for Test: Page Replacement Algorithm - Question 8

First In First Out (FIFO):
This is the simplest page replacement algorithm. In this algorithm, the operating system keeps track of all pages in the memory in a queue, the oldest page is in the front of the queue. When a page needs to be replaced page in the front of the queue is selected for removal.

Page Fault:
A page fault happens when a running program accesses a memory page that is mapped into the virtual address space but not loaded in physical memory.

Hence the page faults= 15
Hence the correct answer is 15.

*Answer can only contain numeric values
Test: Page Replacement Algorithm - Question 9

Consider a demand paging system with four-page frames (initially empty) and LRU page replacement policy. For the following page reference string

7, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1

the page fault rate, defined as the ratio of number of page faults to the number of memory accesses (rounded off to one decimal place) is ______.


Detailed Solution for Test: Page Replacement Algorithm - Question 9

There are four-page frames are given and an LRU page replacement policy is used.

The given page size= 4,

The given page reference string is =  7, 2, 7, 3, 2, 5, 3, 4, 6, 7, 7, 1, 5, 6, 1

Number of Page faults = 9
Number of Page hits = 6
Number of memory access = 15
Page fault rate = Number of page faults / Number of memory access
Page fault rate = 9/15
Page fault rate = 0.6
Hence the correct answer is 0.6.

Test: Page Replacement Algorithm - Question 10

Consider the following page reference string:

1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6

For Optimal page replacement algorithms with 3 frames, the number of page faults is?

Detailed Solution for Test: Page Replacement Algorithm - Question 10

All algorithms strive to lower the number of page defects. The OS changes the page in this algorithm that will not be used for the longest amount of time in the future.

Information about Test: Page Replacement Algorithm Page
In this test you can find the Exam questions for Test: Page Replacement Algorithm solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Page Replacement Algorithm, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)