Delete Middle Node
Implement a function that deletes a given non-tail node from a singly linked list in O(1) time.
Design Browser History
Implement a BrowserHistory class that supports visit, back, and forward navigation with step counts.
Design Skip List Lite
Implement a simplified skip list supporting insert, search, and delete with O(log n) average complexity.
Delete duplicates sorted II
Given a sorted list, remove duplicates in place so each element appears at most twice, returning the new length.
Arithmetic Slices Count
Given a list of integers, count how many contiguous subarrays of length at least 3 form an arithmetic sequence.
Accounts Merge
Given a list of accounts, merge those that share any email and return sorted accounts.
Strobogrammatic number II
Given a positive integer n, return all strobogrammatic numbers of length n in ascending order.
Context manager timer
Implement a Timer context manager that records elapsed seconds.
Retry decorator
Implement @retry(times=3) that retries a function on exception.
2D Vector dataclass
Implement a Vector2D dataclass with +, -, scalar *, dot product, and magnitude.
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.
Metaclass Registry
Implement a metaclass that automatically registers every subclass in a class-level registry.
Context Variable Scope
Implement a context manager that temporarily changes a global variable and restores it afterwards, even if an exception occurs.
Descriptor Property
Create a descriptor class that ensures attribute values are positive integers.
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.
Cached Property Manual
Implement a decorator that turns a method into a lazy cached attribute per instance.
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.
Temporary directory manager
Implement a context manager that creates a temporary directory and automatically removes it even on errors.
Showing 73–96 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.