Maintenance

Site is under maintenance — quizzes are still available.

Go to quizzes
Practice Arena

Python Coding Challenges

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

57 challenges 26 easy 23 medium 8 hard
Python Basics medium

Fibonacci(n)

Return the nth Fibonacci number efficiently.

recursion dp memoization
+15 pts 15m
Strings & Text medium

Run-length encoding

Compress consecutive identical characters, e.g. 'aaabbc' → 'a3b2c1'.

strings compression
+20 pts 20m
Strings & Text medium

Longest common prefix

Find the longest common prefix among a list of strings.

strings zip
+18 pts 18m
Strings & Text medium

Integer to Roman

Convert a positive integer to its Roman numeral representation.

strings greedy
+22 pts 22m
Strings & Text medium

Zigzag string conversion

Encode a string in zigzag order across numRows rows, then read row by row.

strings math
+22 pts 20m
Lists & Arrays medium

Maximum subarray (Kadane)

Find the contiguous subarray with the largest sum.

dp arrays kadane
+25 pts 20m
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

Merge intervals

Merge all overlapping intervals and return a sorted result.

intervals sort
+30 pts 26m
Lists & Arrays medium

Product except self

Return an array where output[i] is the product of all elements except nums[i], without using division.

arrays prefix-sum
+25 pts 20m
Dicts & Sets medium

Group anagrams

Group words that are anagrams of each other.

dict sorting strings
+22 pts 20m
Dicts & Sets medium

Subarray sum equals K

Count the number of contiguous subarrays whose sum equals k.

prefix-sum dict arrays
+28 pts 25m
Functions & Closures medium

Memoize decorator

Implement a @memoize decorator that caches results of a function.

decorators closures caching
1
+25 pts 20m
Functions & Closures medium

Function composition

Return a function that applies f after g: compose(f, g)(x) == f(g(x)).

functional closures higher-order
+20 pts 18m
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
OOP & Classes medium

Matrix addition operator

Implement a Matrix class that supports + and * operators.

OOP dunder matrix
+22 pts 20m
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

Coin change (DP)

Find the minimum number of coins to make exactly the target amount.

dp greedy
+30 pts 28m
Data Structures & Algorithms medium

Graph DFS

Return all nodes reachable from a start node via DFS.

graph DFS recursion
+28 pts 25m
Advanced Python medium

Context manager timer

Implement a Timer context manager that records elapsed seconds.

context-manager time
1
+22 pts 20m
Advanced Python medium

Retry decorator

Implement @retry(times=3) that retries a function on exception.

decorators error-handling
+28 pts 25m
Advanced Python medium

2D Vector dataclass

Implement a Vector2D dataclass with +, -, scalar *, dot product, and magnitude.

dataclass OOP math
1
+20 pts 18m

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