Longest Substring with K Repeating Characters
Return the length of the longest substring of a given string in which every character appears at least K times.
Basic Calculator
Implement a function that evaluates a simple arithmetic expression with +, -, *, / and parentheses.
Minimum Remove Valid Parentheses
Given a string with parentheses and letters, remove the fewest parentheses to make it valid.
Parse key-value lines
Parse structured key-value lines into a dictionary with support for quoted values and escaped characters.
Maximum subarray (Kadane)
Find the contiguous subarray with the largest sum.
Product except self
Return an array where output[i] is the product of all elements except nums[i], without using division.
Reentrant Lock Manager
Implement a ReentrantLock class with acquire, release, locked, owner, and helper functions that test thread-safety with real threads.
Design Twitter Feed
Implement a Twitter class with postTweet, getNewsFeed, follow, and unfollow methods.
Basic Calculator II
Evaluate a basic arithmetic expression with +, -, *, / following operator precedence.
Online Stock Span
Implement StockSpanner.next(price) that returns the maximum number of consecutive days (including today) with price <= current price.
Design Browser History
Implement a BrowserHistory class that supports visit, back, and forward navigation with step counts.
Design Skip List Lite
Implement a simplified skip list supporting insert, search, and delete with O(log n) average complexity.
2D Vector dataclass
Implement a Vector2D dataclass with +, -, scalar *, dot product, and magnitude.
TypeVar bounded generic
Learn to use TypeVar with bounds to write type-safe generic functions in Python.
Context Variable Scope
Implement a context manager that temporarily changes a global variable and restores it afterwards, even if an exception occurs.
Cartesian Product Generator
Implement a generator function that yields the Cartesian product of multiple input iterables without precomputing all results.
Memoize with TTL
Implement a decorator that caches function results for a limited time, returning cached values within the TTL and recomputing after expiry.
Resource Cleanup Manager
Implement a context manager that tracks and releases resources reliably, and can report cleanup actions.
Suppress Specific Exceptions
Implement a custom context manager that suppresses specified exception types within its block.
Validate Email Regex
Implement a function that validates email addresses using regex with specific rules.
Bitwise AND of a Range
Given a range [a, b], return the bitwise AND of all integers in that inclusive range without iterating over all numbers.
Divide using shifts
Implement division of two integers using only bit shifts and arithmetic, without using division or modulo operators.
House Robber Circular
Solve the House Robber problem with houses arranged in a circle.
Unique Paths with Obstacles
Given a 2D grid with obstacles, count the unique paths from top-left to bottom-right moving only down or right.
Showing 1–24 of 72 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
- Pick a category — basics, algorithms, strings, and more
- Open a challenge, read the statement, and edit the starter code
- 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.