📊 Save 30% on Corporate Finance Institute with code AFF30. FMVA, financial modeling & more. Claim the deal →
How to crack a coding interview

How to Crack a Coding Interview (2026): Stages, Patterns and a 6-Week Plan

Last updated: September 2026. Written by Josh Hutcheson, OnlineCourseing editor. Interview formats, courses and books re-checked at the source on 21 September 2026. See our review methodology.

Josh Hutcheson

By Josh Hutcheson · E-Learning Specialist

Reviewing online learning platforms since 2019. Review methodology

THE SHORT ANSWER

Bottom line: coding interviews reward pattern recognition and clear thinking out loud, not the number of problems you have memorised. Learn the dozen or so common problem patterns, practise medium problems under a timer while explaining your reasoning, use the same problem-solving routine in every interview, and prepare separately for the behavioural and, if you are experienced, system design rounds.

  • Time needed: about 6–8 weeks at 8–12 hours a week if you already program.
  • Core skill: spotting which pattern a new problem needs.
  • In the room: clarify, give a brute-force answer, improve it, code it, test it.
  • New in 2026: some companies are piloting rounds where an AI assistant is allowed. Never assume it is.

Compare coding interview courses →

What the coding interview process looks like

Before you commit $300+ to a bootcamp, read this.

I've reviewed ZTM, Codecademy Pro, Springboard, and a dozen others. Get my Tuesday picks — plus reader-only codes when they drop.

No spam. Unsubscribe anytime.

Formats vary by company and level, but most software engineering hiring at larger tech companies follows a similar path. Knowing what each stage tests tells you what to practise.

Stage What it tests Typical format How to prepare
Recruiter screen Fit, experience, logistics, salary expectations 20–30 min call A 60-second summary of your background; know why you want the role
Online assessment Correct, efficient code 1–3 problems on a timed platform Timed practice on easy and medium problems
Technical phone screen Problem solving and communication 45–60 min, shared editor, 1–2 problems Solve out loud; the routine below
Onsite or virtual loop Coding depth, design, collaboration Several 45–60 min rounds Coding rounds, plus system design and behavioural
System design (mid-level and up) Architecture and trade-offs Design a service on a whiteboard Study common designs and their trade-offs
Behavioural How you work with people and handle problems Questions about past situations Prepared stories in STAR format

Step 1: Know exactly what you are preparing for

Ask the recruiter how many rounds there are, what each one covers, which languages are allowed, and whether any round permits AI tools. The answers change your plan: a new graduate at a large company needs heavy algorithm practice, while a senior engineer may face more design and behavioural rounds than coding. Companies also publish what they value. Amazon, for example, lists the Leadership Principles it uses in interviews, and its behavioural questions map directly to them.

Step 2: Learn the patterns, not hundreds of problems

Most interview problems are variations on a small number of techniques. Once you can recognise the pattern, an unfamiliar problem stops being unfamiliar. The ones worth knowing well:

Pattern Use it when the problem involves…
Hash maps and sets Counting, lookups, finding pairs or duplicates
Two pointers Sorted arrays, pairs that meet a condition, reversing
Sliding window The best contiguous subarray or substring
Binary search Sorted data, or searching over a range of possible answers
Stacks and queues Matching brackets, next-greater elements, order of processing
Trees and graphs (BFS, DFS) Hierarchies, connections, shortest paths, islands in a grid
Heaps The top or smallest k items, merging sorted lists
Backtracking Generating all combinations, permutations or valid arrangements
Dynamic programming Overlapping subproblems: counting ways, best cost, longest sequence

Work through problems grouped by pattern first, then switch to mixed sets so you practise choosing the pattern yourself. Our guide to the best data structures and algorithms courses covers where to learn the underlying concepts if they are new to you.

Step 3: Practise the way you will be tested

  • Use a timer. Give yourself about 30–40 minutes for a medium problem, as in a real round.
  • Talk out loud while you solve, even alone. Explaining your thinking is a separate skill and it is graded.
  • Write code without autocomplete in a plain editor, since many interview tools have little help.
  • Do mock interviews with a friend or a mock-interview service before the real thing. The first time you solve a problem in front of someone should not be the interview.
  • Review every problem you miss. Note the pattern you failed to see and redo the problem a few days later.

Step 4: Use the same routine in every interview

  1. Clarify. Restate the problem and ask about input size, edge cases and whether the input can be empty or contain duplicates.
  2. Work an example. Walk through a small input by hand to check you understand what is asked.
  3. State a brute-force solution and its time and space complexity, even if it is slow.
  4. Improve it. Look for the pattern that removes repeated work, and explain the trade-off.
  5. Code it cleanly, with sensible names, narrating as you go.
  6. Test it on your example and on edge cases, and fix bugs out loud.
  7. Finish with complexity and any further improvements you would make with more time.

The routine keeps you moving when you are nervous and shows the interviewer how you think, which is much of what they are scoring.

Step 5: Prepare for system design if you have experience

Mid-level and senior candidates usually face a system design round: design a URL shortener, a chat service or a news feed, then discuss scaling, storage, caching and failure. There is no single right answer; interviewers look for structured thinking and sensible trade-offs. Our guides to system design courses and the Grokking the System Design Interview review cover where to learn it.

Step 6: Do not skip the behavioural round

Strong coders are regularly rejected on behavioural rounds. Prepare six to eight real stories from your work or projects (a conflict, a mistake, a deadline, a time you led something, a hard technical problem) and tell each in STAR form: situation, task, action, result. Keep the focus on what you did and on a measurable result, and map your stories to the values the company publishes.

AI in coding interviews: what is changing

A few large employers have started testing interview rounds where AI is allowed. According to interviewing.io, Meta began piloting an AI-enabled coding interview in October 2025 that replaces one of the two onsite coding rounds: a 60-minute session in CoderPad with an AI assistant built in (interviewing.io). Google is piloting a code-comprehension round for early and mid-career roles on select US teams, with its Gemini model available as an assistant, according to an internal document reported by Business Insider (Entrepreneur, May 2026).

Two practical points follow. First, in these rounds interviewers judge how you use the assistant (how you prompt it, check its output and debug), so practise solving problems with an AI tool and verifying what it produces. Second, these are pilots: in the vast majority of interviews, using AI is treated as cheating and can end your candidacy. Ask the recruiter about each round, and keep practising without assistance.

A six-week preparation plan

Week Focus Goal by the end of the week
1 Refresh fundamentals: arrays, strings, hash maps, complexity Solve easy problems comfortably in your chosen language
2 Two pointers, sliding window, binary search Recognise each pattern from the problem statement
3 Stacks, queues, linked lists, heaps Medium problems in these areas in under 40 minutes
4 Trees and graphs (BFS, DFS) Traverse and search confidently; grid problems
5 Dynamic programming and backtracking Solve classic DP problems and explain the recurrence
6 Mixed practice, mock interviews, behavioural stories Two timed mocks; six to eight STAR stories ready

Add a week or two on system design in parallel if you are applying for mid-level or senior roles.

Resources worth your time

You can prepare well for free, and paid resources mainly save time by giving you structure.

  • LeetCode is the standard practice platform and much of it is free. Our guide to whether LeetCode is free explains what Premium adds.
  • Cracking the Coding Interview by Gayle Laakmann McDowell (6th edition, 150 questions with solutions, per the author’s site) remains the classic foundation. Its official sequel, Beyond Cracking the Coding Interview (McDowell, Mroczka, Lerner and Mamano, January 2025), adds newer topics and more than 150 new problems (announcement).
  • Zero To Mastery’s Master the Coding Interview: Data Structures + Algorithms by Andrei Neagoie is a structured video course: 21 hours and 270+ lessons covering data structures, algorithms and the interview process, updated in September 2026. Best if you want a guided path rather than a problem list.
  • Educative’s Grokking the Coding Interview Patterns teaches 28 problem patterns in a text-based, interactive format with 17 mock interviews. Best if you learn faster by reading than by watching. Our Grokking the Coding Interview review covers price and value.

See ZTM’s Master the Coding Interview course →

For a ranked comparison of every paid option, see our guide to the best coding interview courses.

Common mistakes that cost offers

  • Starting to code before understanding the problem or asking a single question.
  • Going silent for minutes at a time; the interviewer cannot score thinking they cannot hear.
  • Memorising solutions instead of patterns, then freezing on a small variation.
  • Skipping testing, so an easy bug looks like a gap in understanding.
  • Treating the behavioural round as a formality.
  • Practising only easy problems, then meeting mediums for the first time in the interview.

Frequently asked questions

How long does it take to prepare for a coding interview?

Six to eight weeks of steady practice is a realistic plan for most people who already program, at around 8 to 12 hours a week. Allow longer if data structures and algorithms are new to you, and less if you are refreshing skills you used recently. Consistency matters more than total hours.

How many LeetCode problems should I solve?

There is no magic number. A few hundred problems chosen to cover the common patterns will prepare you better than a thousand random ones. Aim to recognise which pattern a new problem needs, and to solve medium-difficulty problems in about 30 to 40 minutes while explaining your thinking.

Which programming language should I use in a coding interview?

Use the language you know best, as long as the company allows it. Python is popular because it is concise, but fluency matters more than the language: you should be able to write loops, use its built-in data structures and sort without looking anything up.

What if I cannot solve the problem in the interview?

Keep talking and keep making progress. Interviewers grade how you reason as well as whether you finish: state a brute-force solution, explain its complexity, try to improve it, and test what you have. A clear partial solution often scores better than a silent attempt at the perfect one.

Can I use AI tools in a coding interview?

Only when the company explicitly allows it. Some employers are piloting interview rounds with a built-in AI assistant, such as Meta’s AI-enabled coding round and a Google pilot using Gemini, but in most interviews using AI is treated as cheating. Ask the recruiter what is allowed for each round.

Do I need system design for a coding interview?

For entry-level roles, usually not. For mid-level and senior roles, system design is normally its own round, where you design a service such as a URL shortener or a news feed and discuss trade-offs. Start preparing for it early if you have a few years of experience.

Is Cracking the Coding Interview still worth reading?

Yes, as a foundation. The 6th edition covers 150 questions with solutions and explains how interviews work. Its official sequel, Beyond Cracking the Coding Interview, published in January 2025, adds newer topics such as sliding windows and more than 150 new problems.

The verdict

Cracking a coding interview is a trainable skill. Spend six to eight weeks learning the common patterns, practise medium problems under a timer while talking through your reasoning, use the same routine in every round, and prepare real stories for the behavioural interview. Check with each company whether any round allows AI, and practise both with and without it. Structured courses save time, but steady, deliberate practice is what gets the offer.

See the best coding interview courses →

Related guides: Best coding interview courses · Grokking the Coding Interview review · Is LeetCode free? · Data structures and algorithms courses · System design courses · Data science interview prep · How to write a resume