Java interview questions — 13 years experience
These are the questions a candidate with 13 years of experience gets asked. The same question is asked at many levels — what changes is how deep the follow-ups go, so read section 3 of each entry.
How would you implement a rate limiter?
Token bucket when bursts are acceptable, sliding window when the limit must be exact. Fixed window is the cheapest and lets through twice the limit at every window boundary. The single-machine algorithm is the easy half — the real question is where the counter lives once you have more than one instance.
Asked constantlyintermediate2–15 yrs13 min readTraffic managementTwo libraries need different versions of the same dependency. What happens?
One version wins and the other is discarded — there is no classpath on which both exist. Maven picks the one declared nearest the root, Gradle picks the highest, so the same dependency set resolves differently under each. Whoever needed the loser then fails at runtime with a linkage error, on first execution of that call site and not before.
Asked constantlyintermediate1–15 yrs13 min readDependencies