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
Two Pointers & Sliding Window easy

Two Sum Sorted

Given a 1-indexed sorted array and a target, return the two indices that add up to the target.

two-pointers sorted-array array
+10 pts 15m
Two Pointers & Sliding Window medium

Three Sum

Given an array of integers, return all unique triplets that sum to zero.

sorting two-pointer unique-triplets
+25 pts 25m
Two Pointers & Sliding Window medium

Closest Three Sum

Given an array of integers and a target, return the sum of three numbers that is closest to the target.

sorting two-pointers array
+20 pts 20m
Two Pointers & Sliding Window medium

Minimum Size Subarray Sum

Given an array of positive integers, return the minimal length of a contiguous subarray with sum at least target, or 0 if none exists.

sliding-window two-pointers array
+25 pts 30m
Two Pointers & Sliding Window medium

Binary Subarray with Sum

Given a binary list and a goal sum, count the number of subarrays that add up to that goal.

sliding-window two-pointers subarray
+20 pts 20m
Two Pointers & Sliding Window medium

Four Sum

Find all unique quadruplets in an array that sum to a given target.

two-pointers sorting set
+30 pts 25m
Stacks & Queues medium

Score of Parentheses

Given a balanced parentheses string, compute its score where () is 1 and concatenation sums, nesting multiplies by 2.

stack string parsing
+20 pts 20m
Stacks & Queues medium

Sum of Subarray Minimums

Given an integer array, sum the minimum of all contiguous subarrays modulo 10^9+7.

stack array monotonic-stack
+30 pts 30m
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
Linked Lists easy

Sum all node values

Add every integer payload in the list.

linked-list lists pointers
+10 pts 12m
Linked Lists medium

Pairwise sum of adjacent nodes

Sum each adjacent pair; keep a lone last node as-is.

linked-list lists pointers
+22 pts 20m
Matrix & 2D Arrays medium

Matrix Block Sum

Given a 2D matrix and a block size, compute the sum of each block centered at every cell.

matrix prefix-sum 2d-array
+25 pts 25m
Datetime & Time Calculations easy

Datetime to Unix timestamp

Parse a datetime string and convert it to a Unix timestamp assuming UTC.

datetime parsing timestamp
+8 pts 10m
Data Formats & Parsing medium

Extract JSON-like numbers

Parse a simplified JSON-like string without using the json module and sum all numbers found in it.

json parsing numbers
+14 pts 20m
SQL & SQLite easy

Cumulative Sum SQL

Write a SQL query to compute cumulative sales totals per product ordered by sale date.

sql window-functions running-total
+8 pts 12m
Numpy & Vectorized Computing easy

Dot product of two vectors

Return sum of element-wise products.

vectors arrays numpy-style
+10 pts 12m
Numpy & Vectorized Computing easy

Sum each matrix row

Given rows, return each row sum.

vectors arrays numpy-style
+10 pts 12m
Numpy & Vectorized Computing easy

Sum each matrix column

Return column totals for a rectangular matrix.

vectors arrays numpy-style
+10 pts 12m
Numpy & Vectorized Computing medium

Prefix sum vector

Return running totals for each prefix of the vector.

vectors arrays numpy-style
+22 pts 20m

Showing 49–67 of 67 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

  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.