Basic Calculator
Implement a function that evaluates a simple arithmetic expression with +, -, *, / and parentheses.
Simplify Path
Implement a function that simplifies a Unix-style absolute file path to its canonical form.
Change directory manager
Implement a function that processes `cd` commands and returns the resulting absolute path.
Partition Array
Implement a function that finds a contiguous partition of a list into k groups, minimizing the maximum sum of the groups.
Convolve 1D Signal
Write a function that computes the 1D convolution of two lists in 'full' mode.
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.
K Closest Elements
Implement a function to return the k closest elements to a target in a sorted array.
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.
Delete Middle Node
Implement a function that deletes a given non-tail node from a singly linked list in O(1) time.
Retry decorator
Implement @retry(times=3) that retries a function on exception.
Multiprocessing Queue
Implement a function that uses a multiprocessing queue to compute factorials of a list of numbers in parallel.
TypeVar bounded generic
Learn to use TypeVar with bounds to write type-safe generic functions in Python.
Prime Sieve Generator
Implement a generator function that yields prime numbers from 2 up to a specified limit, using an efficient sieve approach.
Cartesian Product Generator
Implement a generator function that yields the Cartesian product of multiple input iterables without precomputing all results.
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.
Showing 1–24 of 73 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.