Articles
The AI Coding Interview: A Complete 2026 Guide
Practice AI-assisted coding interviews with a complete scheduling mock, edge-case tests, bounded prompts, patch review and clear tool-permission checks.
In an AI-assisted coding interview, the difficult part is often deciding what to trust. A plausible patch can violate an interval boundary, miss a duplicate or change a contract you never agreed to change. Prepare by solving a small problem yourself, then use the allowed assistant to accelerate a bounded part of the work and verify its output.
Use AI-assisted coding practice alongside the scheduling mock below. It supplies a complete contract, solution, tests and an editorial review rubric.
Permission comes before prompting
“AI-assisted” is not a universal permission to use any model in any way. The employer’s instructions and the platform’s enabled mode both apply. Ask which tools are allowed, what actions they may perform, whether prompts are visible and whether external tools are prohibited.
| Published example | What it establishes | What still needs confirmation |
|---|---|---|
| GitLab technical-assessment guidance | Transparent AI use can be welcome when you can explain prompts and decisions | The instructions for your particular exercise and live discussion |
| CoderPad AI Assist | Shared assistance includes Ask, Plan and Edit modes; availability and pad settings matter | Which mode and external tools the interviewer permits |
| HackerRank interviews | Guarded Coding and broader Code Repos/ADE have different capabilities | The actual question type, enabled tools and employer rules |
These are platform or employer examples, not evidence that every company has adopted the same interview. A familiar tool may also behave differently in an assessment. Practice in a constrained environment and remain able to explain the algorithm without its help.
A reproducible 50-minute mock: return available appointment slots
This is an original practice exercise for an interview that explicitly permits AI. It does not establish permission in another company’s assessment. Work in a small repository with a function and tests; keep a record of the assumptions you supplied, the suggestions you rejected and the tests you ran.
The function receives availability windows and booked intervals, measured in integer minutes. Return all fixed-duration appointment slots, aligned to each availability window’s start. Intervals are half-open: [start, end). A booking ending at 10 does not conflict with a slot starting at 10. Overlapping availability windows must not emit duplicate slots. A slot must be fully contained in its window and must not overlap any booking. Reject malformed ranges and nonpositive duration.
def available_slots(windows, bookings, duration):
if type(duration) is not int or duration <= 0:
raise ValueError("positive integer duration required")
def validate(ranges):
for start, end in ranges:
if type(start) is not int or type(end) is not int or start >= end:
raise ValueError("invalid interval")
validate(windows); validate(bookings)
slots = set()
for begin, end in windows:
start = begin
while start + duration <= end:
stop = start + duration
if all(stop <= b0 or start >= b1 for b0, b1 in bookings):
slots.add((start, stop))
start += duration
return sorted(slots)
assert available_slots([(0, 30)], [(10, 20)], 10) == [(0, 10), (20, 30)]
assert available_slots([(0, 20), (0, 20)], [], 10) == [(0, 10), (10, 20)]
assert available_slots([(0, 9)], [], 10) == []
assert available_slots([], [], 10) == []
assert available_slots([(0, 20)], [(0, 20)], 10) == []
try:
available_slots([(0, 20)], [], 0)
raise AssertionError("zero duration accepted")
except ValueError:
pass
This deliberately small baseline scans every booking for each candidate slot. With s generated candidates and b bookings, conflict checks cost O(s × b), followed by sorting u unique results in O(u log u); storage is O(u). State a maximum number of generated candidates. A billion-minute window and a one-minute duration is a resource problem even when the code is correct. You could merge bookings and scan sorted intervals for larger inputs, but first defend what your baseline promises.
Use the clock to produce reviewable evidence
| Minutes | Work | Artifact |
|---|---|---|
| 0–7 | Clarify alignment, boundaries, duplicates and input limits | Written contract |
| 7–15 | Ask for a plan and inspect its assumptions | One accepted plan and one rejected suggestion |
| 15–30 | Implement the smallest working baseline | Function and focused diff |
| 30–43 | Run boundary tests and repair a failure | Test command, actual result and corrected patch |
| 43–50 | Explain complexity and a changed requirement | Short handoff |
An AI suggestion to use stop < booking_start would incorrectly exclude an adjacent appointment. Your evidence is the (0, 10) slot beside the (10, 20) booking. Another suggestion might align every window to midnight; reject that unless the interviewer changes the requirement. The point is to inspect an assumption that can change the answer, not manufacture an AI mistake to sound skeptical.
For the follow-up, appointments can now begin every five minutes, while duration remains ten. Separate step size from duration, update candidate generation and add expected slots for a short window. Explain why changing the loop increment changes both output count and running time.
Score five editorial behaviors from 0 to 2: contract clarity, controlled assistance, correctness, verification and explanation. Zero means no evidence; one means partial evidence; two means an inspectable artifact that handles the relevant boundary. There is no claimed employer cutoff. If verification scores zero, repeat the mock with fewer prompts and more execution.
Which published policies support AI use?
Checked 8 October 2026. This is a scope table, not a universal list of companies that allow every AI tool.
| Source | What it establishes | What you still confirm |
|---|---|---|
| GitLab’s official AI interview policy | Transparent use is welcome in technical assessments; interviews require authentic answers | Stage, approved tool and data restrictions |
| CoderPad AI Tools documentation | Interviewers can enable/disable assistance; Ask, Plan and Edit have different capabilities | Your pad settings and employer instructions |
| HackerRank candidate documentation | Assistance depends on setup and question type; guarded and repository workflows differ | Your test/interview experience and enabled mode |
Candidate reports about an AI-enabled round are useful leads, not employer permission. Ask before the assessment which tools may be used, whether an external service may receive the task and what you must disclose. Use the answer to choose the mock conditions.
Review three tempting but incorrect scheduling patches
First, an assistant changes overlap to slot_start <= booked_end and booked_start <= slot_end. That looks cautious, but it violates the half-open contract. A booking ending at ten would block a slot beginning at ten. Use the adjacent-boundary test to reject it, and explain the requirement rather than saying the style is wrong.
Second, it removes the deduplication set because “windows do not overlap.” The prompt does not promise that. Two identical windows can produce repeated starts, and partially overlapping windows can produce the same aligned slot. A test with duplicate windows establishes the missing behavior. If a new prompt guarantees disjoint windows, removing the set may be reasonable; change the assumption explicitly.
Third, it sorts bookings and checks only the first one. Sorting is not enough to establish that the first record determines overlap for every proposed slot. A later booking can intersect a later slot. Ask for the invariant of an optimized traversal and add a fixture where a late booking is the only conflict. Do not accept a complexity improvement that has no correctness argument.
An optimization follow-up with a real contract
The baseline compares each candidate slot against the bookings. With many slots and bookings, discuss preprocessing: sort validated bookings and, if the contract permits, merge overlapping or adjacent occupied intervals. A sweep can advance through relevant occupied ranges instead of restarting the scan. Preserve the same half-open overlap rule and window-alignment behavior. Include the sorting work in the cost; preprocessing is not free.
If the interviewer changes the start increment from duration to a separate step, update the function signature and tests before changing the loop. A ten-unit slot advancing by five can overlap the preceding offered slot; that may be fine for options displayed to a user, but it does not mean both can be booked. Slot discovery and transactional reservation are separate operations.
For persistent booking, describe two clients selecting the same available slot. Both can pass a read-only availability check. The write path must enforce the accepted reservation contract in shared storage. A local interval function and a green suite do not prove concurrent booking safety.
Keep a short work record
Write four lines at the end of practice: the agreed contract, the assistant’s bounded task, the defect you caught and the checks you executed. Include one remaining assumption. For example: “Integer times share one zone; persistent concurrency is outside this function.” This record gives you something concrete to explain after the coding portion.
If the assistant fails, return to the smallest failing input. Make a prediction before editing and test that prediction. Repeatedly asking it to rewrite the whole solution can introduce new defects while hiding the original one. Keep the code small enough that you can inspect each change and finish the task within the permitted tools.
Build-from-scratch and repository work need different habits
For a new feature, settle the contract before asking for implementation. Name the input, output, invalid cases and the files allowed to change. For existing code, first trace the call path and run the current tests. Ask the assistant to explain a small area and verify that explanation against the code; an incorrect repository summary can send the entire attempt in the wrong direction.
Give bounded prompts. “Implement the overlap predicate for half-open intervals, preserving adjacent bookings” is easier to review than “build the scheduling system.” Ask for a test that would fail if the boundary were wrong. Read the diff yourself and reject unrelated changes.
Explain an AI-assisted result without claiming the assistant’s reasoning
Say which decision you made, what you delegated, what you checked and what you changed after checking. If the assistant suggested an inclusive overlap comparison and your adjacent-booking test failed, that is a useful account of engineering judgment. Do not describe a generated explanation as a test result unless you actually executed the check.
Use three follow-ups on the scheduling mock: How does the complexity change with many bookings? What changes when time zones enter the contract? Which assumption allows deduplication by slot start? The current model uses integer times in one agreed coordinate system and windows aligned to their own starts. A production calendar needs rules for zones, daylight-saving transitions and persistent concurrency; adding a string named timezone does not solve them.
For preparation, repeat the same task once without assistance, once with permitted assistance and once with a changed requirement. Keep the actual bug or assumption from each attempt. That record is more useful than a collection of long prompts with no verified output.
Can I ask for the whole solution?
Only if the assessment explicitly permits that behavior and the configured mode supports it. Even then, you must understand and verify the result. Guarded environments may intentionally provide concepts without a complete implementation.
Is using more prompts a stronger signal?
Not necessarily. A useful prompt resolves uncertainty or produces a bounded change. Unreviewed output and repeated large rewrites make the result harder to trust.
Sources and Further Reading
Editorial revision: 8 October 2026. Current hiring details remain role-specific; unavailable source pages and unverified timings are identified in the text.