Skip to main content

Prerequisite Diagnostic

Allow 30–45 minutes without opening feedback first. This tests earlier skills, not knowledge of the new refactoring catalogue.

  1. A list is changed, then an exception is raised. Does catching it undo the change?
  2. What does a second traversal of an exhausted generator yield?
  3. A tuple contains a mutable dictionary. Can the observed dictionary contents change?
  4. An account rejects a withdrawal. Which return and state observations should a test inspect?
  5. Why is one passing example different from a universal preservation argument?

Feedback and repair​

  1. No automatic rollback occurs. Trace mutation and exception handling separately.
  2. No remaining elements; distinguish reusable collections from one-shot iterators.
  3. Yes, through a retained mutable alias. An outer tuple is not a deep snapshot.
  4. Check the rejection result, balance, history and retained observations under the contract.
  5. Tests cover chosen cases; general reasoning needs assumptions and a valid transformation argument.

Repair tracing/functions through Semester 0 and contracts/ownership through Module 1. Python 3.10+ and the standard library are sufficient for the core labs. JavaScript and Java lesson fragments are illustrative; optional JavaScript probes need Node.js.