DEV Community

Cover image for AI can write the code. It can't tell you why it's correct under load.
Nikhil Kamani
Nikhil Kamani

Posted on

AI can write the code. It can't tell you why it's correct under load.

A junior developer asked me last week: "AI writes half my code now. Why does the interview process still grill me on HashMap internals and thread safety?"

I've interviewed 300+ Java developers over 13 years. Here's what I told him.

Ask any AI assistant to write a counter, a cache, or a payment method, and it'll hand you something that compiles, runs, and looks completely reasonable. It will also, quite often, hand you code like this:

private volatile int count = 0;

public void increment() {
    count++;
}
Enter fullscreen mode Exit fullscreen mode

This looks fine. It passes every test you'd normally write. It will also silently lose updates the moment two threads call increment() at the same time — because volatile guarantees visibility, not atomicity, and count++ is three separate operations under the hood. AI doesn't know that this specific line is dangerous, because syntactically there's nothing wrong with it. It only becomes a bug under concurrent load, in production, weeks after it shipped.

When I ask a candidate "walk me through what happens when two threads call this method at the same time," I'm not testing whether they can write a counter. I'm testing whether they can catch this exact bug in a code review — including one AI just generated for them.

The fundamentals didn't get less important. They got more important.

A few years ago, the bottleneck was typing out correct code. Now AI removes most of that friction — which means the bottleneck has moved entirely to judgment: can you look at generated code and know whether it's actually safe?

That skill doesn't come from prompting well. It comes from actually understanding what's happening underneath

What actually changed in interviews

AI changed what junior developers are asked to produce day to day. It didn't change what interviewers are testing for. Every interview I run this year still comes back to the same core question: does this person understand memory, concurrency, and data structures well enough to catch the bug — or do they just know how to get an AI to write code that compiles?

If anything, this makes fundamentals a bigger differentiator between candidates than they were five years ago, not a smaller one. Everyone can produce working-looking code now. Far fewer people can tell you why it's wrong.

I put together everything I actually ask candidates into a guide — 700+ pages: Core Java, Concurrency, Spring Boot, Design Patterns, Coding Round Patterns.

Full guide: https://kamaninikhil.gumroad.com/l/java-interview-guide

Feedback or questions? Email me: kamaninikhil71@gmail.com

Top comments (0)