Challenge Problems
Sharpen your skills with curated coding challenges from beginner to advanced
How to Approach Coding Challenges
Understand Before You Code
Read the problem twice. Write out examples by hand. Identify inputs, outputs, and edge cases before touching your keyboard.
Break It Down
Decompose complex problems into smaller sub-problems. Solve each piece independently, then combine them into a full solution.
Start Simple, Then Optimize
Get a working brute-force solution first. Once it works, analyze its time and space complexity, then look for ways to improve.
Practice Consistently
Solving one problem a day is better than cramming ten in one session. Consistency builds pattern recognition over time.
String Manipulation
Master text processing — one of the most common tasks in real-world programming. From reversing strings to parsing complex patterns, these challenges build a foundation you'll use every day.
Reverse a String
EasyWrite a function that takes a string and returns it reversed. Consider edge cases like empty strings and single characters.
Palindrome Checker
EasyDetermine if a given string reads the same forwards and backwards. Ignore spaces, punctuation, and case.
Anagram Detector
MediumCheck if two strings are anagrams of each other (contain the same characters in different order).
Caesar Cipher
MediumImplement encryption and decryption using the Caesar cipher — shift each letter by a fixed number of positions.
Longest Substring Without Repeats
HardFind the length of the longest substring that contains no repeating characters. This is a classic sliding window problem.
Array & List Challenges
Arrays are the backbone of data structures. These challenges teach you to think about iteration, sorting, searching, and efficient data access patterns.
Two Sum
EasyGiven an array of numbers and a target, find two numbers that add up to the target. Return their indices.
Remove Duplicates
EasyRemove all duplicate values from an array while maintaining the original order of elements.
Rotate Array
MediumRotate an array to the right by K steps. For example, [1,2,3,4,5] rotated by 2 becomes [4,5,1,2,3].
Merge Sorted Arrays
MediumMerge two sorted arrays into one sorted array without using built-in sort functions.
Maximum Subarray Sum
HardFind the contiguous subarray with the largest sum. This is known as Kadane's Algorithm — a must-know for interviews.
Math & Logic
Sharpen your logical thinking with mathematical challenges. These problems train you to break complex problems into smaller, solvable steps — a core programming skill.
FizzBuzz
EasyPrint numbers 1-100 but replace multiples of 3 with 'Fizz', multiples of 5 with 'Buzz', and multiples of both with 'FizzBuzz'.
Fibonacci Sequence
EasyGenerate the first N numbers of the Fibonacci sequence where each number is the sum of the two preceding ones.
Prime Number Generator
MediumWrite a function that finds all prime numbers up to N. Bonus: implement the Sieve of Eratosthenes for efficiency.
Roman Numeral Converter
MediumConvert integers to Roman numerals and vice versa. Handle values from 1 to 3999.
Tower of Hanoi
HardSolve the classic Tower of Hanoi puzzle recursively — move N disks from one peg to another using a helper peg.
Data Structures
Understanding data structures is what separates a beginner from an intermediate developer. Build these from scratch to truly understand how they work under the hood.
Implement a Stack
EasyBuild a stack data structure with push, pop, peek, and isEmpty methods. Stacks follow Last-In-First-Out (LIFO) ordering.
Implement a Queue
EasyBuild a queue with enqueue, dequeue, and peek methods. Queues follow First-In-First-Out (FIFO) ordering.
Linked List Operations
MediumCreate a singly linked list with insert, delete, search, and reverse operations.
Binary Search Tree
MediumImplement a BST with insert, search, and traversal (in-order, pre-order, post-order) methods.
Hash Table from Scratch
HardBuild your own hash table with collision handling. Implement put, get, delete, and resize operations.
Algorithm Challenges
Algorithms are the recipes of programming. Master sorting, searching, and optimization techniques that form the basis of efficient software engineering.
Binary Search
EasySearch for a target value in a sorted array by repeatedly dividing the search interval in half.
Bubble Sort Implementation
EasyImplement bubble sort and understand its O(n²) time complexity. Then optimize it with an early termination flag.
Merge Sort
MediumImplement the divide-and-conquer merge sort algorithm. Understand why it's O(n log n) and when to use it.
Depth-First Search
MediumTraverse a graph or tree using DFS. Implement both recursive and iterative versions.
Dijkstra's Shortest Path
HardFind the shortest path between nodes in a weighted graph using Dijkstra's algorithm.
Web & API Challenges
Put your skills into practice with real-world web development challenges. These tasks mirror what professional developers do every day.
Build a To-Do List
EasyCreate a functional to-do app with add, delete, and mark-as-complete features. Use localStorage for persistence.
Fetch & Display API Data
EasyCall a public API (like a weather or joke API), handle the response, and display the data in a clean UI.
Build a Calculator
MediumCreate a calculator that handles basic operations, decimal numbers, and follows order of operations.
Pagination System
MediumBuild a reusable pagination component that handles large datasets with previous/next and page number navigation.
Real-Time Chat Interface
HardDesign a chat UI with message bubbles, timestamps, typing indicators, and auto-scrolling to the latest message.
Algorithm & Problem-Solving Glossary
Time Complexity
A measure of how an algorithm's runtime grows as the input size increases. Expressed using Big O notation (e.g., O(n), O(log n), O(n²)).
Space Complexity
How much additional memory an algorithm needs relative to input size. In-place algorithms use O(1) extra space.
Big O Notation
A mathematical notation describing the upper bound of an algorithm's growth rate. O(1) is constant, O(n) is linear, O(n²) is quadratic.
Brute Force
A straightforward approach that tries every possibility. Often the simplest solution but usually not the most efficient.
Edge Case
An unusual or extreme input that might cause your solution to fail — like empty arrays, negative numbers, or very large values.
Recursion
A technique where a function calls itself to solve smaller instances of the same problem. Every recursive solution needs a base case to stop.
Sliding Window
A technique for processing sequential data by maintaining a 'window' that moves through the data, avoiding redundant computations.
Divide and Conquer
An algorithm design paradigm that breaks a problem into smaller subproblems, solves them independently, and combines the results.
Dynamic Programming
Solving complex problems by breaking them into overlapping subproblems and storing results to avoid redundant calculations (memoization).
Greedy Algorithm
An approach that makes the locally optimal choice at each step, hoping to find the global optimum. Works for some problems but not all.
Ready to Start Coding?
Open the Try It Yourself editor, pick a challenge, and start solving. The best way to learn is by doing!