AI Coding interview questions
50 questions tagged by difficulty. Sign up to unlock full answers and track your weak areas.
- View
You are given a coding task and an AI assistant. What do you do before asking it to write any code?
Easy · AI Coding, Workflow, Fresher
- View
How do you break a medium-sized feature into tasks an AI assistant can do well?
Easy · AI Coding, Workflow, Fresher
- View
When should you NOT use the AI assistant during a coding interview or at work?
Easy · AI Coding, Workflow, Fresher
- View
The assistant keeps producing slightly different wrong answers for the same bug. What do you do?
Medium · AI Coding, Workflow, Senior
- View
What context do you give an assistant so that generated code fits an existing service?
Medium · AI Coding, Workflow, Senior
- View
In a 60-minute AI-assisted coding round, how do you split your time?
Medium · AI Coding, Workflow, Senior
- View
What makes a good prompt for generating a function? Rewrite: "write a function to dedupe users".
Easy · AI Coding, Prompting for Code, Fresher
- View
Why include input/output examples in a prompt, and how many?
Easy · AI Coding, Prompting for Code, Fresher
- View
Would you ask the assistant to write tests first or code first? Why?
Easy · AI Coding, Prompting for Code, Fresher
- View
The assistant generated code using a library and API your service doesn't use. How do you prevent this?
Medium · AI Coding, Prompting for Code, Senior
- View
The first generated solution works but is O(n²). How do you iterate with the assistant?
Medium · AI Coding, Prompting for Code, Senior
- View
How do you use the assistant to understand unfamiliar code rather than to write code?
Medium · AI Coding, Prompting for Code, Senior
- View
The assistant wrote this endpoint to list orders with their customer names. What's wrong?
Medium · AI Coding, Code Review, Senior
- View
The assistant added @Transactional to make this transfer atomic. Will it work?
Medium · AI Coding, Code Review, Senior
- View
Review this AI-generated in-memory rate limiter used by many request threads.
Medium · AI Coding, Code Review, Senior
- View
The assistant wrote a search repository method. Find the problem.
Easy · AI Coding, Code Review, Senior
- View
Users are duplicated in a HashSet after this AI-generated class was added. Why?
Easy · AI Coding, Code Review, Senior
- View
Review this AI-generated CSV export helper.
Easy · AI Coding, Code Review, Senior
- View
Customers report missing and repeated items when paging. Review the generated code.
Medium · AI Coding, Code Review, Senior
- View
The assistant added error handling to a payment notifier. What's wrong with it?
Easy · AI Coding, Code Review, Senior
- View
The assistant added a cache to speed up a pricing lookup. Review it for production.
Medium · AI Coding, Code Review, Staff
- View
The assistant wrapped a charge call with retries. What could go wrong?
Hard · AI Coding, Code Review, Staff
- View
The assistant parallelized calls to three downstream services. Review it.
Hard · AI Coding, Code Review, Staff
- View
Review this AI-generated Kafka consumer that writes events to the database.
Hard · AI Coding, Code Review, Staff
- View
Two admins editing the same product sometimes overwrite each other. The assistant's update code is below. Fix it.
Medium · AI Coding, Code Review, Staff
- View
The assistant wrote a daily report job. Reports for some regions are off by a day. Why?
Medium · AI Coding, Code Review, Staff
- View
The assistant wrote this unit test and says coverage is now 100%. Is the code verified?
Medium · AI Coding, Verification, Senior
- View
How do you systematically find edge cases the AI-generated code may have missed?
Medium · AI Coding, Verification, Senior
- View
When would you use property-based tests to verify AI-generated code? Give an example.
Medium · AI Coding, Verification, Senior
- View
The assistant says its solution is O(n log n). How do you check that claim quickly?
Medium · AI Coding, Verification, Senior
- View
AI-generated repository code passes unit tests with an in-memory database but fails in staging. What's your verification strategy?
Hard · AI Coding, Verification, Staff
- View
What is your personal checklist when reviewing an AI-generated pull request?
Medium · AI Coding, Verification, Staff
- View
How can mutation testing help you trust AI-written tests?
Hard · AI Coding, Verification, Staff
- View
The AI-generated feature is merged. How do you verify it behaves correctly in production?
Hard · AI Coding, Verification, Staff
- View
You must add a new endpoint to an unfamiliar Spring service using an assistant. Walk through your steps.
Medium · AI Coding, Codebase Extension, Senior
- View
How do you use an assistant to refactor a 600-line legacy method safely?
Medium · AI Coding, Codebase Extension, Senior
- View
The assistant suggests changing a shared utility used by 40 call sites. How do you assess and limit the blast radius?
Hard · AI Coding, Codebase Extension, Staff
- View
The assistant keeps generating modern code (records, virtual threads) in a Java 11 legacy service. How do you handle it?
Medium · AI Coding, Codebase Extension, Staff
- View
The assistant generated a database migration that adds a NOT NULL column to a 200M-row table. Review the plan.
Hard · AI Coding, Codebase Extension, Staff
- View
The assistant renamed a JSON field in a response DTO for clarity. What do you check before accepting it?
Medium · AI Coding, Codebase Extension, Staff
- View
The assistant suggests adding a dependency you've never heard of. What do you check?
Medium · AI Coding, Security & Supply Chain, Staff
- View
A teammate pasted a production config file into an AI chat to debug a connection issue. What's the risk and what should happen?
Medium · AI Coding, Security & Supply Chain, Staff
- View
Review this AI-generated endpoint for downloading invoices.
Medium · AI Coding, Security & Supply Chain, Staff
- View
How do you manage license and IP risk from AI-generated code at company scale?
Hard · AI Coding, Security & Supply Chain, Architect
- View
Your team builds an internal agent that reads tickets and opens pull requests automatically. What security controls do you require?
Hard · AI Coding, Security & Supply Chain, Architect
- View
After adopting AI assistants, PR volume doubled and reviewers are overwhelmed. What do you change?
Medium · AI Coding, Team Adoption, Staff
- View
You're asked to define the engineering org's policy for AI coding assistants. What does it cover?
Hard · AI Coding, Team Adoption, Architect
- View
Leadership asks: is AI actually making us faster? How do you measure it?
Hard · AI Coding, Team Adoption, Architect
- View
What CI/CD guardrails become more important when a lot of code is AI-generated?
Hard · AI Coding, Team Adoption, Architect
- View
How do you make sure junior engineers still build fundamentals when they use AI assistants daily?
Hard · AI Coding, Team Adoption, Architect