Midterm 1, Section 01, Problem 1: Short Questions¶
Midterm 1, Section 01, problem 1 of 5 · Length: 11:42 · Exercises: 01r_control_flow (Week 1) · 04r_structs_impl (Week 3) · 06r_collections (Week 4) · 20a_asm_bridge (Week 6) · Exam: Section 01 (PDF) · Answer key: Solutions (PDF)
Four parts, worked on the exam's pages 2 and 3: (a) pgroundup and checked_pgroundup on two addresses and one near usize::MAX, and what the overflowing add does in a debug and a release build; (b) which line of a Page and Pte program fails to compile, why, and where the Page is dropped; (c) what bytecopy does when its extern "C" declaration swaps src and dst; (d) find_pid on a process table of Option values, a match on its result, and two uses of it that fail. The answer key's handwriting is written onto the exam page as each step is worked.
Download the video (MP4, 20 MB) · Captions (WebVTT) · All five problems