Graph DFS
Return all nodes reachable from a start node via DFS.
Employee Hierarchy
Build an employee hierarchy tree and compute the total number of direct and indirect reports for each employee.
Path Sum II All Paths
Return all root-to-leaf paths where the sum of node values equals a target.
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.
Flood Fill Algorithm
Implement flood fill on a 2D grid using BFS/DFS.
Matchsticks to Square
Given a list of matchstick lengths, decide if they can form a square by using each matchstick exactly once.
Knight Tour Count
Implement a backtracking search to count all ways a knight can visit every cell on a 5x5 board exactly once starting from (0,0).
Graph DFS Generator
Implement a generator function that performs a depth-first traversal of a graph without recursion.
Preorder Traversal
Implement a function that returns the preorder traversal values of a binary tree.
Lowest Common Ancestor in a Binary Tree
Implement a function to find the lowest common ancestor (LCA) of two nodes in a binary tree.
Sum Root to Leaf Numbers
Given the root of a binary tree, compute the total sum of all root-to-leaf numbers.
Binary tree left side view
Given a binary tree, return the leftmost node's value at each depth, from top to bottom.
Cycle Detection in a Directed Graph
Use DFS with a recursion stack to detect cycles in a directed graph.
Cycle Detection in Undirected Graph
Write a function that detects if an undirected graph contains a cycle.
Articulation Points
Implement a function that returns the articulation points of an undirected graph.
Bridges in Graph
Implement a function that returns all bridges in an undirected graph.
Hamiltonian Path Check
Implement a function that checks whether an undirected graph has a Hamiltonian path using DFS and backtracking.
Course Schedule Can Finish
Given numCourses and prerequisites, return whether all courses can be finished without cyclic dependencies.
Graph Valid Tree
Determine if n nodes and an edge list form a valid tree (connected and acyclic).
All Paths from Source to Target
Given a directed acyclic graph, return all paths from node 0 to the last node.
Keys and Rooms
A classic graph traversal challenge: check if all rooms are reachable from room 0 using keys found in visited rooms.
Topological Sort via DFS
Return a deterministic topological ordering of nodes in a directed acyclic graph using DFS, or an empty list if a cycle exists.
Strongly Connected Components (Kosaraju's Algorithm)
Implement a function to find strongly connected components in a directed graph using Kosaraju's algorithm.
Surrounded Regions
Given an M×N grid of 'X' and 'O', capture all regions of 'O' that are completely surrounded by 'X'.
Showing 1–24 of 34 challenges
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
- Pick a category — basics, algorithms, strings, and more
- Open a challenge, read the statement, and edit the starter code
- 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.