Tenta Flashcards

1
Q

What are the main components of a computer system?

A

CPU, Memory (RAM/ROM), Input/Output Devices, and System Bus

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

What is the difference between volatile and non-volatile memory?

A

Volatile memory (e.g., RAM) loses data when powered off; non-volatile memory (e.g., SSD, HDD) retains data.

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

How does an operating system provide resource abstraction?

A

It hides the complexity of hardware by providing standardized interfaces (e.g., file systems, virtual memory).

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

Can a single-core CPU run multiple programs simultaneously?

A

Yes, via time-sharing. The CPU switches between tasks rapidly.

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

Name two mechanisms operating systems use to ensure protection in multiprogramming.

A

1) User and Kernel Modes, 2) Access Control via Permissions.

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

What are the steps of the processor instruction cycle?

A

Fetch, Decode, Execute, Store.

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

Describe the difference between stack-based and register-based architectures.

A

Stack-based uses a last-in, first-out stack for operations; register-based uses general-purpose register

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

What are the advantages of a stack-based architecture?

A

Simplified instruction set and no need to manage register allocation manually.

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

What is the role of an interrupt in process management?

A

Interrupts allow the CPU to pause a running process and handle an urgent task (e.g., I/O operation

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

What is a race condition in synchronization?

A

A situation where multiple processes access shared resources concurrently, leading to unpredictable results.

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

Name two techniques to prevent deadlock.

A

1) Avoiding circular wait, 2) Resource allocation graphs.

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

In the Five-State Process Model, what happens during a “Blocked to Ready” transition?

A

A waiting process receives the needed resource or event signal and is ready to execute.

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

Why would you recommend stack-based architecture for teaching kids?

A

Simple execution model and less overhead, making it easier to understand basic programming concepts.

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

Why are smaller unit allocation sizes not always ideal for file storage?

A

They reduce internal fragmentation but increase metadata overhead.

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

For a self-driving car, which device communication method should you use?

A

Interrupt-driven communication for real-time responsiveness to human inputs (e.g., braking).

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

How would you avoid race conditions in a deposit and withdrawal system?

A

Use locks to synchronize access and ensure atomic operations. Avoid deadlocks by acquiring locks in a consistent order.

17
Q

Why is multiprogramming useful in operating systems?

A

Increases CPU utilization by overlapping I/O-bound and CPU-bound tasks.

18
Q

What is the role of the operating system?

A

It interfaces between the user’s program and hardware, providing resource sharing, abstraction, security, and performance optimization

19
Q

What are the types of instructions in the CPU?

A

Data Transfer Instructions: Move data between locations.

Data Operation Instructions: Perform operations on data (e.g., add, subtract).

Program Control Instructions: Control program flow (e.g., jumps, interrupts).

20
Q

Compare Stack-based and General Purpose Register (GPR) architectures.

A

Stack-based: Smaller code size, automatic register management, good for embedded systems.

GPR: Better performance with compilers, allows explicit register management, used in modern computers.

21
Q

How does a stack-based architecture handle operands?

A

Operands are pushed to or popped from the stack, with results also stored on the stack.

22
Q

How does a GPR architecture handle operands?

A

Operands are stored in registers specified in the instruction (e.g., ADD r1, r2, r3).

23
Q

What are the advantages of stack-based architectures?

A

Compact code size.

Simplifies program design by avoiding manual register allocation.

24
Q

What are the advantages of GPR architectures?

A

Higher performance due to compiler optimizations.

Flexible operand handling using registers.

25
Q

What is a process?

A

A program in execution, consisting of:

Program.

Data.

Process Control Block (PCB).

26
Q

What are the five states in the Five-State Process Model?

A

New, Ready, Running, Blocked, Terminated.

27
Q

Why are suspended processes used?

A

To free up memory when all processes are waiting for I/O operations

28
Q

What is a Process Control Block (PCB)?

A

A data structure containing information about the process, such as its state, program counter, and resources.

29
Q

What are cooperative and preemptive schedulers?

A

Cooperative: Processes voluntarily yield the CPU.

Preemptive: CPU is forcibly taken from a process using an interrup

30
Q

What is the aim of scheduling?

A

To ensure efficiency, fairness, and system responsiveness.

31
Q

What are MLQ and MLQF scheduling?

A

MLQ (Multi-Level Queue): Divides processes into different priority levels.

MLQF (Multi-Level Queue with Feedback): Allows processes to move between queues based on execution characteristics.

32
Q

What are the four conditions for deadlock?

A

Mutex: Non-shareable resources.

No pre-emption: Resources cannot be forcibly taken.

Hold and wait: A process holds one resource while waiting for another.

Circular wait: A circular chain of processes exists, each waiting for a resource held by another.

33
Q

What is a semaphore?

A

A synchronization primitive used to manage access to shared resources using wait() and signal() operations.

34
Q
A