| name | exam |
| description | Exam preparation toolkit for CS students. Use when preparing for an upcoming exam — generates practice questions, concept mind maps, day-by-day revision plans, and Anki-compatible flashcards. |
Purpose
Structured exam preparation: generate practice questions, build mind maps, create revision plans, and run mock quizzes. Adapts to the student's course syllabus if available in SEMESTER.md.
Activation
/exam [course name or topic]
/exam --mode=quiz # Interactive Q&A session
/exam --mode=mindmap # Generate a concept mind map
/exam --mode=plan # Build a revision schedule
/exam --mode=flashcards # Generate flashcard-style Q&A pairs
Behavior
Step 1 — Exam Context Intake
Gather:
- Which course / subject?
- When is the exam? (days until)
- What topics are covered? (paste syllabus if available)
- Exam format: MCQ, short answer, problem-solving, coding, oral?
- What does the student feel weakest on?
If SEMESTER.md exists, pre-fill what's known and only ask for gaps.
Step 2 — Mode Execution
Mode: Quiz (--mode=quiz)
Run an adaptive interactive quiz:
- Present one question at a time
- Wait for the student's answer
- Evaluate: correct / partially correct / incorrect
- Explain the right answer with depth proportional to how wrong the student was
- Track topics where the student struggles and weight future questions toward those
- End with a score summary and weak-area breakdown
Question formats by topic:
Algorithms/DS:
- "What is the time complexity of deleting from a min-heap? Justify your answer."
- "Trace through this DFS on the following graph: [graph]. List nodes in visit order."
- "Is this sorting algorithm stable? Why or why not?"
Theory (OS, Networking, etc.):
- "Explain the difference between a process and a thread."
- "What problem does the banker's algorithm solve? Describe it in your own words."
- "A packet arrives at a router. Walk through the steps to forward it."
Math for CS:
- "Prove by induction that the sum of the first n integers is n(n+1)/2."
- "How many ways can you arrange 5 books on a shelf if 2 specific books must stay together?"
Mode: Mind Map (--mode=mindmap)
Generate a structured Mermaid mind map of the topic:
mindmap
root((Operating Systems))
Processes
PCB
States
Ready
Running
Blocked
Context Switch
Memory Management
Paging
Segmentation
Virtual Memory
TLB
Scheduling
FCFS
SJF
Round Robin
Priority
Concurrency
Race Conditions
Mutex
Semaphore
Deadlock
Also provide:
- A flat list of all concepts for linear revision
- Connections between concepts that are frequently tested together
Mode: Revision Plan (--mode=plan)
Build a day-by-day study schedule:
Exam: Data Structures & Algorithms — in 5 days
Day 1 (Today): Arrays, Strings, Hashing
- Review: Hash maps, collision handling, load factor
- Practice: 3 Easy LeetCode problems on hashing
- Self-test: Can you implement a hash map from scratch?
Day 2: Trees & Graphs
- Review: BST, AVL rotations, BFS, DFS, Dijkstra
- Practice: Trace 2 BFS and 2 DFS problems on paper
- Self-test: What are the traversal orders of a BST?
Day 3: Dynamic Programming
- Review: Memoization vs tabulation, common patterns
- Practice: LC 70, 198, 322 (classic DP)
- Self-test: Convert a recursive fibonacci to DP
Day 4: Sorting, Searching, Complexity
- Review: All sorting algorithms + their trade-offs
- Practice: Complexity analysis of provided code snippets
- Self-test: When would you choose heapsort over quicksort?
Day 5 (Eve): Light review + past papers
- Review: Your weak areas from Days 1-4
- Practice: One timed past exam paper
- Rest by 10pm — sleep > cramming
Mode: Flashcards (--mode=flashcards)
Generate Q&A pairs suitable for spaced repetition (Anki-compatible format):
Q: What is the time complexity of building a heap from n elements?
A: O(n) — counterintuitive but provable; the bottom-heavy nature of heaps means most insertions are cheap.
Q: What is the difference between deep copy and shallow copy?
A: Shallow copy copies references; deep copy recursively copies all nested objects. Modifying a nested object in a shallow copy affects the original.
Q: State the four Coffman conditions for deadlock.
A: Mutual exclusion, Hold and wait, No preemption, Circular wait. All four must hold simultaneously for deadlock to occur.
Step 3 — Post-Quiz Debrief
After any quiz session, provide:
Session Summary
───────────────
Score: 14/20 (70%)
Time: 23 minutes
Strong areas: Sorting algorithms, Graph traversal
Weak areas: Dynamic Programming (4/8), Concurrency (2/4)
Recommended focus before exam:
1. DP: Review memoization vs tabulation — you confused them twice
2. Concurrency: Re-read mutex vs semaphore — you missed 2/3 questions
3. Practice: LC 70, 300 for DP; review dining philosophers for concurrency
Adaptive Difficulty
Track question performance during a session:
- 3 correct in a row on a topic → increase difficulty
- 2 wrong in a row on a topic → drop back to fundamentals, re-explain
- Consistent gaps → flag for revision plan
Notes for Maintainers
- Exam mode should never produce the exact questions/answers from actual exams
- Always generate original questions inspired by topics, not reproduced from papers
- Mind maps should be course-aware when SEMESTER.md is available