InterviewStack.io LogoInterviewStack.io

Object Oriented Design Principles Questions

Technical principles for designing object oriented systems that are maintainable, extensible, and testable. Topics include single responsibility, open closed, Liskov substitution, interface segregation, and dependency inversion principles; composition versus inheritance trade offs; designing clear and minimal public interfaces and application programming interfaces; separation of concerns, low coupling and high cohesion; use of design patterns where appropriate; strategies for dependency management and dependency injection; and practices that improve testability such as designing for mocking and modularity. Interviewers evaluate ability to reason about class and module boundaries, extensibility, performance and complexity trade offs, and to produce clean code and APIs that support long term maintenance.

MediumTechnical
0 practiced
Explain constructor injection, setter injection, and interface injection as dependency injection techniques. For each approach, state pros and cons, when to prefer it, and show a compact Java snippet illustrating constructor injection for a service depending on a repository interface.
EasyTechnical
0 practiced
Explain the SOLID principles (Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, Dependency Inversion). For each principle give a one-sentence definition and a short, language-agnostic example of a violation and a fix that demonstrates how to apply it in a real codebase.
HardTechnical
0 practiced
Implement a type-safe Java event bus where subscribers register for specific event types using generics and the publish/subscribe dispatch is guaranteed at compile time for listener type signatures. Provide interface/class definitions using Java generics, show registering and posting events, and explain how this design respects LSP.
EasyTechnical
0 practiced
Explain the Dependency Inversion Principle (DIP) and how it differs from dependency injection as a technique. Provide a simple Java example showing a high-level module depending on an abstraction and show both tight-coupling and DIP-compliant versions. Explain why DIP improves modularity.
MediumSystem Design
0 practiced
Design an event-driven architecture for domain events in an e-commerce application (order.created, payment.succeeded). Define event interfaces, handlers, ordering and at-least-once semantics, and explain how to keep the domain model decoupled from infrastructure concerns, applying DIP and ISP.

Unlock Full Question Bank

Get access to hundreds of Object Oriented Design Principles interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.