Binary SemaphoreBinary Semaphore/learn
mentorshiptopicsroadmapsnotebooks
sign in
CC++JavaPythonJavaScriptTypeScriptGoDSAOperating SystemsNetworksDatabasesSystem DesignTheory and CompilersMaths for CSFrontendBackend and APIsSecurityCloud and DevOpsTestingAIGit and the ShellDebuggingInterviews and Viva
Java
  • memory-and-gc
  • concurrency-traps
  • collections-in-anger
  • equals-and-hashcode
  • interview-questions
  • viva-defence

© 2026 Binary Semaphore

discord

Java

Defending it in a viva

Saying why you used an interface there, out loud, without hedging.

A viva is not a test of your code. It is a test of whether the code is yours.

The examiner has already seen it work. What they are deciding is whether you made the decisions in it, and they find out by asking why, twice.

The question underneath every question

Whatever they ask, they are asking one thing: can you defend a choice.

"Why a HashMap here?" is not about HashMap. It is whether you considered anything else. "Why is this an interface?" is not about interfaces. The good answer always has the same shape: what the alternative was, and what made you pick this one.

"Because that is what the tutorial used" is an honest answer and it is also the one that costs you marks. "I used a HashMap because I need lookup by id and I do not care about order; a TreeMap would have cost me log n for sorting I do not use" is the same decision, defended.

Where they will actually push

The data model. Why this table, why this key, why not one big table. If you normalised, why. If you did not, why not.

The one weird bit. Every project has a part where something was worked around. They will find it, and they are not looking for it to be elegant. They are looking for you to know it is there and be able to say what you would do with more time.

Anything you cannot explain. Which, increasingly, is the code an agent wrote while you watched. If your commit history is clean and your explanation is not, that gap is the whole viva.

The three-sentence habit

Rehearse a three-sentence answer for every significant decision in the project. What it does, why this way, what you gave up.

Three sentences, because the failure is almost never saying too little. It is starting to explain, realising halfway that you are not sure, and trailing off. An examiner reads that as not knowing, whether or not you did.

What to do when you do not know

More on this is coming, and asking moves it up the list.

Want this written up?

Sign in and tell us. We write the ones people actually ask for, and asking takes one click.

Sign in to ask

Or sit with someone on it instead of waiting for us to write it.

What we have

Nothing yet, and no canonical source worth pointing at.

Book an hour on this

Say so, then say how you would find out.

"I am not sure, I would check what the query planner does with it" is a genuinely good answer. It is honest, it shows method, and it is far stronger than a guess delivered confidently. Examiners have heard a great many confident guesses and they can tell.

The one thing that does real damage is defending something you do not understand. It invites a follow-up you cannot survive, and now the question is not about the code any more.

Before the day

Read your own code as if someone else wrote it. Genuinely read it, and stop at anything that makes you pause. Every one of those pauses is a question waiting to be asked.

Run it once from a clean checkout. Projects that only work on the author's laptop are found in about ninety seconds, and it is a bad ninety seconds.

Then pick the three decisions you are proudest of and make sure you can say each in three sentences. Those are the ones you want to steer towards, and steering is allowed.

The honest version

If you built it with an agent, that is fine and increasingly normal. What is not fine is not having read it.

The fix is not to hide it. The fix is to go through it now, line by line, and make every decision in there a decision you can defend. That is the same work as understanding it, which is what the viva is measuring anyway.