Top 3 Testability Interview Questions
Browse 3 real-world technical and behavioral interview questions about Testability. Review scenarios, edge cases, and architectural best practices.
What is the dependency inversion principle, and what exactly is being inverted?
High-level policy should not depend on low-level detail; both should depend on an abstraction. What inverts is ownership of the interface - it belongs to the module that consumes it, not to the one that implements it, which is what reverses the direction of the source dependency.
The business insists on a requirement that nobody can test — "the system must be intuitive". What do you write instead?
Convert the adjective into an observable: who is doing what task, under which conditions, and what result counts as a pass. Where no honest measure exists, record it as a design constraint with a named reviewer rather than leaving an unverifiable sentence in a document somebody signs.
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.