GATE CS MCQ on DS and OS asked in IT written interviews


1) Increasing the RAM of a computer typically improves performance because

  1. Virtual memory increases
  2. Larger RAMs are faster
  3. Fewer page faults occur
  4. Fewer segmentation faults occur

Answer: 3
Explanation:
Virtual memory of computer does not depend upon main memory. However, it is not straight wrong but not the best answer. With more RAM we can afford larger virtual memory size without worrying about thrashing and thus could keep more number of processes in the memory which will increase utilization of CPU and hence its performance.
If we increase the size of RAM-main memory, then more pages can be accommodated resulting fewer segmentation faults. Hence, answer C is the best answer.
Size of ram does not determine its speed but faster or slower depends upon type of RAM e.g. SRAM is faster, DRAM is slower.
Segmentation fault means memory access violation where programs crash on this condition. Segmentation fault is not related to size of main memory and it can be occurring on any condition for example, if we are pushing more data than the size of an array or if we try to assign a value to a pointer for which memory is not allocated.


2) Which of the following page replacement algorithms suffers from Belady’s anomaly?

  1. FIFO
  2. LRU
  3. OPTIMAL
  4. MRU

Answer: 1
In computer storage Belady’s anomaly is the phenomenon in which increasing the number of page frames results in an increase in the number of page fault for certain memory access patterns. This phenomenon is commonly experienced when using the First in First Out (FIFO) page replacement algorithm. Visit wiki.


3) The data blocks of a very large file in the Unix file system are allocated using

  1. Linked allocation
  2. Indexed allocation
  3. Continuous allocation
  4. An extension of indexed allocation

Answer: 4
EXT2 file system or extension of indexed allocation is used for very large file in Unix file system.


Related Posts