Practice Arena

Python Coding Challenges

Write real Python in the browser. Instant feedback. From beginner to expert.

577 challenges 370 easy 180 medium 27 hard
Lists & Arrays medium

Merge intervals

Merge all overlapping intervals and return a sorted result.

intervals sort
+30 pts 26m
Data Structures & Algorithms medium

Quicksort

Implement quicksort and return a sorted list.

sorting recursion divide-and-conquer
+25 pts 25m
Data Structures & Algorithms medium

Longest Consecutive Sequence

Given an unsorted list of integers, find the length of the longest consecutive elements sequence in O(n) time.

hash set array linear
+20 pts 20m
Data Structures & Algorithms medium

Merge Sort

Implement merge_sort(numbers) that returns a sorted copy of the input list using the merge sort algorithm.

sorting recursion divide-and-conquer
+30 pts 30m
Data Structures & Algorithms medium

K Closest Elements

Implement a function to return the k closest elements to a target in a sorted array.

arrays binary-search sorting
+25 pts 25m
Graphs & Graph Algorithms medium

Alien Dictionary Order

Given a sorted list of words in an alien language, derive the order of its unique letters.

graph topological-sort string
+30 pts 30m
Binary Search medium

Search in Rotated Array

Implement an efficient search in a rotated sorted array using modified binary search.

binary-search arrays search
+20 pts 20m
Binary Search medium

Interpolation Search

Implement interpolation search in Python on a sorted list of integers.

search sorted-array binary-search
+25 pts 25m
Binary Search medium

Find Minimum in Rotated Sorted Array

Implement a function that finds the minimum element in a rotated sorted array of distinct integers in O(log n) time.

binary-search arrays rotation
+25 pts 30m
Binary Search medium

Single Element in Sorted Array

Given a sorted array where every element appears exactly twice except one which appears once, return the single element.

binary-search array xor
+20 pts 25m
Binary Search medium

Rotated Array Search II

Implement a function to search for a target in a rotated sorted array with possible duplicates.

binary-search array search
+20 pts 20m
Two Pointers & Sliding Window medium

Interval List Intersections

Given two lists of sorted, disjoint intervals, return the list of intersections between them.

two-pointers intervals merging
+20 pts 20m
Stacks & Queues medium

Buildings with ocean view

Given building heights, return sorted indices of buildings that have a clear view of the ocean to their right.

stack monotonic-stack arrays
+20 pts 20m
Heaps & Priority Queues medium

Kth Largest Element in an Array (Heap Edition)

Implement a function that returns the kth largest element in an unsorted integer array using a heap.

heap priority-queue array
+20 pts 25m
Heaps & Priority Queues medium

Find K pairs with smallest sums

Given two sorted arrays and an integer k, return the k smallest pairs (u, v) with the smallest sums, sorted by sum.

heap priority queue two-sum
+25 pts 30m

Showing 15 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

  1. Pick a category — basics, algorithms, strings, and more
  2. Open a challenge, read the statement, and edit the starter code
  3. 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.