diff --git a/docs/autopilot.md b/docs/autopilot.md index fa6fea2..ccd7256 100644 --- a/docs/autopilot.md +++ b/docs/autopilot.md @@ -59,7 +59,9 @@ The owner's priority since 2026-11-03: proper exam practice. The design, decisio - [x] Discrete Mathematics: +26 (42 → 68), 1 or 2 for each of the 17 taught lessons, each with `lesson` and `section`. (PR #101) - [x] Data Structures: +20 (28 → 48) and Computer Networks: +9 (27 → 36), 1 or 2 per taught lesson, each with `lesson` and `section`. (PR #102, stacked on #101) - 4c is done for every course except Logic Design and Computer Architecture (inline practice, owner's decision pending), Algorithm Design (owner's) and Advanced Software Engineering (its authors'). - - [ ] 4d. Set `lesson`/`section` on the 259 migrated questions. + - [ ] 4d. Set `lesson`/`section` on the migrated quiz questions. Counted 2026-11-19: 262 untagged in 9 courses. + - [x] Computer Organization 10, Microprocessors 10, Computer Architecture 6, Computer Networks 27, Data Structures 28: 81 tagged. (PR #104, stacked on #102) + - [ ] Still untagged: Computational Mathematics 83, Discrete Mathematics 42, Logic Design 40, Algorithm Design 16. - [ ] 5. Generated questions (subnets, scheduling, Big-O first). - [ ] 6. Account sync for review cards and exam attempts. @@ -94,6 +96,7 @@ Nothing. The exam-stack block (since 2026-11-06, over #68's inline practice ques Newest first. One line per run: date and run, what was done, PR link, merged or open. +- 2026-11-19 06:10 (run A): exam phase 4d started. Tagged 81 migrated quiz questions in five courses with the lesson (and, where one heading teaches it, the section) that teaches each, checked against the lesson text. The bank test confirms every lesson and heading exists. PR #104, open, stacked on #102. - 2026-11-18 10:40 (run B): exam phase 4c, the last two courses: Data Structures +20 and Computer Networks +9, numbers checked by script (g[2][1] at 1036, 31 copies for 17 doubling appends, ring back at index 1, heap parent of 9 is 4, 10 ms over 2,000 km, cwnd 16 after 4 slow-start round trips). Next exam phase: 4d, tagging the 259 migrated quiz questions with `lesson` and `section`. PR #102, open, stacked on #101. - 2026-11-18 06:10 (run A): the owner merged everything on 2026-11-17 (the exam stack #90 to #96, #86, #92, #99, #100), so this phase branches from main again. Exam phase 4c, Discrete Mathematics: +26 questions over all 17 taught lessons (precedence, vacuous truth, contrapositive vs converse, nested quantifiers, composition order, partial orders, proof setups, the base case, strong induction, invariant checks, sum and product rules, binomial and Pascal, pigeonhole, K₇, Euler vs Hamiltonian, tree height, expectation, birthday pairs), numbers checked by script. PR #101, open. - 2026-11-17 14:50 (run C): from the 2026-11-12 audit, the Computer Organization `bits-and-bytes` unit ladder (124 px too wide at 390 px) now fits. Its captions now sit under their bars in a two-column grid at every width, which also fixes the desktop TB and PB captions wrapping unindented, and "2^0 = 1 bytes" now reads "1 byte". PR #99, open. Its CI check is red only because main is: The Exam Mind's round 7 (#97) renamed a heading that a bank question points at; fixed in PR #100. diff --git a/src/content/computer-architecture/questions.ts b/src/content/computer-architecture/questions.ts index 9d7543d..d54f29a 100644 --- a/src/content/computer-architecture/questions.ts +++ b/src/content/computer-architecture/questions.ts @@ -247,6 +247,8 @@ export const questions: Question[] = [ { id: "computer-architecture/hardware-datapath-quiz/q1", quiz: "hardware-datapath-quiz", + lesson: "demystifying-circuit-schematics", + section: "marks-on-wires-and-pins", prompt: "In a digital schematic, what does an inversion bubble (small circle) on an input pin signify?", options: [ { id: "a", text: "The input is active-low: it acts when pulled to 0" }, @@ -260,6 +262,8 @@ export const questions: Question[] = [ { id: "computer-architecture/hardware-datapath-quiz/q2", quiz: "hardware-datapath-quiz", + lesson: "sequential-logic-and-latches", + section: "the-sr-latch", prompt: "Why is S = 1 and R = 1 considered a forbidden input condition in an SR latch built from NOR gates?", options: [ { id: "a", text: "It causes both outputs Q and Q' to become 0, and subsequent release produces an unpredictable race condition" }, @@ -273,6 +277,8 @@ export const questions: Question[] = [ { id: "computer-architecture/hardware-datapath-quiz/q3", quiz: "hardware-datapath-quiz", + lesson: "registers-and-shift-registers", + section: "shift-registers", prompt: "A 4-bit Serial-In Serial-Out (SISO) shift register starts cleared at 0000. Data bits 1, 0, 1, 1 arrive sequentially, shifting right with bits entering at the most significant bit (Q3). What is the register's 4-bit state immediately after the 4th clock tick?", options: [ { id: "a", text: "1101" }, @@ -286,6 +292,8 @@ export const questions: Question[] = [ { id: "computer-architecture/hardware-datapath-quiz/q4", quiz: "hardware-datapath-quiz", + lesson: "ripple-and-synchronous-counters", + section: "the-settling-problem", prompt: "A 4-bit binary ripple counter has a flip-flop propagation delay of 12 ns per stage. What is the maximum settling time when rolling from 7 (0111) to 8 (1000)?", options: [ { id: "a", text: "48 ns" }, @@ -299,6 +307,8 @@ export const questions: Question[] = [ { id: "computer-architecture/hardware-datapath-quiz/q5", quiz: "hardware-datapath-quiz", + lesson: "ripple-and-synchronous-counters", + section: "synchronous-counters", prompt: "In designing a 3-bit synchronous binary counter using T flip-flops, what is the required input equation for the most significant toggle input T2?", options: [ { id: "a", text: "T2 = A1 · A0" }, @@ -312,6 +322,8 @@ export const questions: Question[] = [ { id: "computer-architecture/hardware-datapath-quiz/q6", quiz: "hardware-datapath-quiz", + lesson: "ripple-and-synchronous-counters", + section: "the-program-counter", prompt: "How does the CPU's Program Counter (PC) handle non-sequential jumps and branches?", options: [ { id: "a", text: "The control unit sets the PC's LOAD input, and the jump address is loaded into its flip-flops" }, diff --git a/src/content/computer-networks/questions.ts b/src/content/computer-networks/questions.ts index 6ffab40..be54cdb 100644 --- a/src/content/computer-networks/questions.ts +++ b/src/content/computer-networks/questions.ts @@ -7,6 +7,8 @@ export const questions: Question[] = [ { id: "computer-networks/foundations-quiz/q1", quiz: "foundations-quiz", + lesson: "layers-and-packets", + section: "the-four-layers", prompt: "Which layer's job is to deliver data to the right program on a machine, using port numbers?", options: [ { id: "a", text: "Application" }, @@ -20,6 +22,8 @@ export const questions: Question[] = [ { id: "computer-networks/foundations-quiz/q2", quiz: "foundations-quiz", + lesson: "layers-and-packets", + section: "encapsulation", prompt: "A router forwarding a packet normally reads which headers?", options: [ { id: "a", text: "Only the HTTP request" }, @@ -33,6 +37,8 @@ export const questions: Question[] = [ { id: "computer-networks/foundations-quiz/q3", quiz: "foundations-quiz", + lesson: "delay-and-throughput", + section: "four-kinds-of-delay", prompt: "A 12,000-bit packet goes onto a 1 Mb/s link. What is its transmission delay?", options: [ { id: "a", text: "1.2 µs" }, @@ -46,6 +52,8 @@ export const questions: Question[] = [ { id: "computer-networks/foundations-quiz/q4", quiz: "foundations-quiz", + lesson: "delay-and-throughput", + section: "latency-round-trips-and-throughput", prompt: "You upgrade from 100 Mb/s to 1 Gb/s, but a small web page from another continent loads almost as slowly. Why?", options: [ { id: "a", text: "The upgrade didn't work" }, @@ -59,6 +67,8 @@ export const questions: Question[] = [ { id: "computer-networks/foundations-quiz/q5", quiz: "foundations-quiz", + lesson: "delay-and-throughput", + section: "latency-round-trips-and-throughput", prompt: "A path crosses links of 1 Gb/s, 50 Mb/s and 300 Mb/s. What is the most throughput you can get end to end?", options: [ { id: "a", text: "1 Gb/s" }, @@ -72,6 +82,8 @@ export const questions: Question[] = [ { id: "computer-networks/foundations-quiz/q6", quiz: "foundations-quiz", + lesson: "delay-and-throughput", + section: "latency-round-trips-and-throughput", prompt: "Why must a fast sender on a long-distance link keep many bytes \"in flight\" rather than waiting for each reply?", options: [ { id: "a", text: "To save memory" }, @@ -85,6 +97,8 @@ export const questions: Question[] = [ { id: "computer-networks/network-quiz/q1", quiz: "network-quiz", + lesson: "ip-addresses-and-subnets", + section: "network-part-and-host-part", prompt: "How many usable host addresses does a /27 subnet have?", options: [ { id: "a", text: "27" }, @@ -98,6 +112,8 @@ export const questions: Question[] = [ { id: "computer-networks/network-quiz/q2", quiz: "network-quiz", + lesson: "ip-addresses-and-subnets", + section: "network-part-and-host-part", prompt: "What is the network address of 172.16.5.4/20?", options: [ { id: "a", text: "172.16.0.0" }, @@ -111,6 +127,8 @@ export const questions: Question[] = [ { id: "computer-networks/network-quiz/q3", quiz: "network-quiz", + lesson: "routing", + section: "longest-prefix-match", prompt: "A forwarding table has 10.0.0.0/8 → A, 10.4.0.0/16 → B and 0.0.0.0/0 → C. Where does a packet for 10.4.9.1 go?", options: [ { id: "a", text: "A, the first match" }, @@ -124,6 +142,8 @@ export const questions: Question[] = [ { id: "computer-networks/network-quiz/q4", quiz: "network-quiz", + lesson: "ip-addresses-and-subnets", + section: "private-addresses-and-nat", prompt: "Your laptop at home has the address 192.168.1.23. How can it reach a public website?", options: [ { id: "a", text: "192.168 addresses are public" }, @@ -137,6 +157,8 @@ export const questions: Question[] = [ { id: "computer-networks/network-quiz/q5", quiz: "network-quiz", + lesson: "routing", + section: "link-state-routing", prompt: "In link-state routing, what does each router use to compute its forwarding table?", options: [ { id: "a", text: "Only its neighbours' distance estimates" }, @@ -150,6 +172,8 @@ export const questions: Question[] = [ { id: "computer-networks/network-quiz/q6", quiz: "network-quiz", + lesson: "routing", + section: "ttl-and-traceroute", prompt: "What stops a packet circulating forever if routers form a loop?", options: [ { id: "a", text: "The TCP checksum" }, @@ -163,6 +187,8 @@ export const questions: Question[] = [ { id: "computer-networks/transport-quiz/q1", quiz: "transport-quiz", + lesson: "udp-and-ports", + section: "ports", prompt: "One web server on port 443 is talking to 5,000 browsers at once. How does it tell their connections apart?", options: [ { id: "a", text: "Each browser uses a different server port" }, @@ -176,6 +202,8 @@ export const questions: Question[] = [ { id: "computer-networks/transport-quiz/q2", quiz: "transport-quiz", + lesson: "udp-and-ports", + section: "why-use-an-unreliable-protocol", prompt: "Which is a good reason to choose UDP over TCP?", options: [ { id: "a", text: "You need every byte delivered in order" }, @@ -189,6 +217,8 @@ export const questions: Question[] = [ { id: "computer-networks/transport-quiz/q3", quiz: "transport-quiz", + lesson: "tcp-reliable-delivery", + section: "a-reliable-byte-stream", prompt: "A client sends `send(\"ab\")` then `send(\"cd\")` over TCP. What might one `recv(10)` on the server return?", options: [ { id: "a", text: "Always exactly \"ab\"" }, @@ -202,6 +232,8 @@ export const questions: Question[] = [ { id: "computer-networks/transport-quiz/q4", quiz: "transport-quiz", + lesson: "tcp-reliable-delivery", + section: "sequence-numbers-and-acknowledgements", prompt: "A receiver has bytes up to 199, and segments starting at 300 and 400 arrive, but 200 to 299 is missing. What ACK number does it send?", options: [ { id: "a", text: "200" }, @@ -215,6 +247,8 @@ export const questions: Question[] = [ { id: "computer-networks/transport-quiz/q5", quiz: "transport-quiz", + lesson: "tcp-reliable-delivery", + section: "retransmission", prompt: "Why does TCP resend after three duplicate ACKs instead of waiting for the timeout?", options: [ { id: "a", text: "Duplicate ACKs mean the connection is closing" }, @@ -228,6 +262,8 @@ export const questions: Question[] = [ { id: "computer-networks/transport-quiz/q6", quiz: "transport-quiz", + lesson: "congestion-control", + section: "backing-off", prompt: "In congestion avoidance, a TCP Reno sender has cwnd = 20 and gets three duplicate ACKs. What happens?", options: [ { id: "a", text: "cwnd becomes 1 and slow start restarts" }, @@ -241,6 +277,8 @@ export const questions: Question[] = [ { id: "computer-networks/transport-quiz/q7", quiz: "transport-quiz", + lesson: "congestion-control", + section: "why-aimd-is-fair", prompt: "Why does AIMD make competing flows converge to equal shares?", options: [ { id: "a", text: "Routers divide the bandwidth evenly" }, @@ -254,6 +292,8 @@ export const questions: Question[] = [ { id: "computer-networks/final-quiz/q1", quiz: "final-quiz", + lesson: "dns", + section: "resolution", prompt: "You type a URL for a site you've never visited. What happens first, before any connection to the site?", options: [ { id: "a", text: "A TCP handshake with the site" }, @@ -267,6 +307,8 @@ export const questions: Question[] = [ { id: "computer-networks/final-quiz/q2", quiz: "final-quiz", + lesson: "dns", + section: "resolution", prompt: "Your resolver has no cache. How does it find the address for www.decoded-demo.com?", options: [ { id: "a", text: "It asks one central server that knows every name" }, @@ -280,6 +322,8 @@ export const questions: Question[] = [ { id: "computer-networks/final-quiz/q3", quiz: "final-quiz", + lesson: "dns", + section: "caching-and-ttl", prompt: "You change your website's A record, but some users still reach the old server an hour later. Why?", options: [ { id: "a", text: "DNS changes need a server restart" }, @@ -293,6 +337,8 @@ export const questions: Question[] = [ { id: "computer-networks/final-quiz/q4", quiz: "final-quiz", + lesson: "http-and-https", + section: "https-and-tls", prompt: "Over TCP with TLS 1.3, how many round trips pass before the first byte of the HTTP request can be sent (ignoring DNS)?", options: [ { id: "a", text: "0" }, @@ -306,6 +352,8 @@ export const questions: Question[] = [ { id: "computer-networks/final-quiz/q5", quiz: "final-quiz", + lesson: "ip-addresses-and-subnets", + section: "network-part-and-host-part", prompt: "Your laptop (192.168.1.23/24) sends a packet to 203.0.113.10. Where does it send the packet first?", options: [ { id: "a", text: "Directly to 203.0.113.10 over Wi-Fi" }, @@ -319,6 +367,8 @@ export const questions: Question[] = [ { id: "computer-networks/final-quiz/q6", quiz: "final-quiz", + lesson: "routing", + section: "longest-prefix-match", prompt: "A router in the middle of the internet forwards the packet. What does it look at?", options: [ { id: "a", text: "The HTTP request, to see what's being fetched" }, @@ -332,6 +382,8 @@ export const questions: Question[] = [ { id: "computer-networks/final-quiz/q7", quiz: "final-quiz", + lesson: "tcp-reliable-delivery", + section: "retransmission", prompt: "One segment of the page is lost on the way back. What does the browser's application code see?", options: [ { id: "a", text: "A gap in the page" }, @@ -345,6 +397,8 @@ export const questions: Question[] = [ { id: "computer-networks/final-quiz/q8", quiz: "final-quiz", + lesson: "http-and-https", + section: "requests-and-responses", prompt: "The server responds with status 304. What should the browser do?", options: [ { id: "a", text: "Show an error page" }, diff --git a/src/content/computer-organization/questions.ts b/src/content/computer-organization/questions.ts index 49be7fe..bfb46ea 100644 --- a/src/content/computer-organization/questions.ts +++ b/src/content/computer-organization/questions.ts @@ -7,6 +7,7 @@ export const questions: Question[] = [ { id: "computer-organization/final-quiz/q1", quiz: "final-quiz", + lesson: "inside-the-cpu", prompt: "What makes up the CPU?", options: [ { id: "a", text: "The control unit, ALU and registers" }, @@ -20,6 +21,8 @@ export const questions: Question[] = [ { id: "computer-organization/final-quiz/q2", quiz: "final-quiz", + lesson: "whats-inside", + section: "the-idea-that-makes-it-all-work", prompt: "What does the stored-program idea mean?", options: [ { id: "a", text: "Programs are saved to the hard disk" }, @@ -33,6 +36,8 @@ export const questions: Question[] = [ { id: "computer-organization/final-quiz/q3", quiz: "final-quiz", + lesson: "inside-the-cpu", + section: "the-registers-that-matter-most", prompt: "The PC register holds:", options: [ { id: "a", text: "The instruction running now" }, @@ -46,6 +51,7 @@ export const questions: Question[] = [ { id: "computer-organization/final-quiz/q4", quiz: "final-quiz", + lesson: "machine-cycle", prompt: "What's the correct order of the machine cycle?", options: [ { id: "a", text: "Decode, fetch, execute, store" }, @@ -59,6 +65,8 @@ export const questions: Question[] = [ { id: "computer-organization/final-quiz/q5", quiz: "final-quiz", + lesson: "buses", + section: "width-is-everything", prompt: "A CPU has 24 address lines. How much byte-addressable memory can it reach?", options: [ { id: "a", text: "24 MB" }, @@ -72,6 +80,7 @@ export const questions: Question[] = [ { id: "computer-organization/final-quiz/q6", quiz: "final-quiz", + lesson: "buses", prompt: "Which bus carries values in both directions?", options: [ { id: "a", text: "The address bus" }, @@ -85,6 +94,8 @@ export const questions: Question[] = [ { id: "computer-organization/final-quiz/q7", quiz: "final-quiz", + lesson: "ram-and-rom", + section: "two-kinds-of-ram", prompt: "Why is cache made from SRAM and main memory from DRAM?", options: [ { id: "a", text: "SRAM is faster but costs more per bit, while DRAM is cheaper and denser" }, @@ -98,6 +109,8 @@ export const questions: Question[] = [ { id: "computer-organization/final-quiz/q8", quiz: "final-quiz", + lesson: "memory-hierarchy", + section: "why-such-a-small-cache-works", prompt: "A program loops over an array. Which property of programs makes cache effective here?", options: [ { id: "a", text: "Volatility" }, @@ -111,6 +124,8 @@ export const questions: Question[] = [ { id: "computer-organization/final-quiz/q9", quiz: "final-quiz", + lesson: "hard-disks", + section: "capacity", prompt: "A disk has 1000 cylinders, 4 heads, 100 sectors per track and 512-byte sectors. What's its capacity?", options: [ { id: "a", text: "20,480,000 bytes" }, @@ -124,6 +139,8 @@ export const questions: Question[] = [ { id: "computer-organization/final-quiz/q10", quiz: "final-quiz", + lesson: "ssds-and-optical", + section: "optical-discs", prompt: "Why does a Blu-ray disc hold more than a CD of the same size?", options: [ { id: "a", text: "It spins faster" }, diff --git a/src/content/data-structures/questions.ts b/src/content/data-structures/questions.ts index b925a49..9bf2301 100644 --- a/src/content/data-structures/questions.ts +++ b/src/content/data-structures/questions.ts @@ -7,6 +7,8 @@ export const questions: Question[] = [ { id: "data-structures/lists-quiz/q1", quiz: "lists-quiz", + lesson: "arrays-and-memory", + section: "memory-is-one-long-array", prompt: "An int array starts at address 2000 and each int takes 4 bytes. Where is a[25]?", options: [ { id: "a", text: "2025" }, @@ -20,6 +22,8 @@ export const questions: Question[] = [ { id: "data-structures/lists-quiz/q2", quiz: "lists-quiz", + lesson: "arrays-and-memory", + section: "what-arrays-are-good-and-bad-at", prompt: "Why is inserting at index 0 of a 1,000,000-item array slow?", options: [ { id: "a", text: "Finding index 0 takes a long time" }, @@ -33,6 +37,8 @@ export const questions: Question[] = [ { id: "data-structures/lists-quiz/q3", quiz: "lists-quiz", + lesson: "dynamic-arrays", + section: "why-doubling-is-o1-per-append", prompt: "A dynamic array doubles its capacity when full. What is the amortized cost of an append?", options: [ { id: "a", text: "O(1)" }, @@ -46,6 +52,8 @@ export const questions: Question[] = [ { id: "data-structures/lists-quiz/q4", quiz: "lists-quiz", + lesson: "dynamic-arrays", + section: "why-doubling-is-o1-per-append", prompt: "A dynamic array grows by 100 slots each time it fills. Appending n items costs in total:", options: [ { id: "a", text: "O(n)" }, @@ -59,6 +67,8 @@ export const questions: Question[] = [ { id: "data-structures/lists-quiz/q5", quiz: "lists-quiz", + lesson: "linked-lists", + section: "the-costs-compared-with-an-array", prompt: "Which operation is O(1) on a singly linked list with only a head pointer?", options: [ { id: "a", text: "Read the 50th item" }, @@ -72,6 +82,8 @@ export const questions: Question[] = [ { id: "data-structures/lists-quiz/q6", quiz: "lists-quiz", + lesson: "arrays-and-memory", + section: "why-contiguous-is-fast-in-practice", prompt: "Summing a million numbers stored in an array is usually much faster than in a linked list. Why, given both are O(n)?", options: [ { id: "a", text: "Arrays use fewer instructions per addition" }, @@ -85,6 +97,8 @@ export const questions: Question[] = [ { id: "data-structures/stacks-queues-quiz/q1", quiz: "stacks-queues-quiz", + lesson: "stacks", + section: "the-interface", prompt: "You push A, B, C onto a stack, pop once, then push D. What does the next pop return?", options: [ { id: "a", text: "A" }, @@ -98,6 +112,8 @@ export const questions: Question[] = [ { id: "data-structures/stacks-queues-quiz/q2", quiz: "stacks-queues-quiz", + lesson: "stacks", + section: "matching-brackets", prompt: "Which string makes a bracket checker stop with \"closer doesn't match the top\"?", options: [ { id: "a", text: "(()" }, @@ -111,6 +127,8 @@ export const questions: Question[] = [ { id: "data-structures/stacks-queues-quiz/q3", quiz: "stacks-queues-quiz", + lesson: "queues-and-deques", + section: "the-slow-way", prompt: "Why is list.pop(0) a poor way to dequeue from a Python list?", options: [ { id: "a", text: "It removes from the wrong end" }, @@ -124,6 +142,8 @@ export const questions: Question[] = [ { id: "data-structures/stacks-queues-quiz/q4", quiz: "stacks-queues-quiz", + lesson: "queues-and-deques", + section: "the-ring-buffer", prompt: "A ring buffer has capacity 8, head = 6 and size = 4. Where does the next enqueue go?", options: [ { id: "a", text: "Slot 10" }, @@ -137,6 +157,8 @@ export const questions: Question[] = [ { id: "data-structures/stacks-queues-quiz/q5", quiz: "stacks-queues-quiz", + lesson: "hash-maps", + section: "load-factor-and-resizing", prompt: "A hash map has 16 buckets and 12 keys, and resizes when the load factor passes 0.75. What happens when you add a 13th key?", options: [ { id: "a", text: "Nothing: 13/16 is still under 1" }, @@ -150,6 +172,8 @@ export const questions: Question[] = [ { id: "data-structures/stacks-queues-quiz/q6", quiz: "stacks-queues-quiz", + lesson: "hash-maps", + section: "the-worst-case", prompt: "Why does Python's hash(\"hello\") give a different number each time you start Python?", options: [ { id: "a", text: "A bug in CPython" }, @@ -163,6 +187,8 @@ export const questions: Question[] = [ { id: "data-structures/stacks-queues-quiz/q7", quiz: "stacks-queues-quiz", + lesson: "hash-maps", + section: "keys-into-indexes", prompt: "Which structure would you use to check, in O(1) on average, whether a username is already taken?", options: [ { id: "a", text: "A sorted array" }, @@ -176,6 +202,8 @@ export const questions: Question[] = [ { id: "data-structures/trees-quiz/q1", quiz: "trees-quiz", + lesson: "binary-trees", + section: "four-orders-to-visit-every-node", prompt: "Which traversal of a binary search tree lists its keys in sorted order?", options: [ { id: "a", text: "Preorder" }, @@ -189,6 +217,8 @@ export const questions: Question[] = [ { id: "data-structures/trees-quiz/q2", quiz: "trees-quiz", + lesson: "binary-trees", + section: "which-order-for-which-job", prompt: "To total the sizes of every folder on a disk, which traversal do you need?", options: [ { id: "a", text: "Preorder: parents first" }, @@ -202,6 +232,8 @@ export const questions: Question[] = [ { id: "data-structures/trees-quiz/q3", quiz: "trees-quiz", + lesson: "binary-search-trees", + section: "height-is-everything", prompt: "You insert 10, 20, 30, 40, 50 in that order into an empty (unbalanced) BST. What is its height?", options: [ { id: "a", text: "2" }, @@ -215,6 +247,8 @@ export const questions: Question[] = [ { id: "data-structures/trees-quiz/q4", quiz: "trees-quiz", + lesson: "binary-search-trees", + section: "insert-and-delete", prompt: "Deleting a BST node that has two children: what replaces its key?", options: [ { id: "a", text: "Its left child's key" }, @@ -228,6 +262,8 @@ export const questions: Question[] = [ { id: "data-structures/trees-quiz/q5", quiz: "trees-quiz", + lesson: "heaps", + section: "the-heap-rule", prompt: "In a binary heap stored in an array, where are the children of index 4?", options: [ { id: "a", text: "5 and 6" }, @@ -241,6 +277,8 @@ export const questions: Question[] = [ { id: "data-structures/trees-quiz/q6", quiz: "trees-quiz", + lesson: "heaps", + section: "push-and-pop", prompt: "What does std::priority_queue in C++ return from top() after pushing 9, 4, 7, 1?", options: [ { id: "a", text: "1" }, @@ -254,6 +292,8 @@ export const questions: Question[] = [ { id: "data-structures/trees-quiz/q7", quiz: "trees-quiz", + lesson: "tries", + section: "operations", prompt: "A trie holds a million words. How many steps does it take to find all words starting with \"pro\" (before listing them)?", options: [ { id: "a", text: "About 3" }, @@ -267,6 +307,8 @@ export const questions: Question[] = [ { id: "data-structures/final-quiz/q1", quiz: "final-quiz", + lesson: "union-find", + section: "a-forest-in-an-array", prompt: "In a union-find with union by rank and path compression, what does each operation cost in practice?", options: [ { id: "a", text: "O(n)" }, @@ -280,6 +322,8 @@ export const questions: Question[] = [ { id: "data-structures/final-quiz/q2", quiz: "final-quiz", + lesson: "union-find", + section: "kruskals-algorithm", prompt: "Kruskal's algorithm skips an edge when union(u, v) reports u and v are already together. Why?", options: [ { id: "a", text: "The edge is too expensive" }, @@ -293,6 +337,7 @@ export const questions: Question[] = [ { id: "data-structures/final-quiz/q3", quiz: "final-quiz", + lesson: "heaps", prompt: "You need the 10 highest scores out of a stream of a billion. Which structure keeps this cheap?", options: [ { id: "a", text: "A sorted array of everything" }, @@ -306,6 +351,8 @@ export const questions: Question[] = [ { id: "data-structures/final-quiz/q4", quiz: "final-quiz", + lesson: "choosing-a-data-structure", + section: "worked-choices", prompt: "A leaderboard must show each player's rank and the players just above and below them. Best fit?", options: [ { id: "a", text: "Hash map" }, @@ -319,6 +366,8 @@ export const questions: Question[] = [ { id: "data-structures/final-quiz/q5", quiz: "final-quiz", + lesson: "linked-lists", + section: "doubly-linked-lists", prompt: "An LRU cache needs O(1) lookup and O(1) \"move this entry to most recently used\". Which combination does it?", options: [ { id: "a", text: "Two stacks" }, @@ -332,6 +381,8 @@ export const questions: Question[] = [ { id: "data-structures/final-quiz/q6", quiz: "final-quiz", + lesson: "choosing-a-data-structure", + section: "the-most-common-fix-a-set-instead-of-a-list", prompt: "This Python runs slowly: for u in signups: if u in banned_list: ... What's the usual fix?", options: [ { id: "a", text: "Sort signups first" }, @@ -345,6 +396,8 @@ export const questions: Question[] = [ { id: "data-structures/final-quiz/q7", quiz: "final-quiz", + lesson: "queues-and-deques", + section: "deques", prompt: "Which structure processes requests strictly in arrival order with O(1) at both ends?", options: [ { id: "a", text: "A Python list using pop(0)" }, @@ -358,6 +411,8 @@ export const questions: Question[] = [ { id: "data-structures/final-quiz/q8", quiz: "final-quiz", + lesson: "choosing-a-data-structure", + section: "the-cheat-sheet", prompt: "When does a linked list genuinely beat a dynamic array?", options: [ { id: "a", text: "Whenever you need to read item i" }, diff --git a/src/content/microprocessors/questions.ts b/src/content/microprocessors/questions.ts index 81d7ca7..8730d63 100644 --- a/src/content/microprocessors/questions.ts +++ b/src/content/microprocessors/questions.ts @@ -7,6 +7,8 @@ export const questions: Question[] = [ { id: "microprocessors/final-quiz/q1", quiz: "final-quiz", + lesson: "inside-the-8086", + section: "two-units-instead-of-one", prompt: "Why does the 8086 have an instruction queue?", options: [ { id: "a", text: "To store a program permanently in non-volatile memory" }, @@ -21,6 +23,8 @@ export const questions: Question[] = [ { id: "microprocessors/final-quiz/q2", quiz: "final-quiz", + lesson: "registers", + section: "general-purpose-ax-bx-cx-dx", prompt: "If register AX contains the value 1234h, what value is stored in AL?", options: [ { id: "a", text: "12h" }, @@ -35,6 +39,8 @@ export const questions: Question[] = [ { id: "microprocessors/final-quiz/q3", quiz: "final-quiz", + lesson: "flags", + section: "carry-and-overflow", prompt: "After adding 100 + 50 in 8-bit register AL, which flag is set to 1?", options: [ { id: "a", text: "Carry Flag (CF), because 150 exceeds 8 bits" }, @@ -49,6 +55,8 @@ export const questions: Question[] = [ { id: "microprocessors/final-quiz/q4", quiz: "final-quiz", + lesson: "segments-and-addresses", + section: "the-formula", prompt: "If DS = 2000h and BX = 0150h, what 20-bit physical address does the memory operand [BX] access?", options: [ { id: "a", text: "2150h" }, @@ -63,6 +71,8 @@ export const questions: Question[] = [ { id: "microprocessors/final-quiz/q5", quiz: "final-quiz", + lesson: "addressing-modes", + section: "the-rules", prompt: "Which of the following is a valid 8086 assembly instruction?", options: [ { id: "a", text: "MOV AX, [DX]" }, @@ -77,6 +87,8 @@ export const questions: Question[] = [ { id: "microprocessors/final-quiz/q6", quiz: "final-quiz", + lesson: "addressing-modes", + section: "the-eight-modes", prompt: "Which addressing mode best represents accessing a specific column in a row within a two-dimensional matrix (e.g., matrix[row][col])?", options: [ { id: "a", text: "Immediate addressing" }, @@ -91,6 +103,8 @@ export const questions: Question[] = [ { id: "microprocessors/final-quiz/q7", quiz: "final-quiz", + lesson: "jumps-and-loops", + section: "which-jump-to-use", prompt: "Register AL contains 200 (0C8h). The CPU executes CMP AL, 100. Which conditional branch is taken?", options: [ { id: "a", text: "JA, but not JG" }, @@ -105,6 +119,8 @@ export const questions: Question[] = [ { id: "microprocessors/final-quiz/q8", quiz: "final-quiz", + lesson: "stack-and-procedures", + section: "push-and-pop", prompt: "If the stack pointer SP contains FFFEh, what is the value of SP immediately after executing PUSH AX?", options: [ { id: "a", text: "FFFFh" }, @@ -119,6 +135,8 @@ export const questions: Question[] = [ { id: "microprocessors/final-quiz/q9", quiz: "final-quiz", + lesson: "stack-and-procedures", + section: "call-and-ret", prompt: "What does the CALL instruction do that a standard JMP instruction does not do?", options: [ { id: "a", text: "It pushes the return address onto the stack before branching" }, @@ -133,6 +151,8 @@ export const questions: Question[] = [ { id: "microprocessors/final-quiz/q10", quiz: "final-quiz", + lesson: "interrupts", + section: "maskable-and-non-maskable", prompt: "A catastrophic power failure requires immediate CPU attention, even if software has executed CLI. Which input line must be asserted?", options: [ { id: "a", text: "INTR" },