Module Quiz
Complete this quiz after finishing all concept and practice pages. Save your answers before opening separate quiz calibration. The quiz includes 15 current-module questions (with at least 2 on evaluation-model tracing and 1 on closure/scope behavior), 5 interleaved questions from S1/S3/earlier S4 modules, and a 4-tier remediation rubric.
Current Module Questions
Question 1: Procedural vs Data Abstraction
A teammate says "A Set class with add, contains, remove is procedural abstraction." Is this accurate?
Question 2: Abstraction Barrier Leak
You see customer.account._balance -= amount in application code. What is wrong with this, and what is the fix?
Question 3: Stratified Design
Give one sign that a system is not stratified, and one sign it has too many layers.
Question 4: Higher-Order vs Callback
What distinguishes a higher-order function from a plain "takes a callback" API?
Question 5: Closure / Scope Behavior (required)
Given this Scheme program, what does the final expression evaluate to, and why?
(define n 5)
(define (make-proc) (lambda () n))
(define p (make-proc))
(let ((n 99)) (p))
Question 6: map/filter/reduce Pipeline
Rewrite this Python loop as a single pipeline using map, filter, and reduce (with functools.reduce):
total = 0
for x in xs:
if x > 0:
total += x * x
Question 7: Evaluation Model Trace (required)
Trace (sum-of-squares (+ 1 2) (* 3 4)) in the substitution model, showing each reduction step, where (define (sum-of-squares x y) (+ (square x) (square y))) and (define (square x) (* x x)). Use applicative order.
Question 8: Evaluation Model Trace (required)
In the environment model, describe what happens when (add5 10) is called, given:
(define (make-adder n) (lambda (x) (+ x n)))
(define add5 (make-adder 5))
(add5 10)
Question 9: Applicative vs Normal Order
Why must if be a special form in an applicative-order language?
Question 10: Tail Call vs Recursive Process
Classify each as tail or non-tail position, and justify in one phrase:
(a) (if p (f x) (g x))
(b) (let ((v (f x))) v)
(c) (+ 1 (f x))
(d) (begin (log x) (f x))
Question 11: Interpreter Core
What are the two mutually-recursive procedures at the heart of any Scheme evaluator, and what does each do?
Question 12: Lexical Scope in an Interpreter
In Concept 11's Python evaluator, which single field of the Procedure representation makes scope lexical rather than dynamic?
Question 13: Staging / Analysis
What speedup comes from separating analyze(exp) from the per-call evaluator (SICP §4.1.7), and why?
Question 14: Cost of Mutation
Give one concrete correctness issue that appears the moment set! is introduced into a pure functional program.
Question 15: Streams as Pure Time
Why is using a stream of (time -> balance) potentially cheaper than using a mutable balance variable for a ledger application?
Interleaved Review Questions
Prior Module Question 1 (from S4M1: C Programming Fundamentals)
Why does C lack closures, and what is the closest idiomatic equivalent?
Prior Module Question 2 (from S4M2: Memory, Pointers, Machine Representation)
A function returns a pointer to a local variable. Why is this undefined behavior, and how does this relate to the difference between C and Scheme for returning functions?
Prior Module Question 3 (from S3M2: Refactoring Techniques)
How does "extract function" connect to procedural abstraction as described in this module?
Prior Module Question 4 (from S1: Math Foundations)
Why is reduction via fold / reduce related to induction?
Prior Module Question 5 (from S3M1: OOD Foundations & Code Smells)
How does a closure capturing state relate to encapsulation in OOP?
Self-Assessment and Remediation
Mastery (90-100% correct)
- Advance to Module 5 completion. Apply the evaluation-model traces and interpreter in the semester project or exam. Revisit the interpreter kata periodically to keep it fast.
Proficient (75-89%)
- Review only the concept pages tied to missed questions. Rework at least one trace in Practice 2 and verify on paper. Redo Kata 3 (tiny interpreter) once.
Developing (60-74%)
- Rework Practice 2 (Evaluation Models Workshop) and Practice 3 (Interpreter Construction Clinic) in full. Most of the module's judgment lives in those two. Do not start Cluster 5 until the interpreter runs the acceptance tests.
Insufficient (<60%)
- Return to the concept sequence from Cluster 1 in order. Do each "Mini Drill" on paper. Rebuild the interpreter from scratch once. Do not attempt the module quiz again until all three clusters' mastery checks pass.
Progression boundary
Quiz performance calibrates retrieval and reasoning. It does not replace runnable work, changed-case transfer, the module assessment or required semester evidence. Consult practice calibration for the additional independent cases.