← All videos

Engineering video

21:01 · 16 October 2026

7 AI Coding Interview Questions & Answers (Junior, Mid & Senior)

Chapters 17 sections

  1. 0:00Q1: An AI agent tested its own PR, then production broke
  2. 1:40Q2: How to ensure the quality of AI-written code
  3. 2:54Static analysis: duplication, dead code and complexity
  4. 5:04What about testing? End-to-end over unit tests

Key concepts in this video:

1. Agentic Task Isolation

Using independent agents with clear context boundaries for coding, testing, and reviewing prevents agents from gaming shared objectives or writing shallow tests.

Watch section from 0:12 →

2. Traditional and Static Code Quality Measures

Managing AI-generated code volume requires enforcing linters, type safety, static analysis, duplication checks, and monitoring cyclomatic complexity.

Watch section from 1:40 →

3. End-to-End Testing Preferences

End-to-end tests are favored over short-lived unit tests when working with AI because unit tests are easily gamed and less effective at catching common AI errors.

Watch section from 5:10 →

4. Context Hand-off vs Clear and Compact

Handoff summaries are preferred over clear or compact commands during long coding sessions to retain relevant overall plans and implementation statuses without losing critical context.

Watch section from 6:00 →

5. Agentic Software Factory and Human Supervision

An agentic software factory automates the software lifecycle from planning and implementation to QA and deployment, but it requires human supervision and review at final gates.

Watch section from 8:00 →

6. Context Window Degradation and Hallucinations

As context size grows, the attention budget per token decreases, flattening weights and leading to hallucinations, which can be mitigated by keeping context under 10% to 20% of the window.

Watch section from 12:48 →

7. KV Caching and Token Optimization

Placing changing elements like timestamps at the bottom of a prompt maximizes KV cache reuse and optimizes input token expenditure across LLM calls.

Watch section from 15:37 →

8. Minimizing Hallucinations via Structured Outputs

Hallucinations can be minimized by leveraging static typed interfaces for structured outputs and exploring formal verification rules for business logic.

Watch section from 18:08 →

Transcript

AI coding question number one. An AI agent reviewed and tested its sound PR, but after deployment, you found production bugs. How would you fix and avoid this in the future? So, an AI agent you and test it some PR. Well, usually the problem with agents is that the way they are built, they try to game whatever goal we give it. And so when an agent has context to build the implementation and then it has to write a test and then review its own code, usually, it's just kind of working against those three conditions and it's going to do whatever it takes to make it pass.