Skip to main content
SYSTEM_ARENA: ONLINE

Coding Challenges

Push your limits with hand-crafted algorithmic challenges. Solve problems across Trees, Graphs, Dynamic Programming, and more โ€” with interactive code editors and real test cases.

Total 91
Trees 18
DP 20
Sorting 19
Streak 5 days
๐ŸŒณ Trees Track Now Live!18 new challenges added
Easy: 6Medium: 6Hard: 6
๐Ÿงฉ Dynamic Programming Track Now Live!20 new challenges added
Easy: 5Medium: 7Hard: 8
๐Ÿ“Š Sorting Algorithms Track Now Live!19 new challenges added
Easy: 5Medium: 7Hard: 7
Topic:
Level:
Showing 91 challenges
Easy Trees

Challenge 1: Data Structures-1

Solve the problem within 30 minutes to earn points and rank up.

30 min
Solve
Medium Trees

Challenge 2: Data Structures-2

Solve this challenging problem within 30 minutes to earn even more points!

30 min
Solve
Hard Trees

Challenge 3: Advanced Data Structures

Solve this challenging problem within 60 minutes to earn even more points!

60 min
Solve
Easy Trees

Tree Traversals (Inorder, Preorder, Postorder)

Return all three traversals of a binary tree. Great entry point into recursive tree thinking.

20 min
Solve
Easy Trees

Maximum Depth of Binary Tree

Find the length of the longest root-to-leaf path using elegant recursion.

15 min
Solve
Easy Trees

Count Leaf Nodes

Count all nodes with no children โ€” a clean exercise in base-case thinking.

15 min
Solve
Easy Trees

Sum of All Nodes

Compute the sum of every node value in the binary tree recursively.

15 min
Solve
Easy Trees

Symmetric Tree

Determine whether a binary tree is a mirror image of itself.

15 min
Solve
Medium Trees

Level Order Traversal

Traverse a binary tree level by level using BFS โ€” a classic queue-based challenge.

25 min
Solve
Medium Trees

Lowest Common Ancestor

Find the deepest node that is a common ancestor of two given nodes.

30 min
Solve
Medium Trees

Validate Binary Search Tree

Verify that a binary tree satisfies all BST properties using bounds propagation.

25 min
Solve
Medium Trees

Diameter of Binary Tree

Find the longest path (in edges) between any two nodes in the tree.

25 min
Solve
Medium Trees

Left View / Right View of Binary Tree

Return the first and last visible node at every level of the tree.

25 min
Solve
Hard Trees

Serialize and Deserialize Binary Tree

Design an encode/decode scheme so any tree can be stored and fully reconstructed.

45 min
Solve
Hard Trees

Vertical Order Traversal

Group tree nodes by column position, breaking ties by row then value.

40 min
Solve
Hard Trees

Construct Tree from Traversal Arrays

Rebuild a unique binary tree given its preorder and inorder traversals.

45 min
Solve
Hard Trees

Binary Tree Maximum Path Sum

Find the highest-sum path between any two nodes โ€” negative values make it tricky.

45 min
Solve
Hard Trees

Recover Binary Search Tree

Two BST nodes were swapped by mistake. Restore the tree in O(n) time.

50 min
Solve
Easy DP

Fibonacci Number

Calculate the n-th Fibonacci number using dynamic programming โ€” the classic introduction to memoization and tabulation.

10 min
Solve
Easy DP

Climbing Stairs

Count the distinct ways to climb n stairs taking 1 or 2 steps at a time โ€” identical recurrence to Fibonacci.

15 min
Solve
Easy DP

Min Cost Climbing Stairs

Find the minimum cost to reach the top of a staircase given a cost array โ€” classic DP optimization.

15 min
Solve
Easy DP

House Robber

Maximize loot from non-adjacent houses โ€” a foundational DP problem with a beautiful two-variable space optimization.

20 min
Solve
Easy DP

Coin Change (Minimum Coins)

Find the fewest coins to reach a target amount โ€” introducing unbounded knapsack DP.

25 min
Solve
Medium DP

Longest Increasing Subsequence (LIS)

Find the length of the longest strictly increasing subsequence โ€” a cornerstone of sequence DP.

25 min
Solve
Medium DP

Longest Common Subsequence (LCS)

Return the length of the longest common subsequence of two strings โ€” the canonical 2D DP problem.

30 min
Solve
Medium DP

0/1 Knapsack

Pack a knapsack to maximize value without exceeding capacity โ€” the quintessential DP on items.

30 min
Solve
Medium DP

Partition Equal Subset Sum

Determine if an array can be split into two subsets with equal sum โ€” a knapsack variant with a twist.

25 min
Solve
Medium DP

Decode Ways

Count the number of ways to decode a digit string to letters โ€” blending DP with string parsing.

30 min
Solve
Medium DP

Unique Paths

Count distinct paths from top-left to bottom-right of a grid โ€” the quintessential 2D DP grid problem.

25 min
Solve
Medium DP

Edit Distance

Find the minimum edit operations (insert, delete, replace) to convert one string to another โ€” classic interval DP.

30 min
Solve
Hard DP

Coin Change II

Count the number of combinations that sum to a target amount โ€” unbounded knapsack counting variant.

30 min
Solve
Hard DP

Matrix Chain Multiplication

Find the optimal parenthesization of matrix products to minimize scalar multiplications โ€” interval DP at its finest.

35 min
Solve
Hard DP

Longest Palindromic Subsequence

Find the longest subsequence of a string that is a palindrome โ€” interval DP on a single string.

30 min
Solve
Hard DP

Burst Balloons

Maximize coins by strategically bursting balloons โ€” a tricky interval DP problem of choosing the last element.

40 min
Solve
Hard DP

Rod Cutting Problem

Maximize revenue by cutting a rod into pieces of varying lengths โ€” unbounded knapsack meets optimization.

30 min
Solve
Hard DP

Egg Dropping Puzzle

Find the minimum number of trials to identify the critical floor โ€” a deceptively hard DP problem with a clever reformulation.

40 min
Solve
Hard DP

DP on Trees

Rob houses arranged as a binary tree without triggering alarms โ€” applying DP to tree structures with post-order DFS.

45 min
Solve
Hard DP

DP with Bitmasking

Solve the Travelling Salesman Problem using bitmask DP โ€” representing visited city sets as integers for exponential state compression.

45 min
Solve
Easy Sorting

Implement Bubble Sort

Sort an array using the Bubble Sort algorithm.

15 min
Solve
Easy Sorting

Implement Selection Sort

Sort an array using the Selection Sort algorithm.

15 min
Solve
Easy Sorting

Implement Insertion Sort

Sort an array using the Insertion Sort algorithm.

15 min
Solve
Easy Sorting

Sort an Array

Sort an array in ascending order in O(n log n) time.

15 min
Solve
Easy Sorting

Check if an Array is Sorted

Check if an array is strictly increasing.

10 min
Solve
Medium Sorting

Implement Merge Sort

Sort an array using the Merge Sort algorithm.

25 min
Solve
Medium Sorting

Implement Quick Sort

Sort an array using the Quick Sort algorithm.

30 min
Solve
Medium Sorting

Implement Heap Sort

Sort an array using the Heap Sort algorithm.

30 min
Solve
Medium Sorting

Sort Colors

Sort an array of 0s, 1s, and 2s in-place (Dutch National Flag).

25 min
Solve
Medium Sorting

Merge Two Sorted Arrays

Merge two sorted arrays into one sorted array in-place.

25 min
Solve
Medium Sorting

Kth Largest Element in an Array

Find the kth largest element without fully sorting the array.

30 min
Solve
Medium Sorting

Relative Sort Array

Sort an array based on the ordering of a second array.

25 min
Solve
Hard Sorting

Count Inversions in an Array

Find how far an array is from being sorted.

45 min
Solve
Hard Sorting

External Sorting Concepts

Merge multiple sorted chunks simulating external disk sorting.

50 min
Solve
Hard Sorting

Merge K Sorted Arrays

Merge K sorted arrays into a single sorted array.

45 min
Solve
Hard Sorting

Merge K Sorted Linked Lists

Merge multiple sorted linked lists (simulated as arrays).

50 min
Solve
Hard Sorting

Top K Frequent Elements

Find the top k most frequent elements in an array.

40 min
Solve
Hard Sorting

Sort Characters by Frequency

Sort a string based on the frequency of its characters.

35 min
Solve
Hard Sorting

Median of Two Sorted Arrays

Find the median of two sorted arrays in logarithmic time.

60 min
Solve
Easy Graphs

Graph Representation (Adjacency List & Matrix)

Build both the adjacency list and adjacency matrix from a list of edges โ€” the foundation of every graph algorithm.

15 min
Solve
Easy Graphs

Depth First Search (DFS)

Traverse a graph as deep as possible along each branch before backtracking โ€” the backbone of cycle detection and path-finding.

20 min
Solve
Easy Graphs

Breadth First Search (BFS)

Traverse a graph level by level using a queue โ€” the foundation for shortest paths in unweighted graphs.

20 min
Solve
Easy Graphs

Number of Connected Components

Count how many separate connected components exist in an undirected graph using DFS or Union-Find.

20 min
Solve
Easy Graphs

Find Path Between Two Nodes

Determine whether a path exists between two vertices and reconstruct it using BFS parent tracking.

20 min
Solve
Medium Graphs

Detect Cycle in an Undirected Graph

Use DFS with parent-tracking to determine if an undirected graph contains a cycle.

25 min
Solve
Medium Graphs

Detect Cycle in a Directed Graph

Use three-color DFS state tracking to detect back edges and cycles in a directed graph.

25 min
Solve
Medium Graphs

Topological Sort

Order the vertices of a DAG so every directed edge points forward โ€” essential for task scheduling problems.

30 min
Solve
Medium Graphs

Bipartite Graph Check

Determine whether a graph's vertices can be 2-colored with no same-color adjacent edges using BFS.

25 min
Solve
Medium Graphs

Shortest Path in Unweighted Graph

Compute shortest hop-count distances from a source using BFS on an unweighted graph.

25 min
Solve
Hard Graphs

Dijkstra's Algorithm

Find shortest paths from a source in a weighted graph with non-negative weights using a greedy priority queue.

35 min
Solve
Hard Graphs

Bellman-Ford Algorithm

Compute shortest paths even with negative edge weights, and detect negative-weight cycles in O(VE).

35 min
Solve
Hard Graphs

Floyd-Warshall Algorithm

Compute shortest paths between every pair of vertices in O(Vยณ) using all-pairs DP.

35 min
Solve
Hard Graphs

Minimum Spanning Tree (Kruskal's & Prim's)

Find the minimum-weight edge subset connecting all vertices using Kruskal's sort + Union-Find approach.

40 min
Solve
Hard Graphs

Strongly Connected Components (Kosaraju/Tarjan)

Find all maximal sets of mutually reachable vertices in a directed graph using Kosaraju's two-pass DFS.

40 min
Solve
Easy Greedy

Assign Cookies

Maximize the number of content children by greedily assigning the smallest sufficient cookie to each child.

15 min
Solve
Easy Greedy

Maximum Number of Meetings

Select the maximum number of non-overlapping meetings that can fit in a single room.

15 min
Solve
Easy Greedy

Lemonade Change

Determine if you can give correct change to every customer at a lemonade stand using a greedy cash-tracking approach.

15 min
Solve
Easy Greedy

Can Place Flowers

Check if n flowers can be planted in a flowerbed without any two flowers being adjacent.

15 min
Solve
Easy Greedy

Minimum Absolute Difference

Find all pairs of elements with the minimum absolute difference โ€” a sort-then-scan greedy classic.

15 min
Solve
Medium Greedy

Activity Selection Problem

Select the maximum number of non-overlapping activities โ€” the canonical greedy interval scheduling problem.

25 min
Solve
Medium Greedy

Fractional Knapsack

Maximize value in a knapsack where items can be broken into fractions โ€” greedily pick by value/weight ratio.

25 min
Solve
Medium Greedy

Jump Game

Determine if you can reach the last index by greedily tracking the farthest reachable position.

20 min
Solve
Medium Greedy

Gas Station

Find the unique starting gas station from which you can complete a circular route without running out of fuel.

25 min
Solve
Medium Greedy

Non-overlapping Intervals

Remove the minimum number of intervals to make the rest non-overlapping โ€” greedy sorting by end time.

25 min
Solve
Medium Greedy

Minimum Number of Arrows to Burst Balloons

Find the minimum number of arrows needed to burst all balloons on a wall โ€” greedy interval overlap.

25 min
Solve
Medium Greedy

Partition Labels

Split a string into as many parts as possible so each character appears in at most one part.

25 min
Solve
Hard Greedy

Job Sequencing with Deadlines

Schedule jobs to maximize total profit given each job has a deadline and takes one unit of time.

35 min
Solve
Hard Greedy

Huffman Coding

Build an optimal prefix-free encoding tree by greedily merging the two lowest-frequency symbols.

40 min
Solve
Hard Greedy

Minimum Platforms Required

Find the minimum number of railway platforms needed so no train waits โ€” a classic interval greedy problem.

35 min
Solve
Hard Greedy

Minimum Cost to Connect Ropes

Find the minimum cost to connect all ropes into one by always combining the two shortest โ€” greedy min-heap.

30 min
Solve
Hard Greedy

Reorganize String

Rearrange a string so no two adjacent characters are the same โ€” greedy placement using a max-frequency heap.

35 min
Solve
Hard Greedy

Remove K Digits

Remove k digits from a number string to produce the smallest possible resulting number โ€” monotonic stack greedy.

35 min
Solve
Hard Greedy

Course Schedule III

Maximize the number of courses you can take given duration and deadline constraints โ€” greedy with a max-heap.

40 min
Solve