Skip to content
JavaAgentic

Type at least two characters. Try “RAG”, “pgvector” or “tool calling”.

Interview Prep · Phase 1

Core Java & OOP Foundations

The questions every Java interview opens with, answered at the depth that separates a memorised answer from an understood one: the equals/hashCode contract, string interning, generics erasure, exception semantics and class initialisation order.

Beginner6 min read

The equals() and hashCode() Contract

Why overriding equals() without hashCode() breaks every hash-based collection, what the five contract rules guarantee, and the mutable-key bug that silently loses data.

Read tutorial
Beginner6 min read

Strings: Immutability, the Pool and StringBuilder

Why String is immutable and what that buys you, how the string pool and intern() really work, why == sometimes appears to work, compact strings, and when concatenation in a loop actually costs you.

Read tutorial
Beginner6 min read

OOP Principles the Interviewer Actually Probes

The OOP questions behind the textbook four: static vs dynamic dispatch, Liskov violations that compile cleanly, abstract class versus interface, and composition over inheritance.

Read tutorial
Intermediate6 min read

static, final and Class Initialisation Order

The exact order the JVM initialises a class, why a static final String can survive deleting the class that declared it, effectively final, and how two classes can deadlock while loading.

Read tutorial
Intermediate7 min read

Generics, Type Erasure and Wildcards

What the compiler removes and what it inserts, why you cannot create an array of a generic type, PECS explained by what it enables, bridge methods, and heap pollution from unchecked varargs.

Read tutorial
Intermediate6 min read

Immutable Objects & Defensive Copying

The five conditions for a genuinely immutable class, the leaked-collection bug that defeats final, why records are only shallowly immutable, and what final fields guarantee across threads.

Read tutorial
Intermediate5 min read

Comparable, Comparator and Sorting Contracts

Natural order versus external order, the total-ordering contract and the exception thrown when you break it, comparator chaining, the integer-overflow bug, and TimSort stability.

Read tutorial