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

Count Smaller Numbers

Given an integer list, return for each position how many later elements are smaller than it.

arrays counting merge-sort
+20 pts 20m
Lists & Arrays easy

Move Zeroes

Implement move_zeroes(nums) that in-place moves all zeros to the end while maintaining the order of non-zero elements.

arrays in-place two-pointers
+10 pts 15m
Lists & Arrays easy

Sort array by parity

Given a list of integers, return a new list with all evens first and odds last, preserving original relative order.

sorting arrays two-pointers
+10 pts 15m
Lists & Arrays easy

Merge Sorted Array In Place

Write a function that merges two sorted arrays into the first array in-place, keeping the result sorted.

arrays sorting in-place
+10 pts 15m
Lists & Arrays easy

Running Total Window

Implement a function that returns a list of running totals, resetting to zero after each positive sum.

running-total sliding-window arrays
+8 pts 10m
Lists & Arrays easy

Normalize Array to Zero-One Range

Implement a function that normalizes a list of numbers to the range [0,1] using min-max scaling.

arrays normalization scaling
+8 pts 12m
Lists & Arrays easy

Rolling Window Mean

Given a list of numbers and a window size k, return a list of the means of every contiguous subarray of length k.

sliding-window lists averaging
+10 pts 12m
Lists & Arrays easy

Linear Interpolation Array

Given an array with some None values, replace them by linear interpolation between the nearest known values.

arrays interpolation math
+8 pts 12m
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
Lists & Arrays easy

Pad array edges

Implement a function that pads a list on both ends with a given value to a specified total length.

lists padding slicing
+7 pts 10m
Dicts & Sets medium

Subarray sum equals K

Count the number of contiguous subarrays whose sum equals k.

prefix-sum dict arrays
+28 pts 25m
Dicts & Sets easy

Longest Harmonious Subsequence

Given a list of integers, find the length of the longest harmonious subsequence where the difference between maximum and minimum values is exactly 1.

hash-map counting subsequence
+10 pts 15m
Data Structures & Algorithms easy

Index of peak element

Implement a function that returns the index of any peak element in a given integer array.

arrays search peak
+10 pts 15m
Data Structures & Algorithms easy

Count pairs with given difference

Count how many unordered pairs in a list have a given absolute difference using an efficient approach.

hash map counting arrays
+12 pts 15m
Data Structures & Algorithms medium

Find Peak Element

Implement a function that returns the index of any peak element in an integer array.

arrays search binary-search
+20 pts 25m
Data Structures & Algorithms easy

Previous Smaller Element

Find the nearest previous index with a smaller value for every element in an array.

arrays stack monotonic-stack
+10 pts 15m
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 hard

Median of Two Sorted Arrays

Given two sorted arrays, return the median of the combined sorted array in O(log(min(n,m))) time.

median binary search arrays
+45 pts 40m
Data Structures & Algorithms easy

Pascal Triangle Row

Given a non-negative integer n, return the nth row of Pascal's triangle as a list of integers.

math combinatorics arrays
+10 pts 15m
Data Structures & Algorithms easy

Bubble Sort

Implement bubble sort that sorts a list of numbers in ascending order.

sorting arrays algorithms
+8 pts 12m
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 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

Showing 25–48 of 170 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.