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

Convolve 1D Signal

Write a function that computes the 1D convolution of two lists in 'full' mode.

convolution arrays sliding-window
+20 pts 20m
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

Top N per group

Implement top_n_per_group that returns the top N scores for each group from a list of (group, score) pairs.

sorting grouping dictionaries
+25 pts 25m
Data Structures & Algorithms medium

Level Order Traversal

Implement a function that performs a level order traversal of a binary tree and returns node values as a list of lists.

binary-tree queue bfs
+20 pts 25m
Math & Number Theory medium

Correlation Coefficient

Write a pure-Python function that computes the Pearson correlation coefficient between two lists of numbers.

statistics math arrays
+15 pts 15m
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
Greedy Algorithms medium

Queue Reconstruction by Height

Given shuffled pairs of (height, number_of_taller_people_in_front), reconstruct the original queue order.

greedy sorting insertion
+25 pts 25m
Binary Search medium

Find k Closest Elements to Target

Return exactly k elements from a sorted list that are closest to a given target, preserving order.

binary-search sorting two-pointers
+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
Linked Lists medium

Prepend a new head

Insert value at the front of the list.

linked-list lists pointers
+22 pts 20m
Linked Lists medium

Append a new tail

Add value after the last node.

linked-list lists pointers
+22 pts 20m
Linked Lists medium

Palindrome linked values

Check whether values read the same forwards and backwards.

linked-list lists pointers
+22 pts 20m
Linked Lists medium

Rotate list left by k

Move the first k nodes to the end (k may exceed length; use modulo).

linked-list lists pointers
+22 pts 20m
Linked Lists medium

Merge two sorted lists

Merge two ascending integer lists into one sorted list.

linked-list lists pointers
+22 pts 20m
Linked Lists medium

Remove duplicate values

Keep first occurrence of each value while preserving order.

linked-list lists pointers
+22 pts 20m
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
Linked Lists medium

Count nodes equal to target

Count how many times target appears in the list.

linked-list lists pointers
+22 pts 20m
Linked Lists medium

Zip two linked lists

Interleave values from a and b until both are exhausted.

linked-list lists pointers
+22 pts 20m
Linked Lists medium

Split list at index

Return prefix and suffix tuples at index k.

linked-list lists pointers
+22 pts 20m
Data Formats & Parsing medium

Flatten nested JSON

Write a function that flattens nested JSON objects into a flat dictionary with dot-separated keys, handling lists and empty objects.

json recursion dictionaries
+20 pts 25m

Showing 1–21 of 21 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.