BFS level-order traversal
Return the level-order traversal of a binary tree as a list of lists.
Design Front Middle Back Queue
Implement a data structure that supports push/pop at front, middle, and back of a queue.
Level Order Traversal
Implement a function that performs a level order traversal of a binary tree and returns node values as a list of lists.
Multiprocessing Queue
Implement a function that uses a multiprocessing queue to compute factorials of a list of numbers in parallel.
Zigzag Level Order Traversal
Implement a function that returns the zigzag level-order traversal of a binary tree.
Maximum Width of a Binary Tree
Given the root of a binary tree, compute its maximum width (the maximum number of nodes in any level, counting null positions).
A* Pathfinding Heuristic
Implement A* search on a 2D grid to find the shortest path length between two cells.
Open the Lock BFS
Implement a BFS solution to find the minimum number of turns needed to open a 4-wheel lock, avoiding a set of deadends.
Minimum Genetic Mutation
Implement a function to compute the minimum number of single-character mutations needed to transform one gene string into another, using a given bank of valid mutations.
Queue Reconstruction by Height
Given shuffled pairs of (height, number_of_taller_people_in_front), reconstruct the original queue order.
Kth Largest Element in an Array (Heap Edition)
Implement a function that returns the kth largest element in an unsorted integer array using a heap.
Task Scheduler Heap
Given a list of tasks and a cooldown, find the minimum number of CPU intervals needed to schedule all tasks without violating the cooldown.
Find K pairs with smallest sums
Given two sorted arrays and an integer k, return the k smallest pairs (u, v) with the smallest sums, sorted by sum.
Maximum Average Pass Ratio
Given class pass/total counts and extra students, maximize the average pass ratio by assigning extra students optimally.
Minimum Cost to Connect Sticks
Compute the minimum total cost to connect all sticks into one stick by repeatedly combining two sticks with the smallest lengths.
01 Matrix Nearest Zero
Given a binary matrix, return a matrix of the same shape where each cell contains the Manhattan distance to the nearest 0.
Rotting Oranges Time
Given a grid of fresh, rotten, and empty cells, compute the minimum minutes until all fresh oranges rot, or -1 if some are unreachable.
Showing 1–17 of 17 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
- 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.