If you have any suggestions about our website or study materials, please feel free to leave a comment to help us improve. Alternatively, you can send us a message through the Contact Us page. Thank you for helping us make Free Study Hub better!

CSE-316_PYQ

 

1.       What is a page fault in the context of demand paging?

         Options:

(a)  A page that contains errors and cannot be used

(b)  A page that is too large to fit into memory

(c)   A reference to a page that is not currently in main memory

(d)  A page that has been marked as read-only

         Correct Answer: (c) A reference to a page that is not currently in main memory

         Explanation:

A page fault occurs when the CPU tries to access a page not loaded into main memory, triggering the operating system to load it from secondary storage.

 

2.       How many pages must be present in the main memory for demand paging to work efficiently?

         Options:

(a)  8192 pages

(b)  4096 pages

(c)   2048 pages

(d)  16384 pages

         Correct Answer: (a) 8192 pages

         Explanation:

Memory required = 32MB=32×1024×1024

         Page size = 4KB=4096bytes

Number of pages required = 32×1024×10244096=8192pages

3.       Message passing system allows processes to:

         Options:

(a)  communicate with one another without resorting to shared data

(b)  communicate with one another by resorting to shared data

(c)   share data

(d)  name the recipient or sender of the message

         Correct Answer: (a) communicate with one another without resorting to shared data

         Explanation:

Message passing is an IPC mechanism where processes exchange messages directly without needing shared memory.

 

4.       The link between two processes P and Q to send and receive messages is called:

         Options:

(a)  communication link

(b)  message-passing link

(c)   synchronization link

(d)  All of these

         Correct Answer: (a) communication link

         Explanation:

A communication link facilitates the transfer of messages between processes in an inter-process communication system.

 

5.       How can buffer overflow vulnerabilities be mitigated?

         Options:

(a)  By using large buffer sizes to accommodate more data

(b)  By disabling all security mechanisms

(c)   By relying solely on antivirus software

(d)  By implementing input validation and using safe coding practices

         Correct Answer: (d) By implementing input validation and using safe coding practices

         Explanation:

Input validation ensures data is within expected bounds, and safe coding prevents excessive data from overflowing a buffer.

 

6.       Which programming languages are particularly susceptible to buffer overflow vulnerabilities?

         Options:

(a)  Only low-level languages like C and Assembly

(b)  Only high-level languages like Python and Java

(c)   Both low-level and high-level languages

(d)  Buffer overflows are not language-dependent

         Correct Answer: (a) Only low-level languages like C and Assembly

         Explanation:

Low-level languages like C and Assembly are more prone because they lack built-in bounds checking, unlike high-level languages.

 

7.       Which file access method allows data to be read or written randomly, without the need for sequential access?

         Options:

(a)  Sequential access

(b)  Direct access

(c)   Serial access

(d)  Shared access

         Correct Answer: (b) Direct access

         Explanation:

Direct access allows data to be read or written at any location without requiring sequential traversal.

 

8.       In which allocation method is the file represented by a table containing pointers to its blocks scattered throughout the disk?

         Options:

(a)  Contiguous allocation

(b)  Linked allocation

(c)   Indexed allocation

(d)  Dynamic allocation

         Correct Answer: (c) Indexed allocation

         Explanation:

In indexed allocation, a table of pointers is used to store the locations of blocks, enabling scattered storage.

 

9.       What is demand paging in operating systems?

         Options:

(a)  A paging technique that swaps entire processes in and out of memory

(b)  A paging technique that preloads all pages of a process into memory

(c)   A paging technique that brings in pages only when they are required

(d)  A technique that eliminates the need for virtual memory

         Correct Answer: (c) A paging technique that brings in pages only when they are required

         Explanation:

Demand paging loads pages into memory only when they are needed, minimizing memory usage.

 

10.   In swapping, what is moved between main memory and secondary storage?

         Options:

(a)  Data files

(b)  Operating system files

(c)   Entire processes

(d)  CPU registers

         Correct Answer: (c) Entire processes

         Explanation:

Swapping moves entire processes between main memory and secondary storage to manage memory efficiently.

 

 

11.   What type of device allows data to be read or written in a linear sequence and is commonly used for magnetic tapes?

         Options:

(a)  Serial access device

(b)  Direct access device

(c)   Virtual device

(d)  Shared device

         Correct Answer: (a) Serial access device

         Explanation:

Serial access devices access data sequentially, making them ideal for magnetic tapes.

 

12.   Which IPC mechanism allows two processes to communicate by reading from and writing to a shared data stream?

         Options:

(a)  Pipes

(b)  Semaphores

(c)   Message queues

(d)  Shared memory 

Correct Answer: (a) Pipes

         Explanation:

Pipes enable communication between processes by creating a shared data stream.

 

13.   What is a potential drawback of applying strict mutual exclusion in a multithreaded program?

         Options:

(a)  Increased performance and efficiency

(b)  Deadlocks and contention

(c)   Improved scalability

(d)  Reduced synchronization overhead 

Correct Answer: (b) Deadlocks and contention

         Explanation:

Strict mutual exclusion can cause deadlocks and contention when multiple threads wait indefinitely for resources.

 

14.   In a multi-threaded application, how is mutual exclusion typically achieved?

         Options:

(a)  By allowing all threads to simultaneously access shared resources.

(b)  By using locks, mutexes, or semaphores to protect critical sections.

(c)   By using a round-robin scheduling algorithm

(d)  By assigning different priority levels to threads

         Correct Answer: (b) By using locks, mutexes, or semaphores to protect critical sections

         Explanation:

Mutual exclusion is achieved by mechanisms like locks and semaphores, which ensure only one thread accesses critical resources at a time.

 

15.   The logical address is generated by:

         Options:

(a)  Base Register

(b)  Limit Register

(c)   CPU

(d)  Memory Management Unit 

Correct Answer: (c) CPU

         Explanation:

The CPU generates a logical address, which is translated to a physical address by the memory management unit (MMU).

 

16.   Which page replacement algorithm selects the page that has not been used for the longest period of time?

         Options:

(a)  FIFO (First-In-First-Out)

(b)  LRU (Least Recently Used)

(c)   Optimal Page Replacement

(d)  Random Page Replacement

         Correct Answer: (b) LRU (Least Recently Used)

         Explanation:

LRU replaces the page that has been unused for the longest time, aiming to predict which page is least likely to be accessed soon.

 

17.   Identify which one of the following is a synchronization tool:

         Options:

(a)  Semaphore

(b)  Thread

(c)   Pipe

(d)  Socket

         Correct Answer: (a) Semaphore

         Explanation:

Semaphores are synchronization tools used to manage access to shared resources.

 

18.   What is the primary purpose of a directory in a file system?

         Options:

(a)  To store data files

(b)  To organize and manage files

(c)   To allocate disk space

(d)  To perform file I/O operations

         Correct Answer: (b) To organize and manage files

         Explanation:

Directories provide a structure to organize and manage files for easy access and retrieval.

 

19.   A problem encountered in multitasking when a process is perpetually denied necessary resources is called:

         Options:

(a)  Deadlock

(b)  Starvation

(c)   Inversion

(d)  Aging

         Correct Answer: (b) Starvation

         Explanation:

Starvation occurs when a process waits indefinitely for resources due to priority scheduling favoring other processes.

 

20.   Which one of the following is a visual (mathematical) way to determine deadlock occurrence?

         Options:

(a)  Resource allocation graph

(b)  Starvation graph

(c)   Inversion graph

(d)  None of the mentioned

         Correct Answer: (a) Resource allocation graph

         Explanation:

A resource allocation graph visually represents processes and resource dependencies to detect potential deadlocks.

 

21.   In segmentation, what is the logical address composed of?

         Options:

(a)  A page number and an offset within the page

(b)  A segment number and an offset within the segment

(c)   A block number and an offset within the block

(d)  A memory address and a register value

         Correct Answer: (b) A segment number and an offset within the segment

         Explanation:

Segmentation divides memory into variable-sized segments, and logical addresses consist of a segment number and an offset within that segment.

 

22.   In a computer system using segmentation, the logical address consists of a segment number (10 bits) and an offset within the segment (12 bits). Calculate the maximum size of each segment:

         Options:

(a)  2 KB

(b)  4 KB

(c)   8 KB

(d)  16 KB

         Correct Answer: (b) 4 KB

         Explanation:

The offset size determines the maximum segment size: 2^12=4096

         bytes=4


23.   Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 90 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the effective memory access time (in milliseconds) is:

         Options:

(a)  122

(b)  136

(c)   280

(d)  118

         Correct Answer: (b) 136

         Explanation:

Effective memory access time (EMAT) is calculated as:

     EMAT=(Hit Ratio×TLB Time)+(Miss Ratio×(TLB Time+Memory Time))

    Substitute values:

         EMAT=(0.6×90)+(0.4×(10+90))=136ms

 

24.   The logical address generated by the CPU is compared with the limit of the process. If the address is found to be greater than or equal to the limit, then:

         Options:

(a)  Relocation register value is added

(b)  Trap is generated

(c)   Logical address is never compared with limit register

(d)  None of the mentioned

         Correct Answer: (b) Trap is generated

         Explanation:

If the logical address exceeds the limit, a trap is generated to signal an illegal memory access.

 

25.   Which of the following condition is required for a deadlock to be possible?

         Options:

(a)  Mutual exclusion

(b)  A process may hold allocated resources while awaiting assignment of other resources

(c)   No resource can be forcibly removed from a process holding it (d) All of the mentioned

         Correct Answer: (d) All of the mentioned

         Explanation:

The four necessary conditions for deadlock are: mutual exclusion, hold and wait, no preemption, and circular wait.

 

26.   For an effective operating system, when to check for deadlock?

         Options:

(a)  Every time a resource request is made

(b)  At fixed time intervals

(c)   Every time a resource request is made and at fixed time intervals (d) None of the mentioned

         Correct Answer: (c) Every time a resource request is made and at fixed time intervals

         Explanation:

Checking for deadlocks continuously and periodically ensures that the system can handle potential issues promptly.

 

27.   In indirect communication between processes P and Q:

         Options:

(a)  There is another process R to handle and pass on the messages between P and Q

(b)  There is another machine between the two processes to help communication

(c)   There is a mailbox to help communication between P and Q

(d)  None of the mentioned

         Correct Answer: (c) There is a mailbox to help communication between P and Q

         Explanation:

Indirect communication uses mailboxes or message queues to facilitate communication without direct connections.

 

28.   In the non-blocking send:

         Options:

(a)  The sending process keeps sending until the message is received

(b)  The sending process sends the message and resumes operation

(c)   The sending process keeps sending until it receives a message (d) None of these

         Correct Answer: (b) The sending process sends the message and resumes operation

         Explanation:

In non-blocking communication, the sender does not wait for the receiver to acknowledge the message and continues execution.

 

29.   Which condition is responsible for circular wait in the four necessary conditions for deadlock?

         Options:

(a)  Mutual exclusion

(b)  Hold and wait

(c)   No preemption

(d)  Circular wait

         Correct Answer: (b) Hold and wait

         Explanation:

Circular wait occurs when a process holds resources and waits for others held by other processes, completing the cycle.

 

30.   In the context of deadlock prevention, what does "preemption" refer to?

         Options:

(a)  Forcing a process to release its allocated resources

(b)  Allowing a process to wait indefinitely for a resource

(c)   Granting resources to a process immediately upon request

(d)  Terminating a process to release its resources

         Correct Answer: (a) Forcing a process to release its allocated resources

         Explanation:

Preemption prevents deadlocks by allowing resources to be forcibly taken from a process to allocate them to others.

 

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.