📊 2026 Career Guide
⚡ 2026 Verified Program Offer: 6 Months 100% Live Training • ₹1,20,000 Flat Fee (₹10,000/mo 0% EMI) • Official IBM & Microsoft Badges • Guaranteed 6-Mo Paid Internship*
📥 Download 2026 Syllabus & Fee PDF →
FREE 2026 PDF DOWNLOAD • VERIFIED LAB CODE

📥 Download Complete 2026 Printable PDF Notes, Architecture Diagrams & GitHub Code

Get instant free access to the 2026 printable PDF cheat-sheet, runnable lab repositories, interview evaluation rubric, and AI Campus 6-Month Paid Corporate Internship roadmap.

Download Free PDF & Syllabus Roadmap →

Top 12 Senior Low-Level Design (LLD), Object-Oriented Design & Design Patterns Questions (2026)

Production Low-Level Design (LLD), SOLID refactorings, design patterns, concurrency controls, and machine coding problems asked during SDE-2 and SDE-3 technical interview rounds:

Q1 Explain SOLID Principles with production code violations and refactored patterns.

S - Single Responsibility Principle (SRP): A class should have only one reason to change. Violation: An OrderService that validates cart, charges credit card, and writes PDF invoices. Refactor: Separate into PaymentProcessor, InvoiceGenerator, and OrderRepository. O - Open/Closed Principle (OCP): Software entities should be open for extension, but closed for modification. Achieved via interfaces and Strategy/Factory patterns instead of chaining if-else or switch blocks on type codes. L - Liskov Substitution Principle (LSP): Subtypes must be substitutable for their base types without altering correctness (e.g. Square inheriting Rectangle violates LSP because setting width changes height). I - Interface Segregation Principle (ISP): Clients should not be forced to depend on methods they do not use; prefer fine-grained interfaces. D - Dependency Inversion Principle (DIP): High-level modules should depend on abstractions (interfaces), not low-level concrete implementations.

Q2 Compare Factory Method vs Abstract Factory Pattern with real-world examples.

Factory Method: Defines an interface for creating a single object, but lets subclasses decide which concrete class to instantiate (e.g., NotificationFactory.createNotification('SMS') returns an SMSNotification). Abstract Factory: Provides an interface for creating families of related or dependent objects without specifying their concrete classes. Example: A cross-platform UI toolkit with GUIFactory producing matching families of widgets: MacButton + MacCheckbox vs WindowsButton + WindowsCheckbox, guaranteeing consistent themes across client platforms.

Q3 How does the Strategy Pattern enable dynamic algorithm switching (e.g. Payment Gateways / Routing)?

The Strategy Pattern defines a family of interchangeable algorithms, encapsulates each one inside a separate class conforming to a common interface, and allows clients to swap implementations at runtime. In an e-commerce checkout service:
interface PaymentStrategy { void pay(int amount); }
class RazorpayStrategy implements PaymentStrategy { ... }
class StripeStrategy implements PaymentStrategy { ... }
class UpiStrategy implements PaymentStrategy { ... }

class CheckoutService {
    private PaymentStrategy strategy;
    public void setPaymentStrategy(PaymentStrategy strategy) { this.strategy = strategy; }
    public void processOrder(int total) { strategy.pay(total); }
}
This completely satisfies Open/Closed Principle.

Q4 Explain the Observer Pattern and how it forms the foundation for Event-Driven Architectures.

The Observer Pattern defines a one-to-many dependency between objects so that when one object (the Subject/Publisher) changes state, all its registered dependents (the Observers/Subscribers) are notified automatically. In distributed systems, this is extended via message brokers (Kafka/RabbitMQ). Within monolithic backend code, it decouples core domain actions (e.g., UserRegisteredEvent) from auxiliary services (e.g., WelcomeEmailHandler, SlackAlertHandler, AnalyticsTrackingHandler) which attach dynamically without modifying the registration service.

Q5 How do you implement a thread-safe Singleton in Java/C++ (Double-Checked Locking vs Enum Singleton)?

The Double-Checked Locking pattern reduces synchronization overhead by checking if the instance is null before acquiring a lock:
public class DatabaseConnection {
    private static volatile DatabaseConnection instance;
    private DatabaseConnection() {}
    public static DatabaseConnection getInstance() {
        if (instance == null) {
            synchronized (DatabaseConnection.class) {
                if (instance == null) {
                    instance = new DatabaseConnection();
                }
            }
        }
        return instance;
    }
}
In modern Java, the Enum Singleton (public enum DatabaseConnection { INSTANCE; }) is the gold standard because JVM guarantees single instantiation, thread safety, and built-in serialization safety against reflection attacks.

Q6 What is the Decorator Pattern and how is it used in enterprise middleware and logging?

The Decorator Pattern attaches additional responsibilities to an object dynamically at runtime without subclassing. The decorator conforms to the same interface as the wrapped component and delegates calls while adding behavior before or after. Classic examples: Java's new BufferedReader(new FileReader('file.txt')), Python function decorators (@timed, @authenticated), and HTTP web frameworks where middleware wraps request handlers with authentication, distributed tracing (OpenTelemetry span injection), and rate-limiting wrappers.

Q7 Design the Low-Level Architecture for an Enterprise Parking Lot System.

Core domain classes: ParkingLot (singleton holding floors), ParkingFloor, ParkingSpot (subclasses: Compact, Large, EV, Handicapped), Vehicle (Car, Truck, Motorcycle, EVCar), Ticket, and PaymentPortal. Key design patterns used: 1) Strategy Pattern for spot assignment: FarthestSpotStrategy, NearestSpotToEntranceStrategy, 2) Factory Pattern for vehicle spot allocation, and 3) Observer Pattern: Display boards update available spots per floor automatically when sensors detect vehicle entry/exit.

Q8 Design an Elevator Control System with multi-car dispatching (SCAN / LOOK algorithm).

Core entities: ElevatorCar (state: IDLE, UP, DOWN; currentFloor, doorStatus), InternalPanel, ExternalPanel, ElevatorController, and DispatchStrategy. Use the LOOK / SCAN Algorithm (similar to disk head scheduling): the elevator car continues traveling in the current direction as long as there are pending requests ahead in that direction, servicing stops sequentially before reversing direction, preventing passenger starvation. A centralized Dispatcher assigns incoming hall calls to the car with minimum estimated arrival time (ETA).

Q9 Explain Concurrency Control: Mutexes vs Read-Write Locks vs Optimistic Concurrency Control (OCC).

Mutex (Mutual Exclusion): Enforces that only a single thread can access a critical section at any time. High contention degrades throughput. Read-Write Lock (ReentrantReadWriteLock): Allows unlimited concurrent readers when no writer is active, but grants exclusive access to writers. Drastically boosts performance for read-heavy in-memory data structures (95% reads, 5% writes). Optimistic Concurrency Control (OCC): Assumes conflicts are rare; transactions read data without locking and record a version number. On commit, if the version changed, the transaction aborts and retries. Standard pattern for distributed databases and microservice REST APIs (using HTTP ETag / If-Match headers).

Q10 Compare Dependency Injection (DI) vs Service Locator: Why is Spring / NestJS DI preferred?

Service Locator: A central registry where classes explicitly request their dependencies (e.g. Locator.get(PaymentService.class)). Drawbacks: It hides class dependencies inside implementation code, breaks modularity, and complicates unit testing because mock injection requires configuring the static locator. Dependency Injection (DI): Inversion of Control where dependencies are passed directly into constructors (Constructor Injection). Makes dependencies explicit, enables clean unit testing with mock frameworks (Mockito, Jest), and promotes loose coupling.

Q11 Explain the Builder Pattern: How does it eliminate telescoping constructors and enforce invariants?

When an entity has 8+ attributes with various optional configurations, constructors suffer from telescoping (overloaded constructors with 4, 5, 6 parameters) which causes cognitive errors (accidentally swapping adjacent string arguments). The Builder Pattern provides a fluent chained API (User.builder().name('Alice').email('...').age(28).build()). The build() method executes comprehensive cross-field validation rules and invariant checks before returning an immutable instance.

Q12 What is the State Pattern and how does it clean up complex workflow status transitions?

The State Pattern allows an object to alter its behavior when its internal state changes, appearing to change its class. Instead of monolithic switch(orderStatus) blocks inside every method, each state is modeled as an independent class implementing an interface (e.g. OrderState: cancel(), ship(), refund()). In PlacedState, calling ship() transitions to ShippedState; in DeliveredState, calling ship() throws an IllegalStateException. Cleanly prevents invalid state transitions.

Q1 What is the difference between Monolithic, Microservices, and Event-Driven Architectures?

Monoliths combine all business modules in a single codebase and database; easy to develop initially, but difficult to scale independently.

Microservices partition domains into autonomous services communicating over REST/gRPC with private databases.

Event-Driven Architectures decouple services via message brokers (Kafka/RabbitMQ) producing and consuming asynchronous events.

TEXT EXAMPLE
# Kafka Event-Driven Architecture: OrderService produces 'OrderPlaced' -> InventoryService & PaymentService consume in parallel

Q2 Explain Database Concurrency Control: Optimistic vs Pessimistic Locking.

Optimistic Locking checks a version column at commit time; fails if another transaction updated the row concurrently (ideal for low contention).

Pessimistic Locking locks rows using `SELECT ... FOR UPDATE` preventing other transactions from modifying data until commit (ideal for high contention).

SQL EXAMPLE
# Optimistic Locking in SQL:
UPDATE products SET stock = stock - 1, version = version + 1
WHERE id = 42 AND version = 3;

Q3 How do you design an idempotent REST API?

An API is idempotent when making multiple identical requests has the exact same side-effect as a single request. GET, PUT, DELETE are idempotent by HTTP spec.

For POST endpoints, require a client-generated Idempotency-Key header stored in Redis with cached responses.

HTTP EXAMPLE
POST /api/v1/payments
Idempotency-Key: e8b9f0a2-4a2e-4b6c-9c7f-8d2b9e1a3c5f

Q4 What are Circuit Breakers in distributed microservices (Netflix Hystrix / Resilience4j)?

Circuit Breakers monitor remote service failure rates. When failures exceed a threshold, the breaker 'trips' (OPEN state), immediately returning fallbacks without waiting for slow timeouts, protecting the system from cascading failure.

JAVA EXAMPLE
@CircuitBreaker(name = "paymentService", fallbackMethod = "fallbackPayment")
public PaymentResponse process(PaymentRequest req) { ... }

Q5 Explain Garbage Collection in JVM or V8 and how memory leaks occur in managed runtimes.

Runtimes use generational mark-and-sweep garbage collection. Memory leaks occur when unused objects remain reachable from GC Roots (e.g. unclosed event listeners, static collections, lingering timers).

TEXT EXAMPLE
# Heap dump profiling via Eclipse Memory Analyzer (MAT) or Chrome DevTools Heap Snapshot

Q6 What is the difference between Process vs Thread vs Coroutine/Goroutine?

A Process has its own virtual memory space. Threads share process memory and are scheduled by the OS kernel.

Coroutines/Goroutines are user-space green threads cooperatively scheduled by language runtimes, using only ~2-4 KB stack memory.

GO EXAMPLE
# Go Goroutines launching 10,000 concurrent tasks effortlessly:
go func() { doTask() }()

Q7 How do you handle API Versioning in enterprise systems?

Common strategies: URI path versioning (/v1/users), Query parameter versioning (/users?version=1), and Header/Accept header content negotiation.

TEXT EXAMPLE
# URI Path versioning is industry standard for developer ergonomics.

Q8 Explain WebSockets vs Server-Sent Events (SSE) vs Long Polling.

WebSockets provide full-duplex bidirectional TCP communication for interactive chats/gaming.

Server-Sent Events (SSE) provide unidirectional text streaming over HTTP/2, ideal for LLM token streaming.

Long polling holds HTTP connections open until data arrives; high overhead.

HTTP EXAMPLE
# SSE LLM Token Streaming response header:
Content-Type: text/event-stream
Cache-Control: no-cache

Q9 What is the difference between Horizontal Scaling and Vertical Scaling?

Vertical Scaling adds more CPU/RAM to a single server; simple but hits hardware limits.

Horizontal Scaling adds more commodity servers behind load balancers; offers virtually unlimited scalability and high availability.

TEXT EXAMPLE
# Horizontal scaling with stateless app containers behind AWS ALB

Q10 How do you implement Distributed Tracing with OpenTelemetry and Jaeger?

OpenTelemetry propagates a unique Trace ID and Span ID across HTTP/gRPC headers (W3C Trace Context: `traceparent`). Jaeger visualizes the end-to-end request timeline across all microservices.

HTTP EXAMPLE
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
2026 Career Fast-Track

Accelerate Your Career with Guaranteed Paid Internship*

Transparent ₹1,20,000 Fee (Inclusive of GST) • ₹10,000/month No-Cost EMI • 6-Month Corporate Paid Internship (₹15,000 – ₹35,000/mo stipend) with official IBM & Microsoft Credly credentials.