Object-Oriented Programming Interview Questions & Answers — Cracked Java
// Module · 16 topics · 89 questions

Object-Oriented Programming

The four pillars, equals/hashCode, immutability, SOLID, GoF design patterns, and modern Java 25 OOP (records, sealed classes, pattern matching). About 30% of any senior Java interview.

0%
Reviewed
0 / 89
Topics done
0 / 16
Est. time left
~24h
Next up
Four Pillars: Encapsulation, Inheritance, Polymorphism, Abstraction
16 topics
01Junior5 Q0

Four Pillars: Encapsulation, Inheritance, Polymorphism, Abstraction

The conceptual foundation interviewers test in the first 5 minutes — definitions, code examples, and the real-world reason each pillar exists.

Not startedStart →
02Mid6 Q0

Classes, Constructors & Initialization Order

How constructors chain, what `this()` and `super()` mean, and the precise order in which static fields, instance fields, blocks, and constructors execute.

Not startedStart →
03Mid6 Q0

Inheritance, super, and Method Overriding

How overriding actually works on the JVM — dispatch tables, the @Override contract, covariant returns, and the difference between overriding and hiding.

Not startedStart →
04Mid6 Q0

Abstract Classes vs Interfaces (Post Java 8)

After default methods landed, the line blurred. Where it still matters: state, constructors, multiple inheritance, evolution.

Not startedStart →
05Mid5 Q0

Polymorphism in Practice

Dynamic dispatch, the difference between reference type and runtime type, and how to refactor `if/instanceof` chains into polymorphic code.

Not startedStart →
06Junior5 Q0

Access Modifiers & Encapsulation

public/protected/package-private/private, how each interacts with inheritance and the module system, and why fields should almost never be public.

Not startedStart →
07Mid6 Q0

equals, hashCode, toString — the Object Contract

The contract every Java dev must internalize and the inheritance trap that breaks symmetry. Overlaps with the Collections module but lives here too as core OOP.

Not startedStart →
08Mid5 Q0

Inner Classes — Static Nested, Inner, Local, Anonymous, Lambdas

Four kinds of inner classes, what each can capture, when to pick which, and how lambdas relate.

Not startedStart →
09Mid6 Q0

Immutability & Defensive Copying

The recipe for a truly immutable class, why defensive copies are required at the boundary, and where records do (and don't) get it right.

Not startedStart →
10Mid5 Q0

Composition vs Inheritance

"Favor composition" — the most-cited Effective Java item. When inheritance still belongs, and how to use forwarding to wrap instead of extend.

Not startedStart →
11Mid6 Q0

SOLID Principles

The five principles — definition, a one-line interview hook each, a violation example, and the refactor.

Not startedStart →
12Mid5 Q0

Creational Design Patterns

Singleton, Factory Method, Abstract Factory, Builder, Prototype — what each solves and when not to use it.

Not startedStart →
13Mid5 Q0

Structural Design Patterns

Adapter, Decorator, Proxy, Facade, Composite — how each composes objects to add capability without inheritance.

Not startedStart →
14Mid6 Q0

Behavioral Design Patterns

Strategy, Observer, Template Method, Command, Iterator, State, Chain of Responsibility — how objects coordinate behavior.

Not startedStart →
15Mid6 Q0

Modern OOP — Records, Sealed Classes, Pattern Matching (Java 14–25)

Records as data carriers, sealed hierarchies for exhaustive `switch`, pattern matching for destructuring. The shape of post-Java-21 OOP.

Not startedStart →
16Senior6 Q0

Low-Level Design Practice

How to walk a 45-minute LLD round: requirements → use cases → class diagram → key classes → patterns → trade-offs.

Not startedStart →