Skip to content
Preptima

Creational Patterns interview questions

Factory, builder, singleton, and prototype, including when each is over-engineering.

3 questions in Low-Level Design & OOD.

medium3

mediumConceptCodingDesign

How would you implement a singleton, and why do many teams treat it as an anti-pattern?

The mechanics are easy - an enum in Java, a module-level value elsewhere - and are not the interesting part. The objection is that a singleton bundles two unrelated decisions, one instance and globally reachable, and the second is what makes dependencies invisible and tests order-dependent. It also connects creational patterns to the point an interviewer is testing.

4 minmid, senior