Practice Arena

Python Coding Challenges

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

467 challenges 330 easy 120 medium 17 hard
Strings & Text medium

Longest common prefix

Find the longest common prefix among a list of strings.

strings zip
+18 pts 18m
Lists & Arrays medium

Rotate array

Rotate a list right by k positions in place.

arrays in-place
+20 pts 18m
Lists & Arrays medium

Flatten nested list

Yield every integer from an arbitrarily nested list, depth-first.

recursion generators
+25 pts 22m
Lists & Arrays medium

Product of All Except Zeros Handling

Given a list of integers, return a list where each element is the product of all other elements, handling zeros correctly.

product arrays zero-handling
+20 pts 25m
Lists & Arrays medium

Partition around a pivot value

Implement an in-place partition of a list around a given pivot value, returning the boundary index.

lists partition two-pointer
+20 pts 20m
Lists & Arrays medium

Find Duplicate Number

Given a list of n+1 integers in the range 1..n, find the one integer that appears more than once.

arrays hash-set duplicates
+20 pts 25m
Lists & Arrays medium

Partition Array

Implement a function that finds a contiguous partition of a list into k groups, minimizing the maximum sum of the groups.

arrays partition contiguous
+25 pts 25m
Lists & Arrays medium

Two Missing Numbers

Given a list of n-2 unique integers from 1 to n, find the two missing numbers efficiently.

missing-numbers arrays math
+25 pts 25m
Lists & Arrays medium

Three Missing Numbers

Find the three missing numbers from a shuffled list containing all but three integers from 1 to n.

arrays sets missing
+15 pts 15m
OOP & Classes medium

Linked list reversal

Implement a singly linked list and a function to reverse it in place.

linked-list OOP pointers
+28 pts 25m
Data Structures & Algorithms medium

Quicksort

Implement quicksort and return a sorted list.

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

BFS level-order traversal

Return the level-order traversal of a binary tree as a list of lists.

BFS trees queues
+28 pts 25m
Data Structures & Algorithms medium

Count inversions lite

Implement a function that counts inversions in a list of numbers efficiently.

inversions sorting merge sort
+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

Heap Sort Implementation

Implement the heap sort algorithm to sort a list of comparable elements in non-decreasing order.

heap sorting in-place
+20 pts 25m
Data Structures & Algorithms medium

Radix Sort

Implement LSD radix sort to sort a list of non-negative integers in ascending order.

radix-sort sorting counting-sort
+25 pts 25m
Data Structures & Algorithms medium

Bucket Sort

Implement bucket sort to sort a list of floating-point numbers in the range [0,1).

sorting bucket-sort insertion-sort
+25 pts 30m
Data Structures & Algorithms medium

Redundant Connection

Given a list of edges forming a tree plus one extra edge, return the edge that appears last in the input and creates a cycle.

graphs union-find cycle-detection
+25 pts 25m
Data Structures & Algorithms medium

Reconstruct Itinerary

Given a list of airline tickets, reconstruct the itinerary in order using each ticket exactly once, choosing the lexicographically smallest path when multiple options exist.

graph backtracking dfs
+30 pts 25m
Dynamic Programming medium

Partition Equal Subset

Determine whether a given list of positive integers can be partitioned into two subsets with equal sum.

dynamic-programming subset-sum memoization
+30 pts 25m
Dynamic Programming medium

Target Sum Subsets

Write a function that counts the number of subsets of a list of positive integers that sum exactly to a target.

subset-sum dp counting
+25 pts 30m
Dynamic Programming medium

Longest Arithmetic Subsequence

Given a list of integers, return the length of the longest arithmetic subsequence (constant difference) within it.

dp subsequence hashmap
+30 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
Graphs & Graph Algorithms medium

Graph Valid Tree

Determine if n nodes and an edge list form a valid tree (connected and acyclic).

graph dfs bfs
+25 pts 30m
Recursion & Backtracking medium

Combination Generator

Write a recursive function that returns all combinations of length k from a list of distinct integers.

recursion backtracking combinations
+25 pts 25m
Binary Search medium

Interpolation Search

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

search sorted-array binary-search
+25 pts 25m

Showing 27 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.