CS Atlas GATE 2027
Operating Systems course
0 / 58 complete

Operating Systems/Phase 1 · Processes & Threads

Checkpoint CP-1 · Item 12 of 58

Phase 1 Checkpoint (15 questions)

Read at your own pace. Try the questions before opening the answers.

On this page

Phase 1

Phase 1 Checkpoint: 15 questions on processes, fork, threads and IPC.

15 questions · 20 marks · 45 minutes. Negative marking on MCQ only: −1/3 mark for a wrong 1-mark MCQ, −2/3 for a wrong 2-mark MCQ. No negative marking for MSQ or NAT; MSQ has no partial credit.

Q1 · MCQ · 1 mark(s) — States

Which transition happens when a higher-priority process arrives under pre-emptive scheduling?

  1. (A) Ready → Terminated
  2. (B) Running → Ready
  3. (C) Running → Waiting
  4. (D) Waiting → Ready

Q2 · MSQ · 2 mark(s) — Transitions

Which transitions are possible in the five-state model?

  1. (A) Waiting → Ready
  2. (B) Ready → Waiting
  3. (C) Running → Terminated
  4. (D) New → Ready

Q3 · MCQ · 1 mark(s) — PCB

When a process is pre-empted, its register values are saved in:

  1. (A) the program's text segment
  2. (B) the disk's boot sector
  3. (C) the heap
  4. (D) its PCB

Q4 · NAT · 1 mark(s) — Fork

for (i = 0; i < 4; i++) fork(); Total number of processes (including the original)?

Numerical answer: ________

Q5 · NAT · 2 mark(s) — Fork

printf("start"); fork(); printf("A"); fork(); printf("B"); Total number of prints?

Numerical answer: ________

Q6 · NAT · 2 mark(s) — Fork

if (fork() == 0) { fork(); printf("1"); } else printf("2"); How many times is 1 printed?

Numerical answer: ________

Q7 · MCQ · 2 mark(s) — Fork values

int x = 5; if (fork() == 0) x = x + 5; else x = x − 5; printf("%d", x); What is printed?

  1. (A) 10 only
  2. (B) 10 and 0, in some order
  3. (C) 5 only
  4. (D) 5 and 5

Q8 · MCQ · 1 mark(s) — Schedulers

Which scheduler runs most often?

  1. (A) Long-term
  2. (B) Medium-term
  3. (C) Short-term
  4. (D) All equally

Q9 · MCQ · 1 mark(s) — Orphan

A parent exits while its child is still running. The child becomes:

  1. (A) an orphan, adopted by init
  2. (B) terminated automatically
  3. (C) a zombie
  4. (D) a thread

Q10 · MSQ · 2 mark(s) — Threads

Which are private to each thread?

  1. (A) Heap
  2. (B) Stack
  3. (C) Program counter
  4. (D) Registers

Q11 · MCQ · 1 mark(s) — User threads

Switching between user-level threads of the same process is fast because:

  1. (A) it switches the CPU to kernel mode
  2. (B) it reloads the whole process's memory
  3. (C) it does not require a system call
  4. (D) it is done by the disk

Q12 · MCQ · 1 mark(s) — Threads vs processes

Compared with processes, threads of one process:

  1. (A) share an address space
  2. (B) cannot run concurrently
  3. (C) have separate address spaces
  4. (D) need pipes to share data

Q13 · MCQ · 1 mark(s) — IPC

Which IPC method works between processes on different computers?

  1. (A) Shared memory
  2. (B) Shared heap
  3. (C) Ordinary pipes
  4. (D) Message passing (sockets)

Q14 · NAT · 1 mark(s) — Pipes

A parent communicates two-way with each of its 4 children using ordinary pipes. Minimum number of pipes?

Numerical answer: ________

Q15 · MCQ · 1 mark(s) — Producer–consumer

The consumer must wait when the shared buffer is:

  1. (A) never
  2. (B) empty
  3. (C) full
  4. (D) half full

✓Answer Vault

Try the questions first. Open when you are ready to check.

🔐 Open the Answer Vault

Q1 Answer: (B) · 1 mark(s)

The running process is pre-empted.

  • (A) is wrong: Impossible.
  • (C) is wrong: Waiting is for events.
  • (D) is wrong: Unrelated.

Re-read: Lesson 1.1.1 — Processes: memory layout, process control block and process states

Q2 Answer: (A) (C) (D) · 2 mark(s)

A ready process cannot request I/O.

  • (B) is wrong: Impossible.

Re-read: Lesson 1.1.1 — Processes: memory layout, process control block and process states

Q3 Answer: (D) · 1 mark(s)

To be restored later.

  • (A) is wrong: Code is read-only.
  • (B) is wrong: Unrelated.
  • (C) is wrong: Not the heap.

Re-read: Lesson 1.1.1 — Processes: memory layout, process control block and process states

Q4 Answer: 16 · 1 mark(s)

2⁴.

Re-read: Lesson 1.1.2 — Creating processes with fork(), exec() and wait(); context switches and schedulers

Q5 Answer: 7 · 2 mark(s)

1 + 2 + 4.

Re-read: Lesson 1.1.2 — Creating processes with fork(), exec() and wait(); context switches and schedulers

Q6 Answer: 2 · 2 mark(s)

The child and the child's child print 1.

Re-read: Lesson 1.1.2 — Creating processes with fork(), exec() and wait(); context switches and schedulers

Q7 Answer: (B) · 2 mark(s)

Separate copies of x.

  • (A) is wrong: The parent prints too.
  • (C) is wrong: Both change x.
  • (D) is wrong: Both change their copy.

Re-read: Lesson 1.1.2 — Creating processes with fork(), exec() and wait(); context switches and schedulers

Q8 Answer: (C) · 1 mark(s)

It picks the next process every few milliseconds.

  • (A) is wrong: Rare.
  • (B) is wrong: Occasional.
  • (D) is wrong: No.

Re-read: Lesson 1.1.2 — Creating processes with fork(), exec() and wait(); context switches and schedulers

Q9 Answer: (A) · 1 mark(s)

It has lost its parent.

  • (B) is wrong: It continues.
  • (C) is wrong: Zombie = exited child not reaped.
  • (D) is wrong: Unrelated.

Re-read: Lesson 1.1.2 — Creating processes with fork(), exec() and wait(); context switches and schedulers

Q10 Answer: (B) (C) (D) · 2 mark(s)

The heap is shared.

  • (A) is wrong: Shared.

Re-read: Lesson 1.2.1 — Threads: what they share, user-level vs kernel-level threads

Q11 Answer: (C) · 1 mark(s)

The library switches in user mode.

  • (A) is wrong: No mode switch happens.
  • (B) is wrong: Threads share the same memory; nothing is reloaded.
  • (D) is wrong: Unrelated.

Re-read: Lesson 1.2.1 — Threads: what they share, user-level vs kernel-level threads

Q12 Answer: (A) · 1 mark(s)

Same memory.

  • (B) is wrong: They can.
  • (C) is wrong: That is processes.
  • (D) is wrong: They share memory directly.

Re-read: Lesson 1.2.1 — Threads: what they share, user-level vs kernel-level threads

Q13 Answer: (D) · 1 mark(s)

Messages travel over the network.

  • (A) is wrong: Same machine only.
  • (B) is wrong: Not a mechanism.
  • (C) is wrong: Same machine only.

Re-read: Lesson 1.2.2 — Inter-process communication: shared memory, message passing and pipes

Q14 Answer: 8 · 1 mark(s)

Two per child.

Re-read: Lesson 1.2.2 — Inter-process communication: shared memory, message passing and pipes

Q15 Answer: (B) · 1 mark(s)

Nothing to consume.

  • (A) is wrong: It must wait when empty.
  • (C) is wrong: The producer waits then.
  • (D) is wrong: Fine to consume.

Re-read: Lesson 1.2.2 — Inter-process communication: shared memory, message passing and pipes

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.