IIT Patna — M.Tech (AI & DS) · ECS 5102 · Quiz 2 (22–26 Nov 2026)
Re-attempted 1 Dec 2026, 12:43 · 20 questions · 20 / 20 correct ✅ Source: DebugHelper export of my own attempt (answers chosen by me, not by the model).
This is the same paper as FCS Quiz2 20 questions_2026-11-29.md
— the questions, options and distractors are identical, but the option order is shuffled and the
question order is different. Letter-for-letter comparison between the two files is meaningless; compare
by option text. The mapping table below is the authoritative cross-reference.
Verdict: every answer is right. No correction needed. Two items (Q8, Q17) were served from the local question bank rather than the model — both are also correct.
Mapping to the 29 Nov paper
| This file | Topic | 29 Nov paper | My answer | Correct | |---|---|---:|---|---|---| | Q1 | Spatial locality / row-major traversal | Q13 | A | ✅ | | Q2 | L1 miss ≠ DRAM | Q2 | B (False) | ✅ | | Q3 | Round Robin time quantum | Q4 | D | ✅ | | Q4 | CPU-bound vs I/O-bound work | Q3 | B (False) | ✅ | | Q5 | Program loading from SSD | Q5 | A | ✅ | | Q6 | Race condition (lost update) | Q10 | C | ✅ | | Q7 | Condition variables | Q18 | D | ✅ | | Q8 | Immediate addressing | Q1 | A | ✅ | | Q9 | Thread-pool sizing | Q20 | A | ✅ | | Q10 | Program counter | Q12 | C | ✅ | | Q11 | Instruction formats | Q9 | C | ✅ | | Q12 | Write-back caches | Q8 | C | ✅ | | Q13 | ISA vs microarchitecture (compiler) | Q19 | D | ✅ | | Q14 | Distributed concurrency | Q16 | B | ✅ | | Q15 | Producer–consumer coordination | Q6 | A | ✅ | | Q16 | ISA as a binary contract | Q14 | B (False) | ✅ | | Q17 | FCFS versus Round Robin | Q15 | B (False) | ✅ | | Q18 | Polling versus interrupts (basis) | Q11 | A | ✅ | | Q19 | L2 cache hits | Q7 | A | ✅ | | Q20 | Interrupt trade-offs ("always") | Q17 | B (False) | ✅ |
Answer key
| Q | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Answer | A | B | D | B | A | C | D | A | A | C |
| Q | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|
| Answer | C | C | D | B | A | B | B | A | A | B |
Per-question check
Q1. Column-wise traversal of a C row-major array — best fix?
✅ A — traverse row by row.
In C a 2-D array is row-major, so a[i][0..n] are contiguous and a 64-byte line holds 16 ints;
column-wise access strides by a full row, so every access touches a new line and wastes the rest.
Source: ../Lecture Notes/FCS Session - Memory Hierarchy and Virtual Memory.md
(locality, stride); transcript 22 Nov (temporal/spatial locality, cache line).
The export's "no course notes were uploaded" warning is stale — the notes exist and confirm A.
Q2. L1 miss ⇒ must come from DRAM and pay full penalty. True/False?
✅ B — False. The miss is passed to L2, then L3, then another core's cache; DRAM is touched only on a last-level miss. L1 ≈ 4 cycles, L2 ≈ 10–15, L3 ≈ 30–70, DRAM ≈ 200+. Source: 22 Nov transcript (cache hierarchy, miss handling); Memory Hierarchy notes.
Q3. Smaller Round Robin quantum → more context switching. Why?
✅ D — more expiries per unit of work, so more scheduling events and overhead.
Each expiry is a timer interrupt + state save/restore + cache/TLB disturbance. Too small a quantum
kills throughput; too large makes RR behave like FCFS.
Source: FCS_Session_Threads_and_CPU_Scheduling.md;
transcripts 11 Oct and 17 Oct (the scheduler simulator measures exactly this).
Q4. Processing time rises after switching to file/network work ⇒ CPU is faulty. True/False?
✅ B — False.
The workload moved from CPU-bound to I/O-bound; elapsed time is now dominated by disk latency,
syscalls, context switches and network round-trips, not by CPU throughput.
Source: 24 Oct transcript (CPU-intensive vs memory/storage-intensive workloads under top);
Session #1 notes.
Q5. Why is an SSD executable loaded into main memory first?
✅ A — the executable lives in secondary storage; the running code and data are made available in main memory. The CPU fetches only from registers/cache/RAM; the loader maps the image into the process address space (demand paging means pages arrive on first touch, not all at once). Source: 13 Sep transcript ("program stored on secondary storage → RAM → cache → registers"); Session #1 notes.
Q6. Two threads both buy the last item — what fixes it?
✅ C — make read-validate-update one critical section.
This is check-then-act: a lock around only the decrement still lets both threads pass validation.
Mutex/synchronized/atomic compare-and-set over the whole sequence makes the second thread see 0.
Source: FCS_Session_Synchronization_and_IPC.md
(critical sections); 11 Oct transcript notes race conditions on shared state.
Q7. Consumer wakes on a condition variable and removes without rechecking. Why unsafe?
✅ D — a wake-up does not guarantee the predicate; recheck in a while loop.
Another consumer may have drained the buffer, the wake may be spurious, or the signal may have been
for a different predicate. wait atomically releases and re-acquires the mutex, but says nothing
about the condition.
Source: Synchronization and IPC notes ("use condition variables to wait on predicates, rechecking
after wake-up").
Q8. Immediate addressing — where does the constant come from?
✅ A — it is encoded in the instruction itself.
ADD R1, #5 carries 5 in an immediate field; it arrives with the fetch and needs no separate data
memory access. It is not CISC-only (MIPS/ARM/RISC-V all have ADDI).
Source: FCS - Session #2 - ISA.md §3
("Immediate Addressing: Operand is a constant embedded directly in the instruction").
Q9. CPU under-utilised, threads blocked on the database — what first?
✅ A — measure and localise the bottleneck before changing the thread count. More threads help only if the limit is concurrency-limited I/O; if the DB, the connection pool or a lock is saturated, extra threads just queue and add switching cost. Source: Threads and CPU Scheduling notes; 17 Oct transcript (threading metrics, auto-scaling discussion).
Q10. Which register holds the address of the next instruction?
✅ C — the Program Counter (PC) / instruction pointer. Fetch puts PC on the address bus, latches the word into MDR/IR, then increments PC or loads the branch target. MDR holds the word, IR holds the current instruction, flags hold the condition codes. Source: 13 Sep transcript (fetch-decode-execute, PC glossary); Session #3 CPU notes.
Q11. Must every instruction in every ISA have the same number of bits?
✅ C — the ISA defines formats and encoding; length may vary between architectures. Fixed: MIPS32, AArch64. Variable: x86 (1–15 bytes), ARM Thumb-2, RISC-V with compressed extensions. Source: Session #2 ISA notes (instruction format fields); 25 Oct transcript.
Q12. Write-back cache — when does a modified line reach the next level?
✅ C — the line is updated and marked dirty; write-down is deferred to a later write-back event. Repeated writes to the same line cost nothing on the bus; the line goes down on eviction or an explicit clean/flush. "Every write immediately" is write-through. Source: 22 Nov transcript (write-through vs write-back, dirty lines, LRU eviction).
Q13. Two processors, same ISA, different pipeline/cache — how can both run the binary?
✅ D — the ISA is the software-visible contract; the microarchitecture implements it. Pipeline depth, cache size, execution units and branch prediction are implementation choices, invisible to correct programs. (Extension use, OS/ABI and library compatibility are separate requirements.) Source: 25 Oct transcript (ISA vs microarchitecture, x86-64/ARM64/RISC-V comparison).
Q14. Several server instances share one inventory DB — local mutex enough?
✅ B — enforce the invariant at the shared store (atomic conditional update / transaction control).
A process-local mutex is invisible to other instances; UPDATE ... WHERE stock > 0 (or SELECT ...
FOR UPDATE, serialisable isolation, optimistic versioning) is the correct scope.
Source: Synchronization and IPC notes (IPCs, cross-process scope); 5 Sep transcript (load
balancer → multiple instances behind one backend).
Q15. Consumer finds the bounded buffer empty — what should it do?
✅ A — wait for an available-item signal.
Two counting semaphores (full = 0, empty = N) plus a mutex; the consumer waits on full and the
producer signals it after insert. Signalling order matters or the system deadlocks.
Source: Synchronization and IPC notes (producer/consumer code, semaphores vs condition variables).
Q16. Same ISA ⇒ identical pipeline, caches and execution units. True/False?
✅ B — False. Identical ISA does not imply identical microarchitecture — that is the whole point of the ISA/micro split (Intel and AMD both implement x86-64 differently). Source: 25 Oct transcript; ISA notes.
Q17. Round Robin always reduces average turnaround for every process. True/False?
✅ B — False. RR buys response time, not turnaround. P1/P2/P3 arriving together, 10 units each, quantum 1, no switching cost: FCFS turnaround 10/20/30 → average 20; RR 28/29/30 → average 29. RR wins only when a long job would otherwise block short ones (convoy effect). Source: 11 Oct and 17 Oct transcripts (FCFS/RR/SJF/SRTF table: SJF lowest turnaround, RR lowest response).
Q18. Best basis for choosing polling vs interrupts?
✅ A — event frequency, response-time requirements, and the overhead of each mechanism.
Polling burns cycles on every check and bounds latency by the interval; interrupts avoid idle checks
but pay ISR entry/exit, latency jitter, priority and re-entrancy costs.
Source: 25 Oct transcript (polling interval trade-off, "how do real systems choose", Linux
/proc/interrupts); RISC/CISC and I/O notes.
Q19. L1 misses but the lines are in L2 — what follows?
✅ A — the processor can get the data from L2 without necessarily touching DRAM. The L2 hit supplies the block and refills L1; the penalty is higher than an L1 hit but far below DRAM. L2 is normally unified (instructions and data), not instruction-only. Source: 22 Nov transcript (miss handling, refill); Memory Hierarchy notes.
Q20. "Polling is always inefficient; interrupts are always better." True/False?
✅ B — False. Polling wins for frequent, predictable or very short-wait events and on simple MCUs; interrupts win for rare/irregular events but an interrupt flood can livelock the CPU. Real systems mix them (Linux NAPI: interrupt first, then poll under load). Source: 25 Oct transcript (both directions of the trade-off; "systems can use both").
What this re-attempt shows
- 20/20. The shuffled letters change nothing — every choice matches the canonical answer by text.
- The five True/False items (Q2, Q4, Q16, Q17, Q20) are all "False", which is a pattern worth noticing: in this paper the blanket/absolute claim is always the wrong one ("always", "must", "necessarily", "identical").
- Two items came from the local bank, not the model (Q8, Q17) — both correct, and both are the items where the export's confidence note says "bank mode".
- The export stamps "no course notes were uploaded" on 18 of 20 items. That is a DebugHelper configuration artefact, not a gap in the course material: the notes and transcripts cover every question, and the sources are quoted above.
Notes on the source files
- The canonical paper is
FCS Quiz2 20 questions_2026-11-29.md(20/20, with lecture quotes per answer). This file is the same paper re-attempted; keep both. - The 11 Oct FCS summary ends mid-sentence ("… only if the process") — the generated note was truncated. The scheduling metrics are still in the 17 Oct summary and in the Threads and CPU Scheduling lecture notes.