Sort List Merge Sort
Write a function that sorts a list of integers using the merge sort algorithm.
Insertion Sort
Implement insertion sort that sorts a list in-place and returns the same list.
One Hot Encode Labels
Given a list of categorical labels, return a list of one-hot encoded vectors based on the sort order of unique labels.
List intersection
Return the sorted list of elements common to both lists.
Group anagrams
Group words that are anagrams of each other.
Keys Sorted by Value Descending
Given a dictionary mapping strings to integers, return a list of keys sorted by value descending, and when values tie, alphabetically ascending.
Anagram Dictionary Groups Lite
Group a list of words into anagrams using a dictionary keyed by sorted characters.
Common Keys of Two Dictionaries
Implement a function that finds keys shared by two dictionaries and returns them sorted.
Union of Many Sets
Implement a function that takes any number of sets and returns a sorted list of their union.
Top k keys by count
Given a dictionary mapping keys to counts, return the top k keys with the highest counts, breaking ties alphabetically.
Anagram Groups by Size
Group a list of words into anagram groups and return them sorted by group size and lexicographically.
Top K Frequent Words
Given a list of words, return the k most frequent words sorted by frequency (descending) and then alphabetically.
Sort by frequency
Sort a list by element frequency descending, with ties broken by order of first occurrence.
Symmetric Difference
Write a function that computes the symmetric difference of two lists, returning a sorted list of unique elements.
Frequency sort descending
Write a function that sorts a list by frequency descending while preserving original order for ties.
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.
Design Twitter Feed
Implement a Twitter class with postTweet, getNewsFeed, follow, and unfollow methods.
Binary search
Return the index of target in a sorted list, or -1 if not present.
Quicksort
Implement quicksort and return a sorted list.
Topological sort (Kahn)
Return a valid topological ordering of tasks, or [] if a cycle exists.
Count inversions lite
Implement a function that counts inversions in a list of numbers efficiently.
Longest Consecutive Sequence
Given an unsorted list of integers, find the length of the longest consecutive elements sequence in O(n) time.
Median of Two Sorted Arrays
Given two sorted arrays, return the median of the combined sorted array in O(log(min(n,m))) time.
Bubble Sort
Implement bubble sort that sorts a list of numbers in ascending order.
Showing 25–48 of 118 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.