0% found this document useful (0 votes)
5 views2 pages

OS Interview Notes SWE2

This document provides an overview of operating systems, detailing their key functions such as process and memory management, and introduces important concepts like kernel mode, system calls, and CPU virtualization. It outlines common interview questions and includes examples of system calls and scheduling algorithms, such as Round Robin and MLFQ. Additionally, it presents design questions related to OS components and scheduling for specific use cases.

Uploaded by

newagetechnoguru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

OS Interview Notes SWE2

This document provides an overview of operating systems, detailing their key functions such as process and memory management, and introduces important concepts like kernel mode, system calls, and CPU virtualization. It outlines common interview questions and includes examples of system calls and scheduling algorithms, such as Round Robin and MLFQ. Additionally, it presents design questions related to OS components and scheduling for specific use cases.

Uploaded by

newagetechnoguru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Operating Systems Interview Notes (SWE-2 Level)

Part I: Introduction to Operating Systems

An operating system (OS) is software that acts as an intermediary between users and computer hardware. The OS
provides abstractions and manages resources. Key responsibilities include:

- Process Management
- Memory Management
- File System Management
- I/O Device Management
- Security and Protection

Key Concepts:
1. Kernel Mode vs User Mode
2. System Calls (e.g., fork(), exec(), read(), write())
3. Abstractions: process, virtual memory, file system

Common Interview Questions:


- What is an OS?
- What are the main functions of an OS?
- Explain the difference between kernel and user mode.
- What are system calls and how do they work?

Example:
Q: Explain fork() and exec() system calls.
A: fork() creates a new process (child), which is a copy of the parent. exec() replaces the current process memory with a
new program.

Fork-Exec Pattern:
```
pid_t pid = fork();
if (pid == 0) {
execvp(...);
} else {
wait(...);
}
```

Design Question:
- If you had to write an OS for a mobile device, what components would you prioritize?

Part II: CPU Virtualization & Scheduling

CPU Virtualization allows multiple processes to share the CPU efficiently.

Important Topics:
1. Time Sharing and Timer Interrupts
2. Scheduling Algorithms:
- FCFS (First Come First Serve)
Operating Systems Interview Notes (SWE-2 Level)

- SJF (Shortest Job First)


- Round Robin
- MLFQ (Multi-Level Feedback Queue)

3. Process States: NEW -> READY -> RUNNING -> WAITING -> TERMINATED

Context Switch:
Switching the CPU from one process to another. Involves saving and restoring states (PC, registers).

MLFQ Highlights:
- Multiple queues with different priorities.
- Aging to avoid starvation.
- Boosting to improve fairness.

Common Interview Questions:


- What is a context switch?
- Compare preemptive vs non-preemptive scheduling.
- Implement Round Robin scheduler in pseudocode.

Pseudocode Example: Round Robin


```
queue = all_processes
while queue is not empty:
process = queue.pop()
run(process, time_slice)
if process not finished:
queue.append(process)
```

System Design Question:


- Design a scheduler for an OS running on real-time embedded hardware.

You might also like