Count Pairs with Sum
Implement a function that counts the number of distinct pairs in a list summing to a target.
Hash map merge
Write a function that merges two dictionaries recursively, combining values and preserving structure.
Group by Department
Implement a function that groups a list of employee dictionaries by department, returning a dictionary keyed by department with lists of employee dictionaries.
Revenue by Month
Write a function that groups a list of (date, amount) pairs by year-month and returns total revenue per month as a sorted dictionary.
Pivot sales by product
Write a function that pivots sales records into a dictionary keyed by product with monthly totals.
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)).
Curry a function
Auto-curry any multi-argument function so it returns partial applications until fully saturated.
Bind First Argument
Implement bind_first_arg, a decorator that fixes the first argument of any function.
Linked list reversal
Implement a singly linked list and a function to reverse it in place.
Event emitter basics
Implement an EventEmitter class with subscribe/emit/unsubscribe functionality.
Reentrant Lock Manager
Implement a ReentrantLock class with acquire, release, locked, owner, and helper functions that test thread-safety with real threads.
LRU cache decorator
Implement @lru_cache(maxsize=N) for unary functions using OrderedDict.
Index of peak element
Implement a function that returns the index of any peak element in a given integer array.
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.
Peak Element in Array
Implement a function that returns the index of any peak element in a list of integers.
K Closest Elements
Implement a function to return the k closest elements to a target in a sorted array.
Merge Two Sorted Lists
Write a function that merges two sorted lists into a single sorted list.
Argsort Indices
Implement a function that returns the indices that would sort a list of integers, with ties broken by original order.
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.
Lowest Common Ancestor in a Binary Search Tree
Implement a function to find the lowest common ancestor of two node values in a binary search tree.
N-Queens Solutions
Implement a function to count the number of distinct ways to place n queens on an n×n board.
Merge K Sorted Lists
Write a function that merges multiple sorted lists into a single sorted list.
Showing 169–192 of 365 challenges
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.