From 24df2ee87416ee694d4fd9899e3f82cef3f81cb3 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 07:46:15 +0000 Subject: [PATCH 1/2] Exams phase 4c: Data Structures +20 and Computer Networks +9 The last two courses of phase 4c, one or two new questions per taught lesson, each tagged with its lesson and section and none repeating the existing bank. Numbers checked by script: g[2][1] in a 3 x 4 int grid at 1000 is 1036, 17 doubling appends copy 31 items, a ring buffer with capacity 8, head 6 and size 3 puts its back at 1, the heap parent of index 9 is 4, 2,000 km of fibre is 10 ms, and slow start reaches cwnd 16 after 4 round trips. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EC6Zzt5akQu7TEHdGquZzp --- docs/autopilot.md | 4 +- src/content/computer-networks/questions.ts | 126 ++++++++++ src/content/data-structures/questions.ts | 280 +++++++++++++++++++++ 3 files changed, 409 insertions(+), 1 deletion(-) diff --git a/docs/autopilot.md b/docs/autopilot.md index a5fb97c..aedf9b5 100644 --- a/docs/autopilot.md +++ b/docs/autopilot.md @@ -57,7 +57,8 @@ The owner's priority since 2026-11-03: proper exam practice. The design, decisio - [x] Microprocessors: +34 (10 → 44), 3 for each of the 11 taught lessons (4 for segments), each with `lesson` and (all but one) `section`. (PR #94, stacked on #91) - [x] Computer Organization: +26 (10 → 36), 2 or 3 for each of the 9 taught lessons, each with `lesson` and `section`. (PR #96, stacked on #94) - [x] Discrete Mathematics: +26 (42 → 68), 1 or 2 for each of the 17 taught lessons, each with `lesson` and `section`. (PR #101) - - Still to do, measured 2026-11-16: Data Structures 20, Computer Networks 9. Advanced Software Engineering (42) is new and left to its authors. + - [x] Data Structures: +20 (28 → 48) and Computer Networks: +9 (27 → 36), 1 or 2 per taught lesson, each with `lesson` and `section`. (PR #PRNUM, 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. - [ ] 5. Generated questions (subnets, scheduling, Big-O first). - [ ] 6. Account sync for review cards and exam attempts. @@ -93,6 +94,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-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 #PRNUM, 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. - 2026-11-17 10:40 (run B): exam phase 4c, Computer Organization: +26 questions over all 9 taught lessons, numbers checked by script (500 GB shown as 465.7, G = 01000111, 2¹⁶ and 2¹² locations, the disk capacity 516,096,000 bytes, 4.2 ms average wait at 7,200 rpm). PR #96, open, stacked on #94. diff --git a/src/content/computer-networks/questions.ts b/src/content/computer-networks/questions.ts index a874bee..6ffab40 100644 --- a/src/content/computer-networks/questions.ts +++ b/src/content/computer-networks/questions.ts @@ -355,4 +355,130 @@ export const questions: Question[] = [ correctOptionId: "b", explanation: "304 Not Modified means the cached version is still current, so no body is sent. Redirects are 301, 302, 307 and 308.", }, + { + id: "computer-networks/layers-and-packets/encapsulation", + lesson: "layers-and-packets", + section: "encapsulation", + prompt: "A browser sends an HTTP request. From outermost to innermost, how is it wrapped on the wire?", + options: [ + { id: "a", text: "HTTP, then TCP, then IP, then the link frame" }, + { id: "b", text: "Link frame, then IP, then TCP, then HTTP" }, + { id: "c", text: "IP, then link frame, then TCP, then HTTP" }, + { id: "d", text: "TCP, then IP, then HTTP, then link frame" }, + ], + correctOptionId: "b", + explanation: "Going down the stack each layer wraps what it got: TCP wraps the HTTP data, IP wraps the segment, and the link layer wraps the IP packet in a frame. So the outermost is the link frame and the innermost is HTTP. The first option lists the order they're added, inside out.", + }, + { + id: "computer-networks/delay-and-throughput/propagation", + lesson: "delay-and-throughput", + section: "four-kinds-of-delay", + prompt: "Signals travel at about 2 × 10⁸ m/s in fibre. What is the propagation delay over 2,000 km?", + options: [ + { id: "a", text: "1 ms" }, + { id: "b", text: "100 ms" }, + { id: "c", text: "10 ms" }, + { id: "d", text: "It depends on the link's bandwidth" }, + ], + correctOptionId: "c", + explanation: "d / v = 2,000,000 m ÷ 2 × 10⁸ m/s = 0.01 s = 10 ms. Propagation depends on the link's length, not its bandwidth; bandwidth sets the transmission delay instead.", + }, + { + id: "computer-networks/ip-addresses-and-subnets/private", + lesson: "ip-addresses-and-subnets", + section: "private-addresses-and-nat", + prompt: "Which of these addresses is NOT in a private range?", + options: [ + { id: "a", text: "10.20.30.40" }, + { id: "b", text: "192.168.0.1" }, + { id: "c", text: "172.20.1.1" }, + { id: "d", text: "172.32.1.1" }, + ], + correctOptionId: "d", + explanation: "The private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. A /12 starting at 172.16 covers 172.16 to 172.31, so 172.20.1.1 is private but 172.32.1.1 is just past the range and public.", + }, + { + id: "computer-networks/routing/forwarding-vs-routing", + lesson: "routing", + section: "forwarding-and-routing", + prompt: "What's the difference between forwarding and routing?", + options: [ + { id: "a", text: "Forwarding sends each packet out by a table lookup, in nanoseconds; routing fills in the tables, over seconds to minutes" }, + { id: "b", text: "They're two names for the same job" }, + { id: "c", text: "Routing happens per packet; forwarding happens once a day" }, + { id: "d", text: "Forwarding is for TCP and routing is for UDP" }, + ], + correctOptionId: "a", + explanation: "Forwarding is the per-packet job: look up the destination in the forwarding table and send it out, in hardware. Routing is how those tables get computed, by routers exchanging information, in software.", + }, + { + id: "computer-networks/udp-and-ports/no-promises", + lesson: "udp-and-ports", + section: "udp-just-ports-and-a-checksum", + prompt: "An app sends three UDP datagrams. What can the receiver rely on?", + options: [ + { id: "a", text: "All three arrive, in order" }, + { id: "b", text: "All three arrive, in any order" }, + { id: "c", text: "Each one that arrives is whole, but some may be lost or arrive out of order" }, + { id: "d", text: "They arrive merged into one stream" }, + ], + correctOptionId: "c", + explanation: "UDP adds only ports and a checksum to IP. Each datagram is delivered whole or not at all, with no guarantee of delivery or order. Merging into a byte stream is TCP's behaviour.", + }, + { + id: "computer-networks/tcp-reliable-delivery/handshake", + lesson: "tcp-reliable-delivery", + section: "the-three-way-handshake", + prompt: "What are the three messages of TCP's handshake, in order?", + options: [ + { id: "a", text: "SYN, ACK, FIN" }, + { id: "b", text: "SYN, SYN-ACK, ACK" }, + { id: "c", text: "ACK, SYN, SYN-ACK" }, + { id: "d", text: "HELLO, SYN, ACK" }, + ], + correctOptionId: "b", + explanation: "The client sends SYN with its starting number, the server answers SYN-ACK with its own number and acknowledges the client's, and the client ACKs the server's. It costs one round trip before data. FIN is for closing.", + }, + { + id: "computer-networks/congestion-control/slow-start", + lesson: "congestion-control", + section: "slow-start-then-additive-increase", + prompt: "A new TCP connection starts in slow start with cwnd = 1 segment. If nothing is lost, what is cwnd after 4 round trips?", + options: [ + { id: "a", text: "5" }, + { id: "b", text: "4" }, + { id: "c", text: "8" }, + { id: "d", text: "16" }, + ], + correctOptionId: "d", + explanation: "Slow start doubles cwnd every round trip: 1 → 2 → 4 → 8 → 16. Despite the name it grows exponentially. Adding one per round trip, which gives 5, is congestion avoidance, after cwnd reaches ssthresh.", + }, + { + id: "computer-networks/dns/record-types", + lesson: "dns", + section: "record-types", + prompt: "Which DNS record says where email for a domain should be delivered?", + options: [ + { id: "a", text: "MX" }, + { id: "b", text: "AAAA" }, + { id: "c", text: "CNAME" }, + { id: "d", text: "NS" }, + ], + correctOptionId: "a", + explanation: "MX records name a domain's mail servers. AAAA maps a name to an IPv6 address, CNAME makes a name an alias for another, and NS names the authoritative servers for a zone.", + }, + { + id: "computer-networks/http-and-https/cookies", + lesson: "http-and-https", + section: "stateless-with-cookies", + prompt: "HTTP is stateless, so how does a website keep you signed in from one page to the next?", + options: [ + { id: "a", text: "The TCP connection stays open while you browse" }, + { id: "b", text: "The server sends a cookie, and the browser sends it back with every request" }, + { id: "c", text: "The server remembers your IP address" }, + { id: "d", text: "HTTPS keeps the session automatically" }, + ], + correctOptionId: "b", + explanation: "Each request stands alone, so the server hands the browser a cookie (Set-Cookie) and the browser includes it on later requests. That lets any server machine recognise you. IP addresses are shared and change, so they can't identify a session.", + }, ]; diff --git a/src/content/data-structures/questions.ts b/src/content/data-structures/questions.ts index 1d3dc4b..b925a49 100644 --- a/src/content/data-structures/questions.ts +++ b/src/content/data-structures/questions.ts @@ -368,4 +368,284 @@ export const questions: Question[] = [ correctOptionId: "c", explanation: "That's its one O(1) trick. For indexing and scanning, the array wins, and a list also spends extra memory on pointers.", }, + { + id: "data-structures/arrays-and-memory/grid-address", + lesson: "arrays-and-memory", + section: "two-dimensional-arrays", + prompt: "A C grid int g[3][4] (3 rows, 4 columns) starts at address 1000, and each int takes 4 bytes. Where is g[2][1]?", + options: [ + { id: "a", text: "1036" }, + { id: "b", text: "1024" }, + { id: "c", text: "1009" }, + { id: "d", text: "1028" }, + ], + correctOptionId: "a", + explanation: "Row-major order puts g[r][c] at index r × columns + c = 2 × 4 + 1 = 9, and 9 × 4 bytes = 36, so 1000 + 36 = 1036. 1009 forgets to multiply by the 4-byte size; 1028 uses r × rows instead of r × columns.", + }, + { + id: "data-structures/arrays-and-memory/index-o1", + lesson: "arrays-and-memory", + section: "what-arrays-are-good-and-bad-at", + prompt: "Why can an array reach a[500000] as fast as a[0]?", + options: [ + { id: "a", text: "The CPU searches the array in parallel" }, + { id: "b", text: "Its address is computed directly: start + index × element size" }, + { id: "c", text: "Arrays keep a separate index of every element" }, + { id: "d", text: "It can't: later elements take longer to reach" }, + ], + correctOptionId: "b", + explanation: "Elements sit side by side, all the same size, so one multiply and one add give the address of any index: O(1). A linked list has no such formula and must walk from the head.", + }, + { + id: "data-structures/dynamic-arrays/copies", + lesson: "dynamic-arrays", + section: "why-doubling-is-o1-per-append", + prompt: "A dynamic array starts with capacity 1 and doubles when full. How many element copies happen while appending 17 items?", + options: [ + { id: "a", text: "17" }, + { id: "b", text: "136" }, + { id: "c", text: "31" }, + { id: "d", text: "16" }, + ], + correctOptionId: "c", + explanation: "It grows when it holds 1, 2, 4, 8 and 16 items, copying those each time: 1 + 2 + 4 + 8 + 16 = 31, under 2n. 136 is 1 + 2 + … + 16, what growing by one slot each time would cost.", + }, + { + id: "data-structures/dynamic-arrays/shrink-quarter", + lesson: "dynamic-arrays", + section: "shrinking", + prompt: "Why do dynamic arrays that shrink wait until they're a quarter full before halving, instead of halving at half full?", + options: [ + { id: "a", text: "To save memory" }, + { id: "b", text: "Because halving is only allowed on powers of two" }, + { id: "c", text: "Because removing from the end is O(n)" }, + { id: "d", text: "Halving at half full means one append then one removal at the boundary could trigger a full copy every time" }, + ], + correctOptionId: "d", + explanation: "At exactly half full, a single append would grow the array and a single removal shrink it again, each an O(n) copy. Alternating them would make every operation O(n). The gap between the grow and shrink points prevents that thrashing.", + }, + { + id: "data-structures/linked-lists/doubly-remove", + lesson: "linked-lists", + section: "doubly-linked-lists", + prompt: "You hold a pointer to a node in the middle of a list. In which kind of list can you remove it in O(1)?", + options: [ + { id: "a", text: "A doubly linked list" }, + { id: "b", text: "A singly linked list" }, + { id: "c", text: "Either, because you already have the node" }, + { id: "d", text: "Neither: removing from the middle is always O(n)" }, + ], + correctOptionId: "a", + explanation: "Removing a node means pointing its predecessor past it. A doubly linked node has a prev pointer, so that's O(1). A singly linked list must walk from the head to find the predecessor: O(n).", + }, + { + id: "data-structures/linked-lists/lru", + lesson: "linked-lists", + section: "doubly-linked-lists", + prompt: "Which classic structure pairs a hash map with a doubly linked list?", + options: [ + { id: "a", text: "An LRU cache" }, + { id: "b", text: "A trie" }, + { id: "c", text: "A priority queue" }, + { id: "d", text: "A ring buffer" }, + ], + correctOptionId: "a", + explanation: "The hash map finds an entry's node in O(1), and the doubly linked list moves it to the front or evicts the oldest from the back in O(1). That's an LRU (least recently used) cache, and Python's OrderedDict works the same way.", + }, + { + id: "data-structures/stacks/stack-overflow", + lesson: "stacks", + section: "the-call-stack", + prompt: "A recursive function with no base case crashes with \"stack overflow\". Which stack overflowed?", + options: [ + { id: "a", text: "The heap data structure" }, + { id: "b", text: "The call stack: every call pushed a frame until its memory ran out" }, + { id: "c", text: "A stack object the program created" }, + { id: "d", text: "The CPU's register stack" }, + ], + correctOptionId: "b", + explanation: "Each call pushes a stack frame with its return address and local variables. With no base case the calls never return, so frames pile up until the call stack's fixed memory (a few megabytes) runs out. Python stops earlier, at a depth of 1,000.", + }, + { + id: "data-structures/queues-and-deques/ring-back", + lesson: "queues-and-deques", + section: "the-ring-buffer", + prompt: "A ring-buffer queue has capacity 8, head = 6 and size = 3. At which index is the back, where the next item goes?", + options: [ + { id: "a", text: "9" }, + { id: "b", text: "3" }, + { id: "c", text: "1" }, + { id: "d", text: "0" }, + ], + correctOptionId: "c", + explanation: "The back is at (head + size) mod capacity = (6 + 3) mod 8 = 1. The items sit at 6, 7 and 0, so the queue has wrapped round the end of the array. 9 forgets the mod and runs off the end.", + }, + { + id: "data-structures/queues-and-deques/bfs", + lesson: "queues-and-deques", + section: "deques", + prompt: "Which structure should hold the \"to visit\" list in a breadth-first search?", + options: [ + { id: "a", text: "A stack" }, + { id: "b", text: "A heap" }, + { id: "c", text: "A hash map" }, + { id: "d", text: "A queue" }, + ], + correctOptionId: "d", + explanation: "BFS visits nodes in the order it discovers them, first in first out, so it needs a queue (a deque works as one). Swapping in a stack turns it into depth-first search.", + }, + { + id: "data-structures/hash-maps/worst-case", + lesson: "hash-maps", + section: "the-worst-case", + prompt: "An attacker sends keys chosen so that every one lands in the same bucket. What does a lookup cost?", + options: [ + { id: "a", text: "O(n), because it scans one long bucket" }, + { id: "b", text: "O(1), as always for a hash map" }, + { id: "c", text: "O(log n)" }, + { id: "d", text: "Nothing: the keys are rejected" }, + ], + correctOptionId: "a", + explanation: "O(1) is the average with a decent hash. If all keys collide, one bucket holds them all and a lookup scans them. That's why Python seeds string hashes randomly per process and Java turns crowded buckets into balanced trees (O(log n)).", + }, + { + id: "data-structures/hash-maps/resize", + lesson: "hash-maps", + section: "load-factor-and-resizing", + prompt: "A hash map's load factor is 0.5 with 1,000 keys. How many buckets does it have, and about how many keys does a lookup inspect?", + options: [ + { id: "a", text: "500 buckets, about 3 keys" }, + { id: "b", text: "2,000 buckets, about 500 keys" }, + { id: "c", text: "2,000 buckets, about 1.5 keys" }, + { id: "d", text: "1,000 buckets, about 1 key" }, + ], + correctOptionId: "c", + explanation: "α = n / m, so m = 1000 / 0.5 = 2,000 buckets. A lookup inspects about 1 + α = 1.5 keys on average. 500 buckets would be a load factor of 2.", + }, + { + id: "data-structures/binary-trees/preorder", + lesson: "binary-trees", + section: "four-orders-to-visit-every-node", + prompt: "Root 1 has left child 2 and right child 3; node 2 has children 4 (left) and 5 (right). What is the preorder?", + options: [ + { id: "a", text: "4 2 5 1 3" }, + { id: "b", text: "4 5 2 3 1" }, + { id: "c", text: "1 2 3 4 5" }, + { id: "d", text: "1 2 4 5 3" }, + ], + correctOptionId: "d", + explanation: "Preorder visits a node, then its left subtree, then its right: 1, then 2's subtree (2, 4, 5), then 3. 4 2 5 1 3 is inorder, 4 5 2 3 1 is postorder, and 1 2 3 4 5 is level order.", + }, + { + id: "data-structures/binary-trees/serialise", + lesson: "binary-trees", + section: "which-order-for-which-job", + prompt: "You save a tree to a file so it can be rebuilt later. Which traversal fits, and why?", + options: [ + { id: "a", text: "Postorder, because leaves are written first" }, + { id: "b", text: "Inorder, because it's sorted" }, + { id: "c", text: "Preorder, because each parent is written before its children" }, + { id: "d", text: "Level order, because it's shortest" }, + ], + correctOptionId: "c", + explanation: "To rebuild a tree you need the parent before you can attach its children, so preorder writes it out in the order it's rebuilt. Postorder suits deleting a tree or summing folder sizes, where children must be finished first.", + }, + { + id: "data-structures/binary-search-trees/tree-map", + lesson: "binary-search-trees", + section: "hash-map-or-tree-map", + prompt: "You need every order placed between 10:00 and 10:15, by timestamp. Hash map or tree map?", + options: [ + { id: "a", text: "Hash map, because lookups are O(1)" }, + { id: "b", text: "Tree map, because it keeps keys sorted and can walk a range" }, + { id: "c", text: "Either: both store keys in order" }, + { id: "d", text: "Neither: you need a heap" }, + ], + correctOptionId: "b", + explanation: "A hash map is fastest for an exact key but scatters keys with no order, so a range means checking every key. A tree map finds 10:00 in O(log n) and walks forward until 10:15.", + }, + { + id: "data-structures/binary-search-trees/balanced", + lesson: "binary-search-trees", + section: "height-is-everything", + prompt: "Why do libraries use red-black or AVL trees instead of a plain binary search tree?", + options: [ + { id: "a", text: "They use less memory" }, + { id: "b", text: "They allow duplicate keys" }, + { id: "c", text: "Real data often arrives sorted, which turns a plain BST into a chain of height n; rotations keep the height O(log n)" }, + { id: "d", text: "They're simpler to write" }, + ], + correctOptionId: "c", + explanation: "Every BST operation costs O(height). Timestamps and auto-incrementing IDs arrive sorted, and a plain BST fed sorted keys becomes a linked list. Self-balancing trees restructure with small rotations to stay O(log n) tall.", + }, + { + id: "data-structures/heaps/parent-index", + lesson: "heaps", + section: "the-heap-rule", + prompt: "In a binary heap stored in an array (index from 0), where is the parent of index 9?", + options: [ + { id: "a", text: "4" }, + { id: "b", text: "4.5" }, + { id: "c", text: "18" }, + { id: "d", text: "8" }, + ], + correctOptionId: "a", + explanation: "The parent of index i is ⌊(i − 1) / 2⌋ = ⌊8 / 2⌋ = 4. Check: 4's children are 2 × 4 + 1 = 9 and 10. 18 and 19 are 9's children, not its parent.", + }, + { + id: "data-structures/heaps/heapify", + lesson: "heaps", + section: "building-a-heap-in-on", + prompt: "You have an array of n numbers and need a heap. Which is faster?", + options: [ + { id: "a", text: "Pushing them one at a time: O(n)" }, + { id: "b", text: "Heapify, sifting down from the last non-leaf: O(n)" }, + { id: "c", text: "Sorting the array first: O(1) afterwards" }, + { id: "d", text: "They're both O(n log n)" }, + ], + correctOptionId: "b", + explanation: "Pushing one by one costs O(n log n). Heapify works bottom-up, and half the nodes are leaves that need no work, so the total comes to O(n). A sorted array is a heap too, but sorting costs O(n log n).", + }, + { + id: "data-structures/tries/prefix", + lesson: "tries", + section: "trie-or-hash-set", + prompt: "An autocomplete box must list every stored word starting with what's typed. Why a trie over a hash set?", + options: [ + { id: "a", text: "A trie uses less memory" }, + { id: "b", text: "A hash set can't store strings" }, + { id: "c", text: "A trie walks to the prefix and lists below it; a hash set must check every word" }, + { id: "d", text: "A hash set can't tell if a word is stored" }, + ], + correctOptionId: "c", + explanation: "Hashing scatters words, so prefixes share nothing and a prefix query means testing every stored word. In a trie, all words with a prefix sit under one node. Tries usually use more memory, not less.", + }, + { + id: "data-structures/union-find/path-compression", + lesson: "union-find", + section: "a-forest-in-an-array", + prompt: "What does path compression do after find(x)?", + options: [ + { id: "a", text: "Hangs the shorter tree under the taller one" }, + { id: "b", text: "Points every node on the path from x straight at the root" }, + { id: "c", text: "Deletes the nodes it passed" }, + { id: "d", text: "Sorts the parent array" }, + ], + correctOptionId: "b", + explanation: "After walking up to the root, find points each node it passed directly at that root, so the next find from any of them takes one step. Hanging the shorter tree under the taller is union by rank, the other trick.", + }, + { + id: "data-structures/choosing-a-data-structure/small-n", + lesson: "choosing-a-data-structure", + section: "four-questions-to-ask", + prompt: "You look up items in a collection that never holds more than 20 of them. What usually wins?", + options: [ + { id: "a", text: "A balanced tree, for O(log n)" }, + { id: "b", text: "A trie" }, + { id: "c", text: "A hash map, always" }, + { id: "d", text: "A plain array, because a short contiguous scan is cache-friendly" }, + ], + correctOptionId: "d", + explanation: "Big-O describes growth, and at 20 items constant factors dominate. Scanning 20 contiguous values is a handful of cache hits, often faster than hashing or chasing tree pointers. Big-O starts to matter in the thousands.", + }, ]; From 989e3e62dbf17c5dba174dda87bb44da9fde5baa Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 07:46:19 +0000 Subject: [PATCH 2/2] Log run: PR #102 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01EC6Zzt5akQu7TEHdGquZzp --- docs/autopilot.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/autopilot.md b/docs/autopilot.md index aedf9b5..fa6fea2 100644 --- a/docs/autopilot.md +++ b/docs/autopilot.md @@ -57,7 +57,7 @@ The owner's priority since 2026-11-03: proper exam practice. The design, decisio - [x] Microprocessors: +34 (10 → 44), 3 for each of the 11 taught lessons (4 for segments), each with `lesson` and (all but one) `section`. (PR #94, stacked on #91) - [x] Computer Organization: +26 (10 → 36), 2 or 3 for each of the 9 taught lessons, each with `lesson` and `section`. (PR #96, stacked on #94) - [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 #PRNUM, stacked on #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. - [ ] 5. Generated questions (subnets, scheduling, Big-O first). @@ -94,7 +94,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-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 #PRNUM, open, stacked on #101. +- 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. - 2026-11-17 10:40 (run B): exam phase 4c, Computer Organization: +26 questions over all 9 taught lessons, numbers checked by script (500 GB shown as 465.7, G = 01000111, 2¹⁶ and 2¹² locations, the disk capacity 516,096,000 bytes, 4.2 ms average wait at 7,200 rpm). PR #96, open, stacked on #94.