Coding interview · Python and JavaScript

Coding interview practice that explains itself.

685 original problems grouped by the 20 patterns interviewers test. Write Python or JavaScript in the browser with a built-in terminal, then follow a step-by-step walkthrough from brute force to optimal.

Problems
685
Patterns
20
Easy
207
Medium
342
Hard
136

How it works

Pattern, practice, walkthrough

  1. Step 01

    Learn the pattern

    Each pattern starts with when to use it and the idea behind it, then problems from easy to hard.

  2. Step 02

    Code it in the browser

    Python or JavaScript, run against the examples in a built-in terminal, then submit against hidden tests.

  3. Step 03

    Read the walkthrough

    Clarifying questions, the brute force, the key insight, the optimal steps and a dry run, in that order.

The patterns

20 patterns, from hashing to dynamic programming

Most interview problems are a known pattern in disguise. Learn to spot it and the solution follows.

Try one

A sample problem

Free, and the same format as every problem in the bank.

EasyArrays & Hashing

Pair With Target Sum

You are given an array of integers nums and an integer target. Exactly one pair of different positions i and j holds values that add up to target.

Return the two indices as [i, j] with i < j.

Example 1

Input:
nums = [4, 9, 1, 6], target = 7
Output:
[2, 3]

nums[2] + nums[3] = 1 + 6 = 7.

Example 2

Input:
nums = [5, 5, 3], target = 10
Output:
[0, 1]

The two 5s sit at different positions, so they form a valid pair.

Free and Pro

Start with the easy ones, free

Free

The first three Easy problems of every pattern: 60 problems with the editor, the terminal, hints and the full walkthrough.

Pro

All 685 problems, every walkthrough and the reference solutions in Python and JavaScript. The same Pro plan also unlocks every certification exam.

See pricing

Your next interview is a pattern you can learn.

Start free