int main () {
int i;
for (i = 0; i < 3; i++){
if (fork() == 0){
continue;
}
break;
}
printf("Hello!");
return 0;
}
The total number of times that the printf statement gets executed is ________. (answer in integer)
GATE CS Operating System: 5 chapters, 48 previous year questions (100% of Operating System), 0 practice questions and one solved question from each chapter.
Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.
Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.
Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.
We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.
Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.
Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.
Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.
No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.
Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.
GATE CS Operating System: 5 chapters, 48 previous year questions (100% of Operating System), 0 practice questions and one solved question from each chapter.
48 previous year questions from Operating System in GATE CS, grouped by chapter with the exam year, answer key and step-by-step solution for each.
Operating System accounts for 48 of 48 Operating System previous year questions in our bank (100%), about 4.8 per paper across 10 papers.
| Chapter | Topics | PYQs | Share of unit PYQs | Practice questions |
|---|---|---|---|---|
| Processes, Threads, System Calls and Context Switching | Process States, Ready Queues and Context Switching, Threads and Thread Context, System Calls and User-Kernel Mode Transitions, Process Creation using Fork and Wait | 9 | 19% | 0 |
| CPU Scheduling | SJF and SRTF Scheduling Metrics, Scheduling Properties, Preemption and Starvation, Round Robin Scheduling and Context-Switch Sequences, Priority and Multiprocessor Scheduling | 9 | 19% | 0 |
| Concurrency, Synchronization and Deadlocks | Concurrent Interleavings and Shared-State Outcomes, Semaphore Synchronization, Ordering and Critical Sections, Deadlock Conditions, Resource Graphs and Avoidance, Lock-Based Resource Ownership, Livelock and Starvation | 12 | 25% | 0 |
| Memory Management, Paging and Virtual Memory | Paging, Page Tables, Address Translation and TLBs, Page Replacement, Page Faults and Locality, Contiguous Memory Allocation and Fragmentation | 14 | 29% | 0 |
| File Systems and Storage Allocation | Contiguous and Linked File Allocation, Directory Search and File Operations, Free-Space Management | 4 | 8% | 0 |
Which one of the following CPU scheduling algorithms cannot be preemptive?
Wait(A);
Print(*);
X = X+1;
If (X == 2)
{
Print($);
Signal(B);
}
Signal(A);
Wait(B);
Print(#);
Signal(B);