---
id: "{{ID}}"
title: "{{TITLE}}"
type: "TASK_CARDS"
created_by: "Curriculum OS Builder"
phase: "{{PHASE}}"
deliverable: "P3-T14"
version: "{{VERSION}}"
date: "{{DATE}}"
template_contract: "artifact-template-v1"
template_required_sections:
  - "Deck Overview & Print Instructions"
  - "Set A: Foundational Concepts (Cards 1–4)"
  - "Set B: Code Diagnosis & Debugging (Cards 5–8)"
  - "Set C: Application & Synthesis (Cards 9–12)"
  - "Teacher Answer Key & Scoring Matrix"
---
<!-- INJECT_BODY -->

# PRINTABLE TASK CARDS PACK: [LESSON TITLE]
_Unit: U[X] | Module: M[X.X] | Total Cards: 12-16 Cards | Usage: Centers, Fast Finishers, Small Group Review_

## Deck Overview & Print Instructions
- **Card Format:** 4 cards per page (A4 layout with cutting guidelines and QR code link).
- **Target Skills:** Conceptual Understanding, Code Tracing, Bug Hunting, Architectural Reasoning.
- **Scoring System:** Bronze Cards (1 pt), Silver Cards (2 pts), Gold Cards (3 pts).

---

## Set A: Foundational Concepts (Cards 1–4)

```
┌──────────────────────────────────────────────┬──────────────────────────────────────────────┐
│ 🃏 CARD 01: Mental Model Anchor     [Bronze] │ 🃏 CARD 02: Code Tracing             [Bronze]│
│                                              │                                              │
│ [Question / Prompt Testing Core Principle]   │ Given:                                       │
│ E.g., "Define the difference between @State  │ let numbers = [1, 2, 3]                      │
│ and @Binding in 1 concise sentence."         │ What is the exact value after:               │
│                                              │ numbers.map { $0 * 2 }.filter { $0 > 3 }     │
│ 💡 Hint: Check Handout Section 1             │ 💡 Hint: Trace element by element            │
├──────────────────────────────────────────────┼──────────────────────────────────────────────┤
│ 🃏 CARD 03: Syntax Spot Check       [Bronze] │ 🃏 CARD 04: Vocabulary Link          [Bronze]│
│                                              │                                              │
│ "Which keyword allows an asynchronous        │ "Match the term 'Data Race' to the correct   │
│ function to suspend execution without        │ definition (A, B, or C)."                    │
│ blocking the underlying thread?"             │                                              │
│ [A] break  [B] await  [C] defer  [D] sync    │                                              │
└──────────────────────────────────────────────┴──────────────────────────────────────────────┘
```

---

## Set B: Code Diagnosis & Debugging (Cards 5–8)

```
┌──────────────────────────────────────────────┬──────────────────────────────────────────────┐
│ 🃏 CARD 05: Spot The Compiler Bug   [Silver] │ 🃏 CARD 06: Fix The Concurrency Leak [Silver]│
│                                              │                                              │
│ struct ProfileView: View {                   │ actor BankAccount {                          │
│     var username: String = "Alex"            │     var balance = 100                        │
│     var body: some View {                    │ }                                            │
│         TextField("Name", text: username)    │ // Non-isolated caller                       │
│     }                                        │ func printBalance(acc: BankAccount) {        │
│ }                                            │     print(acc.balance) // Error here         │
│ Task: What character is missing on line 4?   │ Task: Fix the error on line 6.               │
├──────────────────────────────────────────────┼──────────────────────────────────────────────┤
│ 🃏 CARD 07: Logic Flaw Detector     [Silver] │ 🃏 CARD 08: State Mutation Trap      [Silver]│
│                                              │                                              │
│ [Provide a snippet where condition is always │ [Provide a snippet mutating immutable view   │
│ false due to type mismatch or scope issue]   │ properties or escaping closures]             │
│ Task: Rewrite lines 3-4 to correct logic.    │ Task: Explain why mutation is rejected.      │
└──────────────────────────────────────────────┴──────────────────────────────────────────────┘
```

---

## Set C: Application & Synthesis (Cards 9–12)

```
┌──────────────────────────────────────────────┬──────────────────────────────────────────────┐
│ 🃏 CARD 09: System Architecture       [Gold] │ 🃏 CARD 10: Performance Optimization  [Gold]│
│                                              │                                              │
│ "Design an Actor model for a Chat app with   │ "A list with 10,000 items lags when          │
│ 100 simultaneous message streams. Name the   │ scrolling. Propose 2 specific optimizations  │
│ 2 core methods and data invariants."         │ to achieve 60 FPS."                          │
├──────────────────────────────────────────────┼──────────────────────────────────────────────┤
│ 🃏 CARD 11: Real-World Scenario       [Gold] │ 🃏 CARD 12: Challenge & Refactor      [Gold]│
│                                              │                                              │
│ "A user loses internet during payment. How   │ [Provide a 10-line messy imperative code]    │
│ does your async pipeline guarantee idempotent│ Task: Refactor into a clean declarative      │
│ transaction recording without duplicate buy?"│ pipeline using modern idioms.                │
└──────────────────────────────────────────────┴──────────────────────────────────────────────┘
```

---

## Teacher Answer Key & Scoring Matrix
| Card ID | Correct Answer / Solution Blueprint | Max Points |
| :---: | :--- | :---: |
| **01** | `@State` owns private source of truth; `@Binding` creates a 2-way reference without owning storage. | 1 pt |
| **02** | `[4, 6]` | 1 pt |
| **03** | `[B] await` | 1 pt |
| **04** | Definition B (Two threads accessing same memory with at least one write). | 1 pt |
| **05** | Missing `$` projection: `$username` | 2 pts |
| **06** | Must add `await` and mark function `async`: `await acc.balance` | 2 pts |
| **07** | [Exact refactored lines] | 2 pts |
| **08** | [Exact explanation of View struct value semantics] | 2 pts |
| **09** | [Actor blueprint with isolated message queue] | 3 pts |
| **10** | 1. Use LazyVStack / List view recycling; 2. Pre-fetch images asynchronously. | 3 pts |
| **11** | [Idempotency token + local cache before network dispatch] | 3 pts |
| **12** | [Clean idiomatic refactored code] | 3 pts |
