Find Peak Element
Implement a function that returns the index of any peak element in an integer array.
Longest Consecutive Sequence
Given an unsorted list of integers, find the length of the longest consecutive elements sequence in O(n) time.
Merge Sort
Implement merge_sort(numbers) that returns a sorted copy of the input list using the merge sort algorithm.
Heap Sort Implementation
Implement the heap sort algorithm to sort a list of comparable elements in non-decreasing order.
Radix Sort
Implement LSD radix sort to sort a list of non-negative integers in ascending order.
Bucket Sort
Implement bucket sort to sort a list of floating-point numbers in the range [0,1).
Decode Ways
Count the number of ways to decode a numeric string into letters using the mapping A=1 to Z=26.
Path Sum II All Paths
Return all root-to-leaf paths where the sum of node values equals a target.
Redundant Connection
Given a list of edges forming a tree plus one extra edge, return the edge that appears last in the input and creates a cycle.
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.
Shortest Path in Binary Matrix
Implement BFS to find the shortest path length from (0,0) to (n-1,n-1) in an n x n binary matrix, moving through 0 cells in 8 directions.
K Closest Elements
Implement a function to return the k closest elements to a target in a sorted array.
Next greater element II
For each element in a circular array, find the next greater element (NGE) to its right, wrapping around.
Basic Calculator II
Evaluate a basic arithmetic expression with +, -, *, / following operator precedence.
Design Front Middle Back Queue
Implement a data structure that supports push/pop at front, middle, and back of a queue.
Online Stock Span
Implement StockSpanner.next(price) that returns the maximum number of consecutive days (including today) with price <= current price.
Trie Insert and Search
Implement a Trie and a scenario runner that executes insert/search/prefix operations.
Flood Fill Algorithm
Implement flood fill on a 2D grid using BFS/DFS.
Eulerian Path Check
Given the number of vertices and an edge list of an undirected graph, decide if it has an Eulerian path.
AST Visitor Lite
Implement a depth-first traversal of a simplified AST and return identifier names in order.
Merge time intervals
Given a list of time intervals, merge all overlapping intervals and return the merged intervals.
Top N per group
Implement top_n_per_group that returns the top N scores for each group from a list of (group, score) pairs.
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.
Matchsticks to Square
Given a list of matchstick lengths, decide if they can form a square by using each matchstick exactly once.
Showing 49–72 of 323 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.