Home › Blog › Coding Mock Interview With AI: A 45-Minute Script, Problem Set and Rubric (2026)

Coding Mock Interview With AI: A 45-Minute Script, Problem Set and Rubric (2026)

To run a coding mock interview with AI, split the job in two: let a voice AI or chatbot play the interviewer (it reads the problem, answers clarifying questions, keeps time and asks follow-ups) while you write the code in a plain editor with a timer, then paste your code in for a review afterwards. A voice-only AI mock hears your explanation but can't watch you type, so narrate your key decisions and treat the code review as a separate step.

To run a coding mock interview with AI, split the job in two: let a voice AI or chatbot play the interviewer (it reads the problem, answers clarifying questions, keeps time and asks follow-ups) while you write the code in a plain editor with a timer, then paste your code in for a review afterwards. A voice-only AI mock hears your explanation but can't watch you type, so narrate your key decisions and treat the code review as a separate step. This is practice: online assessments and live coding rounds set their own rules on outside help, and most don't allow it.

The setup: three tools, three jobs

ToolIts jobSettings
AI interviewer, voice or chatReads the problem, answers clarifying questions, keeps time, asks follow-upsOne question at a time; no hints unless you ask
Plain text editorWhere you write the codeAutocomplete and linting off; don't run anything until the review
TimerKeeps the round honest45 minutes, with a check-in at minute 25
Chatbot review, afterwardsFinds bugs, checks complexity, suggests cleaner codePaste the problem, your code and the complexity you stated

For the interviewer, a voice mode such as ChatGPT Voice or Gemini Live makes you talk the way you will on the day; typing your reasoning lets you hide pauses a real interviewer would hear. Interviewers in coding rounds commonly evaluate how you reason, not only whether the code runs, and they can only judge reasoning they hear. Our guide to thinking out loud in coding interviews has a narration template.

What to rehearse: ten problems by pattern

Problems we wrote in widely used patterns, each with the follow-up an interviewer is likely to ask. For the patterns themselves, see our LeetCode patterns for interviews.

PatternPractice problemFollow-up to expect
Hash mapReturn every pair of numbers in an array that sums to a target, without duplicate pairsThe array is sorted: can you use constant extra space?
Sliding windowLength of the longest substring with at most k distinct charactersCharacters arrive as a stream
Two pointersRemove duplicates from a sorted array in place and return the new lengthAllow each value at most twice
IntervalsMerge overlapping intervalsInsert one new interval into an already merged list
HeapReturn the k most frequent wordsk is close to the number of distinct words
TreesLowest common ancestor of two nodes in a binary treeIt's a binary search tree; can you do better?
GraphsGiven course prerequisites, can every course be finished?Return one valid order
Binary searchSearch a rotated sorted arrayDuplicates are allowed
Dynamic programmingFewest coins that make an amountCount the number of ways instead
Class designAn LRU cache with get and put in constant timeEach entry now expires after a set time

A 45-minute coding mock script

MinutesPhaseWhat you say or do
0–2ProblemRestate it in your own words
2–6ClarifyInput size, empty input, duplicates, negative numbers, what to return
6–10ApproachA brute force and its complexity, then the better idea and its complexity, before typing
10–30CodeWrite it in the editor and say the intent of each block
30–36TestTrace a normal case and an edge case by hand; fix bugs out loud
36–42Follow-upThe AI changes one constraint; adapt the working code
42–45Wrap-upFinal complexity and what you'd improve with more time

Prompt 1: the interviewer

Be my coding interviewer for a 45-minute practice round at [easy / medium / hard] difficulty on [a pattern, or 'any pattern']. Give me the problem in one short paragraph with one example and nothing else. Answer clarifying questions in one sentence. Don't give hints unless I say 'hint', and count how many I ask for. I'll write code in my own editor and read the important lines aloud. At minute 25, ask where I am. When I say 'done', ask me to trace one input by hand, then give me one follow-up that changes a constraint.

Why it works: it holds back hints and adds a check-in at minute 25, so you practice pacing as well as solving.

Prompt 2: the code review

Problem: [paste]. My code, written in [language] in [minutes] minutes without running it: [paste]. My stated complexity: [time, space]. Review it in this order: 1) would it compile or run as written; 2) any input that gives a wrong answer, with expected and actual output; 3) whether my complexity is right; 4) one edge case I didn't handle; 5) only then, a cleaner version with a one-line reason for each change.

Why it works: the order makes you face your own bugs before you see a better solution.

Prompt 3: tests without the answer

Write 8 test inputs with expected outputs for this problem: [paste]. Include an empty input, a single element, all duplicates, the largest size in the constraints and one tricky case you think I'll miss. Don't show me a solution.

Why it works: you run the tests yourself after the round, and a failing case teaches more than a model answer. Check the expected outputs too; chatbots get some wrong.

A worked example: narrating one problem

What “thinking out loud” sounds like on the intervals problem, line by line. Every claim here is checkable.

Notice the edge case was chosen to break a common bug: setting the end to the second interval's end instead of the larger of the two.

Rubric for a coding mock

CriterionStrongWeak
UnderstandingRestates the problem and confirms constraints and edge casesStarts typing straight away
ApproachBrute force first, a better idea with reasons, complexity before codingCodes the first idea with no plan
CodeCorrect, readable, small helper functions where usefulWorks only on the example
TestingTraces cases by hand and finds own bugs“I think that's right”
CommunicationNarrates decisions and checks inLong silences
IndependenceNo hints, or one hint used wellThree or more hints
TimeWorking code by minute 30, follow-up attemptedStill coding at minute 40

Common ways candidates lose points are in our list of coding interview mistakes.

A two-week plan

  1. Days 1–10: one pattern a day from the table, one 45-minute mock each, reviewed with prompt 2. Redo any problem you needed a hint on two days later.
  2. Days 11–12: mixed problems, where spotting the pattern is part of the task.
  3. Day 13: one mock with a person in a shared editor, if your interview uses one; our CoderPad interview tips cover the common platforms.
  4. Day 14: light review of your notes on missed edge cases, then rest.

Language-specific rounds have their own guides: the Python mock interview and the Java mock interview.

What an AI mock can't do in a coding round

Where CoPilot Interview fits

CoPilot Interview is an AI interview assistant whose free AI mock interview builds coding questions from your résumé and the job description, reads them aloud and scores each spoken answer out of 10. It scores what you say, which makes it a good drill for explaining an approach and its complexity; keep your editor and a chatbot review for the code itself. The free plan gives 15 minutes a day of live help in sessions of up to 15 minutes, with AI mock interviews included. Online assessments and live rounds set their own rules, so prepare with it and follow your employer's rules.

Disclosure: CoPilot Interview is our product, so weigh what we say about it accordingly.

Frequently asked questions

Can AI run a coding mock interview?

Yes. A chatbot or voice AI can give you problems, answer clarifying questions, keep time and ask follow-ups. Write the code yourself in a plain editor, then paste it back in for a review.

Does a voice AI mock watch me code?

No. A voice-only mock hears what you say, not what you type. Narrate your key decisions, then paste your finished code into a chatbot for a separate review.

How long should a coding mock interview be?

About 45 minutes for one problem with a follow-up, which matches many live coding rounds. Some companies fit two problems into a similar time, so check your company's format.

Should I run my code during practice?

Not during the round if your real interview won't let you. Trace it by hand first, then run it and the test cases afterwards to see what you missed.

How many coding mocks should I do?

There's no fixed number. One a day for two weeks, each reviewed, builds the habits most rounds reward; add at least one with a person.

Rehearse it out loud before the real one

The AI mock interview builds questions from your resume and the job description, reads them aloud and scores each spoken answer out of 10. Included on the free plan.

Start a mock interview