Practice Arena

Python Coding Challenges

Write real Python in the browser. Instant feedback. From beginner to expert.

467 challenges 330 easy 120 medium 17 hard
Data Structures & Algorithms medium

Graph DFS

Return all nodes reachable from a start node via DFS.

graph DFS recursion
+28 pts 25m
Data Structures & Algorithms medium

Path Sum II All Paths

Return all root-to-leaf paths where the sum of node values equals a target.

binary-tree dfs backtracking
+20 pts 25m
Data Structures & Algorithms medium

Reconstruct Itinerary

Given a list of airline tickets, reconstruct the itinerary in order using each ticket exactly once, choosing the lexicographically smallest path when multiple options exist.

graph backtracking dfs
+30 pts 25m
Trees & Binary Trees medium

Lowest Common Ancestor in a Binary Tree

Implement a function to find the lowest common ancestor (LCA) of two nodes in a binary tree.

binary-tree dfs recursion
+30 pts 30m
Trees & Binary Trees medium

Sum Root to Leaf Numbers

Given the root of a binary tree, compute the total sum of all root-to-leaf numbers.

binary-tree dfs recursion
+25 pts 25m
Trees & Binary Trees medium

Binary tree left side view

Given a binary tree, return the leftmost node's value at each depth, from top to bottom.

binary-tree levels bfs
+20 pts 20m
Graphs & Graph Algorithms medium

Articulation Points

Implement a function that returns the articulation points of an undirected graph.

graphs dfs bridges
+25 pts 30m
Graphs & Graph Algorithms medium

Bridges in Graph

Implement a function that returns all bridges in an undirected graph.

graph dfs bridges
+30 pts 30m
Graphs & Graph Algorithms medium

Hamiltonian Path Check

Implement a function that checks whether an undirected graph has a Hamiltonian path using DFS and backtracking.

graph dfs backtracking
+30 pts 30m
Graphs & Graph Algorithms medium

Course Schedule Can Finish

Given numCourses and prerequisites, return whether all courses can be finished without cyclic dependencies.

graph cycle topological
+25 pts 30m
Graphs & Graph Algorithms medium

Graph Valid Tree

Determine if n nodes and an edge list form a valid tree (connected and acyclic).

graph dfs bfs
+25 pts 30m
Graphs & Graph Algorithms medium

All Paths from Source to Target

Given a directed acyclic graph, return all paths from node 0 to the last node.

graph dfs backtracking
+25 pts 25m
Matrix & 2D Arrays medium

Number of Islands

Given a 2D grid of '1' (land) and '0' (water), count the number of islands surrounded by water.

matrix graph bfs
+25 pts 30m
Matrix & 2D Arrays medium

Max Area of Island

Given a 2D grid of 0s and 1s, find the maximum area of a connected group of 1s.

grid dfs connected-components
+20 pts 25m

Showing 14 challenges · medium

Guide: free Python coding challenges

Practice Python by solving problems

PythonSkillset challenges are hands-on coding exercises from beginner to advanced. Open a challenge, read the problem, write Python in the split-pane editor, and run tests with Pyodide — no install required.

How to use the arena

  1. Pick a category — basics, algorithms, strings, and more
  2. Open a challenge, read the statement, and edit the starter code
  3. Run tests, fix failures, then try a related quiz or tutorial lesson

Challenges vs tutorials and quizzes

Challenges test what you can build under constraints. For guided teaching, use our Python tutorials. For quick checks, try quizzes or copy snippets from code samples.