Interview preparation with the depth the listicles skip.
Three layers per question: the 45-second answer, the real mechanism, and the follow-ups the interviewer asks next. Then a four-tier practice ladder that ends in a real production incident.
Indexed by your experience
Not "Top 100". A 3-year candidate and a 7-year candidate get asked the same question and are judged by different answers.
The follow-up, not just the answer
Section 3 of every entry is the question after the question — the part the round is actually testing.
Output you can trust
Every runnable example is compiled and executed on every deploy and diffed against the claimed output. Stale output fails the build.
Java
All topics →What is the contract between hashCode() and equals()?
Equal objects must return the same hash code. Unequal objects are free to collide — that is legal and normal, not a bug. Break the first rule and hash-based collections lose your data silently.
Asked constantlyintermediate1–8 yrs8 min readOopHow does HashMap work internally?
A lazily-created array of buckets indexed by a spread hash; collisions chain into a linked list that becomes a red-black tree only when the bin holds 8+ nodes AND the table is at least 64 slots.
Asked constantlyintermediate1–8 yrs9 min readCollectionsWhen would you use LinkedList instead of ArrayList?
Almost never. LinkedList only wins at the ends of the list, and when you need that you want ArrayDeque instead. Its famous advantage — cheap mid-list insertion — is 23x slower than ArrayList on real hardware, because you must walk to the index first.
Asked constantlyintermediate0–8 yrs9 min readCollectionsWhy is String immutable, and what is the string pool?
String is immutable because nothing in its API exposes a mutator — not because its byte[] field is final. The pool is a JVM-wide cache of literals that makes == accidentally work on literals and fail everywhere else.
Asked constantlyintermediate0–8 yrs9 min readStringsWhat is the difference between checked and unchecked exceptions?
Checked exceptions are enforced by the compiler; unchecked ones are not. The interesting question is not the definition but why every major Java framework since 2004 has moved to unchecked exceptions — and lambdas finished the argument in Java 8.
Asked constantlyintermediate0–8 yrs10 min readExceptions
4 topics · 5 entries · every example verified on CodeDepth's last deploy