Partition Array
Implement a function that finds a contiguous partition of a list into k groups, minimizing the maximum sum of the groups.
Hash map merge
Write a function that merges two dictionaries recursively, combining values and preserving structure.
Memoize decorator
Implement a @memoize decorator that caches results of a function.
Function composition
Return a function that applies f after g: compose(f, g)(x) == f(g(x)).
Linked list reversal
Implement a singly linked list and a function to reverse it in place.
Reentrant Lock Manager
Implement a ReentrantLock class with acquire, release, locked, owner, and helper functions that test thread-safety with real threads.
Count inversions lite
Implement a function that counts inversions in a list of numbers efficiently.
Find Peak Element
Implement a function that returns the index of any peak element in an integer array.
Retry decorator
Implement @retry(times=3) that retries a function on exception.
Prime Sieve Generator
Implement a generator function that yields prime numbers from 2 up to a specified limit, using an efficient sieve approach.
Memoize with TTL
Implement a decorator that caches function results for a limited time, returning cached values within the TTL and recomputing after expiry.
LRU Memoize
Implement an LRU memoization decorator that caches results for a fixed number of arguments.
Rate Limit Decorator
Implement a decorator that enforces a maximum number of calls per second for any function.
Cache result decorator
Create a decorator that stores results of function calls keyed by positional arguments.
Profile time decorator
Create a decorator that tracks how many times a function is called and its cumulative execution time.
Validate Email Regex
Implement a function that validates email addresses using regex with specific rules.
Match Credit Card Pattern
Write a function that validates a credit card number string against a set of formatting rules.
Smith Number Check
Write a function to check if a number is a Smith number by comparing digit sums of the number and its prime factorization.
Bit Mask Permissions
Implement helper functions to compose bit masks and check permission bits using bitwise operators.
Bell number
Implement a function to compute the Bell number B(n) using dynamic programming.
Target Sum Subsets
Write a function that counts the number of subsets of a list of positive integers that sum exactly to a target.
Word Break DP
Implement a function to check if a string can be segmented into space-separated dictionary words.
Lowest Common Ancestor in a Binary Tree
Implement a function to find the lowest common ancestor (LCA) of two nodes in a binary tree.
Delete Node in BST
Implement a function that deletes a key from a binary search tree and returns the new root.
Trim BST to range
Implement a function to trim a BST to only retain nodes with values in a given inclusive range.
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.
Bipartite Graph Check
Implement a function to check if an undirected graph is bipartite using graph coloring.
Cheapest Flights Within K Stops
Implement a function to compute the cheapest flight price from source to destination with at most K stops in a directed weighted graph.
Combination Generator
Write a recursive function that returns all combinations of length k from a list of distinct integers.
Ternary Search
Implement ternary search to locate the maximum of a discrete unimodal function.
Showing 32 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.