HTHyperTransformer AI

Study cards › System Design

System DesignInterview questions and answers

← Topics1 / 100
1 / 100 viewed
Question

What is SOLID?

Answer

SOLID is five OOP principles for maintainable software: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. Together they push you toward small, focused, swappable, and testable components — the foundation of clean object-oriented design.

Question

Single Responsibility Principle?

Answer

A class/module should have exactly one reason to change — one job, one stakeholder. If you find yourself describing a class with 'and' (handles users AND sends emails), it's doing too much. Split it. Smaller, focused units are easier to test, change, and reuse.

Question

Open/Closed Principle?

Answer

Software should be open for extension but closed for modification. You should be able to add new behavior without editing existing stable code. Achieved via interfaces and polymorphism — add a new implementation instead of branching the original with if/else for every new case.

Question

Liskov Substitution Principle?

Answer

Subtypes must be substitutable for their base type without breaking behavior. If Square extends Rectangle but disallows different width/height, code that worked on Rectangle breaks on Square. Inheritance must preserve contracts, not just signatures.

Question

Interface Segregation Principle?

Answer

Many small client-specific interfaces beat one fat general-purpose one. Consumers shouldn't depend on methods they don't use. Splitting interfaces reduces the surface area each component must care about and makes them easier to mock and test.

95 more System Design cards

Sign in with Google to study the whole deck, flag tricky answers and track your progress.

Continue with Google

More topics: React & Frontend JavaScript & TypeScript Backend Engineering Databases AI & Agentic AI DevOps & Cloud Security Testing DSA Coding Problems (Python)