ntree.ai

Prepare for your coding interviewwith genuinely better tools

  • Visualise your code line by line with an actual debugger
  • Understand algorithms with animated illustrations
  • Check your solution against every test case
0:00 / —

Visualise your code line by line

This is an actual debugger, it runs your code and shows deterministic results. It draws variables, stack frames, objects and pointers, and identifies common data structures like arrays, hash tables, stacks, queues, linked lists, trees, graphs, etc.

Two Sum

Given an array of integers nums and an integer target, return the indexes of the two numbers that add up to target.

def twoSum(nums: list[int], target: int) -> list[int]:
seen = {}
for i, n in enumerate(nums):
if target - n in seen:
return [seen[target - n], i]
seen[n] = i
raise ValueError('no answer')
Two Sum
1 / 16

Being able to explain how your code runs is an important signal in a real interview.

Every approach, explained and drawn

Each problem comes with worked solutions: the intuition behind an approach, the algorithm step by step, an animated illustration of it running, and the code.

1 → 2 → 3 → 2 → 1 slowfastleftright
move slow 1 step, fast 2 steps
1 / 8

Palindrome Linked List

Given the head of a singly linked list, return true if the values read the same forwards and backwards.

Implement
[1, 3]
[2, 6]
[8, 10]
[15, 18]
merged
05101520
take [1, 3]
1 / 5

Merge Intervals

Given an array of intervals where intervals[i] = [start, end], return a new array with overlapping intervals merged.

Implement
012345
lo hi
area = 5 * 2 = 10, largest_area = 10
1 / 6

Container With Most Water

You are given an integer array lines, where each element is the height of a vertical line standing at that index. Two lines and the axis between them form a container. Find the two lines that form the largest container and return its area.

Implement
1
1
0
0
1
0
0
1
0
0
1
1
0
0
1
0
land, size = 1
1 / 40

Largest Island

You are given an m x n matrix grid of 0s and 1s, where 1 is land and 0 is water. Land cells joined horizontally or vertically form an island. Return the number of land cells in the largest island, or 0 if there is no land.

Implement

Free to start

All the features are free to use with daily updated limits.

Free

$0

  • Access to all problems
  • Access to all studies
  • 5 code visualisations per day
Start free
Unlimited visualisations

Pro

$20/month

VAT included.

  • Access to all problems
  • Access to all studies
  • Unlimited code visualisations

Common questions

Do I need to sign in to try?

No. You can explore problems and studies and run the code, without signing in. An account is needed only to use the visualisation tool.

What languages are supported?

Python, JavaScript and Java today, and we are working on adding more. Let us know if you need another language supported.

Pick a problem and watch your code run