Practice Arena

Python Coding Challenges

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

925 challenges 556 easy 323 medium 46 hard
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 easy

Shell Sort

Implement Shell sort, an in-place comparison sort that generalizes insertion sort, using a gap sequence that shrinks by half each pass.

sorting shell-sort in-place
+10 pts 15m
Data Structures & Algorithms easy

Exponential Search

Implement exponential search to find any valid index of a target in a sorted list.

searching sorted-array algorithms
+10 pts 15m
Data Structures & Algorithms medium

Decode Ways

Count the number of ways to decode a numeric string into letters using the mapping A=1 to Z=26.

dynamic programming strings counting
+20 pts 25m
Data Structures & Algorithms medium

Path Sum II All Paths

Return all root-to-leaf paths where the sum of node values equals a target.

binary-tree dfs backtracking
+20 pts 25m
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
Data Structures & Algorithms medium

Shortest Path in Binary Matrix

Implement BFS to find the shortest path length from (0,0) to (n-1,n-1) in an n x n binary matrix, moving through 0 cells in 8 directions.

bfs grid shortest-path
+30 pts 30m
Data Structures & Algorithms easy

Find Peak Index

Given a list of integers, return the index of any peak element where the value is not smaller than its neighbors.

arrays linear-scan peak
+10 pts 15m
Data Structures & Algorithms easy

Peak Element in Array

Implement a function that returns the index of any peak element in a list of integers.

array search indices
+10 pts 15m
Data Structures & Algorithms hard

Count of Range Sum

Count contiguous subarrays whose sum lies in a given inclusive range using an efficient divide-and-conquer algorithm.

prefix-sum merge-sort divide-conquer
+35 pts 40m
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
Data Structures & Algorithms medium

Next greater element II

For each element in a circular array, find the next greater element (NGE) to its right, wrapping around.

arrays stack monotonic stack
+20 pts 20m
Data Structures & Algorithms hard

Largest Rectangle in Histogram

Given an array of bar heights, compute the largest rectangle that can be formed by consecutive bars.

histogram stack maximum-area
+40 pts 35m
Data Structures & Algorithms medium

Basic Calculator II

Evaluate a basic arithmetic expression with +, -, *, / following operator precedence.

string stack arithmetic
+25 pts 30m
Data Structures & Algorithms medium

Design Front Middle Back Queue

Implement a data structure that supports push/pop at front, middle, and back of a queue.

queue deque data-structures
+25 pts 30m
Data Structures & Algorithms medium

Online Stock Span

Implement StockSpanner.next(price) that returns the maximum number of consecutive days (including today) with price <= current price.

stack monotonic-stack stock-span
+20 pts 25m
Data Structures & Algorithms easy

Merge Two Sorted Lists

Write a function that merges two sorted lists into a single sorted list.

merge sorting lists
+10 pts 15m
Data Structures & Algorithms medium

Trie Insert and Search

Implement a Trie and a scenario runner that executes insert/search/prefix operations.

trie insert search
+25 pts 25m
Data Structures & Algorithms easy

Jump Search

Implement the jump search algorithm to locate a target in a sorted list, returning its index or -1.

search sorted list
+10 pts 15m
Data Structures & Algorithms medium

Flood Fill Algorithm

Implement flood fill on a 2D grid using BFS/DFS.

grid bfs dfs
+20 pts 25m
Data Structures & Algorithms medium

Eulerian Path Check

Given the number of vertices and an edge list of an undirected graph, decide if it has an Eulerian path.

graph eulerian degree
+25 pts 25m
Data Structures & Algorithms medium

AST Visitor Lite

Implement a depth-first traversal of a simplified AST and return identifier names in order.

trees traversal ast
+20 pts 20m

Showing 25–48 of 69 challenges · Data Structures & Algorithms

Data Structures & Algorithms — Python coding challenges

What you will find here

This page lists data structures & algorithms challenges — real Python problems you solve in the browser IDE with instant test feedback. Each challenge includes a clear brief, starter code, and automated checks.

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.