Skill · learn by teaching

Write your own exam questions

Writing a good multiple-choice question is one of the highest-leverage things you can do before an exam — it forces you to understand not just the fact, but everything it's confused with.

Why this works To recognise the right answer you only need fluency. To write three plausible wrong answers you need real understanding — you have to know the neighbouring concepts a learner would mix it up with. That's exactly the knowledge the exam probes.

The anatomy of a question

Stem — the question itself. Tests one idea. Precise, self-contained, no trick grammar.
Key — the correct option(s). For "select all", decide how many are right before writing options.
Distractors — the wrong options. The whole craft is here: each should be wrong but tempting, ideally a real misconception.
Rationale — one or two sentences on why the key is right and why the best distractor is wrong.

The core trick: distractor mining

A weak question has obviously-silly wrong answers. A strong one uses the adjacent concept — the thing this fact is genuinely confused with. So the recipe is:

  1. Write the fact you want to test.
  2. Ask: "What does a learner mix this up with?" Each answer is a distractor.
  3. Write the rationale explaining the difference.

Spring is full of these paired confusions. Keep a running "confusion bank" — this is your distractor goldmine:

The factIts favourite confusion (→ your distractor)
CGLIB proxy (subclass)JDK dynamic proxy (needs an interface)
ApplicationContext (eager singletons)BeanFactory (lazy)
DispatcherServlet (front controller)ApplicationContext (the container)
singleton (one shared)prototype (new each time)
${...} (property placeholder)#{...} (SpEL expression)
@PostConstruct (init)@PreDestroy (destroy)
Checked exceptions (no rollback by default)Unchecked / RuntimeException (rolls back)
REQUIRED (join or start)REQUIRES_NEW (always new)

Six rules that keep questions honest

The template

STEM:   <one precise question, one idea>
TYPE:   single | select-all
KEY:    <letter(s)>
OPTS:   A) key
         B) adjacent-concept distractor
         C) plausible-fake distractor
         D) common-misconception distractor
WHY:    <key is right because…; best distractor is wrong because…>
SOURCE: <docs section / book page>

Worked example — from fact to question

Fact: Spring uses a JDK dynamic proxy when the bean implements an interface, and a CGLIB proxy when it doesn't.

Mine the distractors — what's this confused with? Which proxy is which; whether CGLIB needs an interface (it doesn't — that's JDK); whether final matters (it does for CGLIB).

▶ Reveal the finished question

Stem: A Spring bean class implements no interface but must be advised by an aspect. Which proxying strategy does Spring use, and what does it require?

A) A CGLIB proxy; the class and advised methods must not be final  ← key
B) A JDK dynamic proxy; the class must implement an interface (adjacent-concept distractor)
C) A ReflectionProxy; no constraints apply (plausible-fake distractor)
D) No proxy is possible without an interface (common-misconception distractor)

Why: With no interface, Spring falls back to CGLIB, which proxies by subclassing — so final classes/methods can't be advised. Needing an interface (B/D) describes JDK proxies. Source: Core docs §Proxying mechanisms.

Your turn — draft one, then check it

Take this fact and build a question with the template before revealing my version:

Fact to test The default bean scope is singleton — one shared instance per container, created eagerly at startup.
▶ Reveal a model question for that fact

Stem: What is the default scope of a Spring bean, and how many instances does the container create?

A) singleton — one shared instance per container  ← key
B) prototype — a new instance on every request (adjacent scope)
C) request — one instance per HTTP request (real-but-wrong scope)
D) default — one instance per injection point (plausible-fake scope)

Why: singleton is the default — one shared instance per container. B/C are real scopes but not the default; default (D) isn't a scope name at all. Source: Core docs §Bean Scopes.

Notice all four options are similar length and all name a scope — no giveaway.

Can you spot the flaw?

Now flip roles — grade these questions. Each has one problem a good author would fix.

Do this as homework
Write five of your own questions on today's Container material using the template — one per confusion pair from the bank above. Send them to me and I'll grade each on stem, key, and distractor quality. Questions you author are the ones you'll never get wrong on exam day.
I'm your teacher — send me your drafts. Paste your five questions in the chat. I'll mark them like an exam-item reviewer and hand back sharper versions.
← Container drill Dashboard →