Partition function
Write a function that returns the number of ways to write a positive integer as a sum of positive integers (order irrelevant).
Interleaving string
Given three strings s1, s2, and s3, check if s3 is formed by interleaving s1 and s2 while preserving the order of each input string.
Binary Tree Inorder Traversal
Implement an inorder traversal function that returns node values in left-root-right order.
Preorder Traversal
Implement a function that returns the preorder traversal values of a binary tree.
Postorder Traversal
Implement a function that returns the postorder traversal of a binary tree as a list of node values.
Vertical Order Traversal
Compute the vertical order traversal of a binary tree, grouping nodes by column and row.
Kth Smallest in BST
Implement a function that returns the k-th smallest value in a binary search tree.
Zigzag Level Order Traversal
Implement a function that returns the zigzag level-order traversal of a binary tree.
Alien Dictionary Order
Given a sorted list of words in an alien language, derive the order of its unique letters.
Topological Sort via DFS
Return a deterministic topological ordering of nodes in a directed acyclic graph using DFS, or an empty list if a cycle exists.
Course Schedule Ordering
Determine a valid sequence to complete all courses respecting prerequisite constraints.
Letter Tile Possibilities
Given a string of letter tiles, count the number of distinct non-empty sequences that can be formed using any non-empty subset in any order.
Queue Reconstruction by Height
Given shuffled pairs of (height, number_of_taller_people_in_front), reconstruct the original queue order.
Search Insert Position
Return the index where a target should be inserted into a sorted list to maintain order.
Capacity to Ship Packages
Given package weights and days allowed, compute the smallest ship capacity that can deliver all packages in order within the given days.
Find k Closest Elements to Target
Return exactly k elements from a sorted list that are closest to a given target, preserving order.
Validate Stack Sequences
Given two sequences of distinct integers, verify whether the second sequence is a valid pop order for a stack given the first sequence as push order.
Asteroid Collision
Simulate asteroid collisions with a stack and return the remaining asteroids in original order.
Top K Frequent Elements
Given a list of integers and a number k, return the k most frequent elements in descending order of frequency, with ties broken by larger value.
Reverse a linked list copy
Return a new list with node values in reverse order without mutating the input.
Remove duplicate values
Keep first occurrence of each value while preserving order.
Compare two linked lists
Return True when both lists have identical values in order.
Spiral Matrix Order
Given a 2D matrix, return all elements in clockwise spiral order starting from the top-left.
Spiral Matrix Traversal
Implement a function that returns the elements of a 2D matrix in clockwise spiral order.
Showing 49–72 of 78 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
- 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.