Skip to content
Preptima

Behavioural Patterns interview questions

Strategy, observer, state, command, and template method in interview-sized problems.

4 questions in Low-Level Design & OOD.

medium4

mediumDesignCoding

Design the classes for a notification service that sends email, SMS and push. Which design patterns earn their place, and which would you leave out?

Name what varies first: channel, text, the user's channel choices and retry. A notification service then needs a channel interface (a strategy) picked from a registry, templates as data, a preference policy and a retry policy splitting transient from permanent errors. Most other design patterns add classes, not value.

6 minmid, senior
mediumConceptDesign

When would you use the observer pattern, and what goes wrong with it at scale?

Observer decouples a subject from things that react to it, which is right when the subject genuinely should not know its listeners. The costs are a control flow you cannot read from the code, listener lifetimes that leak, and an exception in one observer that silently prevents the rest from running.

4 minmid, senior, staff