Multiple Choice Questions Flashcards

1
Q

What is the primary benefit of virtual memory in computer systems?

a. It allows for the execution of programs without requiring memory.
b. It separates the developer’s logical memory from the physical memory, enabling a larger virtual memory to be available than the physical memory.
c. It enhances the speed of the CPU by increasing cache size.
d. It provides unlimited physical memory for all running applications.

A

b. It separates the developer’s logical memory from the physical memory, enabling a larger virtual memory to be available than the physical memory.

Virtual memory allows programs to use more memory than physically available by using disk storage to extend the memory space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a physical address in the context of computer memory?

a. A location in physical memory where data is stored, as opposed to a virtual address.
b. An address used to locate data in a network.
c. An address used by the CPU cache to store frequently accessed data.
d. An abstract address used by programmers to manage memory efficiently.

A

a. A location in physical memory where data is stored, as opposed to a virtual address.

A physical address refers to an actual location in RAM, contrasting with virtual addresses used by programs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is paging in the context of computer memory management?

a. Increases CPU speed.
b. Allocates continuous memory blocks.
c. Eliminates the need for physical memory.
d. Divides memory into fixed-size pages.

A

d. Divides memory into fixed-size pages.

Paging breaks memory into fixed-size blocks, simplifying memory management.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What happens when a thread requests resources that are not available?

a. The thread is terminated.
b. The thread continues running.
c. The thread enters a waiting state.
d. The thread is restarted.

A

c. The thread enters a waiting state.

If a thread requests unavailable resources, it typically waits until the resources become available.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What may happen if a system does not use deadlock-prevention or deadlock-avoidance algorithms?

a. The system will run faster.
b. A deadlock situation may arise.
c. The system will avoid deadlocks.
d. Processes will run sequentially.

A

b. A deadlock situation may arise.

Without mechanisms to prevent or avoid deadlocks, processes may end up in a state where they cannot proceed because each is waiting for resources held by the other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which scheduling algorithm may cause starvation?

a. First-Come, First-Served (FCFS)
b. Shortest Job Next (SJN)
c. Round Robin (RR)
d. Priority Scheduling

A

d. Priority Scheduling

In priority scheduling, low-priority processes may starve if higher-priority processes continually arrive and get processed first.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following is true about paging?

a. It eliminates the need for a page table.
b. It can cause external fragmentation.
c. It uses fixed-size blocks of memory.
d. It uses variable-size blocks of memory.

A

c. It uses fixed-size blocks of memory.

Paging divides memory into fixed-size pages, reducing fragmentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a critical section in concurrent programming?

a. A section of code that must be executed by a single thread at a time
b. A section of code that can be executed by multiple threads simultaneously
c. A section of code that handles errors
d. A section of code that initializes resources

A

a. A section of code that must be executed by a single thread at a time

While multiple processes are executed concurrently, the critical section is protected so that only one thread can execute it at a time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In which memory allocation strategy does the system allocate the first hole that is big enough?

a. First fit
b. Best fit
c. Worst fit
d. Next fit

A

a. First fit

First fit allocates the first block of memory that is large enough to satisfy the request, which can lead to efficient use of memory but can also cause fragmentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is concurrency?

a. The ability of a system to handle requests sequentially
b. The ability of an operating system to handle multiple tasks simultaneously
c. The capability of an operating system to update itself
d. The process by which user rights are managed

A

b. The ability of an operating system to handle multiple tasks simultaneously

Concurrency refers to the system’s ability to handle multiple operations or tasks at the same time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a semaphore in operating systems?

a. A flag used to indicate the status of a process
b. A variable used to control access to a shared resource
c. A data structure used to store process information
d. A type of scheduling algorithm

A

b. A variable used to control access to a shared resource

Semaphores are used as synchronization mechanisms, helping to manage access to shared resources in a concurrent environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a mutex in operating systems?

a. A tool used for inter-process communication
b. A tool used to prevent deadlocks
c. A tool used to synchronize access to a shared resource
d. A tool used to allocate memory to processes

A

c. A tool used to synchronize access to a shared resource

Mutexes ensure that only one thread can access a resource at a time, preventing race conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the purpose of a mutex in concurrent programming?

a. To prevent deadlocks
b. To ensure mutual exclusion and synchronize access to shared resources
c. To allocate memory resources to processes
d. To maximize CPU utilization

A

b. To ensure mutual exclusion and synchronize access to shared resources

The primary purpose of a mutex is to ensure that only one thread can access a critical section or shared resource at any time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the difference between a semaphore and a mutex?

a. Semaphores can be used for mutual exclusion, while mutexes cannot
b. Mutexes can be used for mutual exclusion, while semaphores cannot
c. Mutexes can be used to control access to multiple resources, while semaphores cannot
d. Semaphores can be used to control access to multiple resources, while mutexes cannot

A

d. Semaphores can be used to control access to multiple resources, while mutexes cannot

Semaphores can be used for signaling and can control access to multiple instances of a resource, while mutexes are binary and typically used for mutual exclusion.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which component is essential for implementing virtual memory?

a. Page table
b. File system
c. Network interface card
d. Scheduler

A

a. Page table

The key component in translating virtual addresses to physical addresses in virtual memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a page fault in the context of virtual memory?

a. A hardware failure during memory access
b. A process requesting a page that is not in physical memory
c. An error in the file system
d. A segmentation fault in the CPU

A

b. A process requesting a page that is not in physical memory

A page fault occurs when a program tries to access a page that is not currently loaded into physical memory, triggering the OS to fetch it from disk.

17
Q

What condition guarantees a system is free from potential deadlocks?

a. There are enough resources to fulfill all process requests simultaneously.
b. No process is currently holding any resources.
c. A safe sequence exists in which processes can be completed without causing a deadlock.
d. The total number of active processes is less than the available resources.

A

c. A safe sequence exists in which processes can be completed without causing a deadlock.

If a safe sequence of process execution exists, the system can ensure that all processes can be completed without leading to a deadlock.

18
Q

In a virtual memory system with multiple processes, how does the operating system determine how much physical memory (frames) to assign to each process?

a. By using frame allocation algorithms that consider factors like process size and total memory.
b. By prioritizing processes based on their age (longest running gets the most frames).
c. By allocating all available frames to a single process at a time.
d. There’s no need for allocation, processes can freely claim any available frames.

A

a. By using frame allocation algorithms that consider factors like process size and total memory.

The OS uses frame allocation algorithms to determine the distribution of frames to processes, considering various factors to optimize performance.

19
Q

What is true about machine instructions and their arguments?

a. They take disk addresses as arguments.
b. They take both memory and disk addresses.
c. They do not take memory addresses.
d. They take memory addresses but not disk addresses.

A

d. They take memory addresses but not disk addresses.

Machine instructions typically operate on data stored in memory. This is why they take memory addresses and not directly handle disk addresses.

20
Q

Who can load the base and limit registers?

a. Any user program.
b. The operating system only.
c. Any application software.
d. The system hardware only.

A

Base and limit registers, which define the range of accessible memory for a program, are managed by the operating system to ensure security and proper functioning.