Interactive roadmap

    Coding Interview Prep roadmap

    This roadmap is for developers preparing for technical interviews. You will learn core problem-solving patterns to tackle coding challenges with confidence.

    Your progress0% · 0 of 20 topics
    Done Learning Skipped OptionalClick any topic to learn more and mark your progress.
    1. 1

      Master The Fundamentals

      0 of 4 done

      Build a strong base in arrays, strings, and hash maps.

      Mastering the absolute basics saves you hours of debugging under pressure.
    2. 2

      Pointers and Windows

      0 of 3 done

      Optimise linear searches using multiple pointers and sliding windows.

      Visualise your data moving and shrinking to turn complex nested loops into clean linear solutions.
    3. 3

      Stacks and Queues

      0 of 3 done

      Organise data retrieval with specialised linear collections.

      Draw out the stack or queue state on paper to trace tricky ordering problems step by step.
    4. 4

      Trees and Graphs

      0 of 4 done

      Navigate hierarchical and networked data structures.

      Recursion is your best friend when exploring trees and graphs, so master base cases early.
    5. 5

      Dynamic Programming

      0 of 3 done

      Break complex problems into simpler overlapping subproblems.

      Start by writing the brute force recursive solution before figuring out how to cache the results.
    6. 6

      Interview Simulation

      0 of 3 done

      Practise communication, time management, and mock interviews.

      Treat the interviewer as a collaborator, talking through your ideas rather than coding in silence.

    Learn it all, with a tutor that never sleeps

    Every topic links to LevelUp lessons, practice exercises and the 24/7 AI Tutor. Your progress updates as you master lessons.

    Every topic explained

    Step 1: Master The Fundamentals

    Understand how linear data structures work in memory so you can manipulate elements efficiently.
    Read more

    Arrays and strings store sequential data in contiguous computer memory. Accessing an element by its index is instant, but inserting or deleting items in the middle requires shifting everything else, which takes time.

    Think of an array like a row of numbered lockers, where each locker holds one item. If you need item number five, you go straight to it. But if you add a new locker at the start, every other item must shift down one place.

    Knowing how these structures sit in memory helps you choose the right approach when sorting or searching data during an interview.

    • Arrays store items in contiguous memory blocks
    • Direct index lookup is extremely fast
    • Insertions and deletions can be costly operations
    • Strings are essentially immutable arrays of characters
    MDN Array Documentation
    Use key-value pairs to lookup data in constant time and solve frequency counting problems.
    Read more

    Hash maps and sets use a hash function to map keys to specific memory locations, allowing near-instant data retrieval. Instead of searching through a whole list, you jump straight to the answer.

    Imagine a phone contact book where names are mapped directly to phone numbers. You do not read every page; you look up the name and find the number straight away.

    These structures are vital for counting item frequencies, removing duplicates, and speeding up algorithms that would otherwise run too slowly.

    • Keys map to values for constant time lookups
    • Sets store unique elements without associated values
    • Hash collisions are handled behind the scenes
    • Crucial for frequency counting and duplicate checks
    Learn to analyse time and space complexity to write fast and scalable code.
    Read more

    Big O notation describes how your code scales as the input size grows. It focuses on the worst-case scenario, helping you prove whether your solution will run efficiently on massive datasets.

    Think of delivering post. Walking one letter to a neighbour takes constant time, but driving letters to every house on a street scales linearly with the number of houses.

    Interviewers look for optimal time and space complexity to ensure your code can handle real-world production loads without crashing or lagging.

    • Time complexity measures execution speed relative to input size
    • Space complexity measures memory usage growth
    • Drop constants and lower-order terms when evaluating
    • Aim for linear or logarithmic efficiency where possible
    (optional)
    Manipulate individual bits for niche interview questions.
    Read more

    Bitwise operations manipulate individual bits of data using low-level logical operators like AND, OR, and XOR. They work directly at the binary level.

    Imagine turning individual switches on a control panel up or down to combine multiple boolean settings into a single number.

    While rarely used in standard web development, interviewers test this to check your understanding of computer architecture and efficient numerical manipulation.

    • Operates directly on binary representations
    • XOR is useful for finding unique elements
    • Bit shifts multiply or divide by powers of two
    • Saves memory in constrained environments

    Step 2: Pointers and Windows

    Move two indices toward each other or the same direction to process sorted arrays efficiently.
    Read more

    The two pointers technique uses two distinct index variables moving through a data structure, often from opposite ends towards the middle. This avoids nested loops and improves efficiency.

    Think of checking if a word is a palindrome by placing a finger at the start and another at the end, moving inwards and comparing letters.

    This pattern is a staple for sorted arrays and strings, turning slow quadratic solutions into fast linear ones.

    • Pointers can start at ends and move inward
    • Pointers can also move in the same direction
    • Requires sorted data for many common use cases
    • Reduces time complexity from quadratic to linear
    Maintain a subset of data as a window moving across an array to solve subarray problems.
    Read more

    The sliding window pattern maintains a subset of items, expanding or shrinking the window as it moves across an array. It avoids recalculating values for overlapping sections.

    Imagine looking through a train window at a passing landscape, focusing only on the view framed by the glass as the train moves forward.

    It is essential for solving subarray and substring optimisation problems quickly and cleanly.

    • Maintains a dynamic range of elements
    • Window size can be fixed or variable
    • Avoids redundant calculations on overlapping data
    • Great for contiguous subarray challenges
    Precompute cumulative sums to answer range query problems instantly.
    Read more

    Prefix sum arrays involve precomputing cumulative totals so you can calculate the sum of any subarray range instantly in constant time.

    Think of running up a mountain trail with distance markers showing your total climb so far, letting you instantly calculate the height of any specific section.

    This technique saves you from repeatedly looping over the same data ranges in heavy query tasks.

    • Precomputes running totals into a new array
    • Answers range queries in constant time
    • Requires initial preprocessing pass
    • Useful for static array range problems

    Step 3: Stacks and Queues

    Use last-in, first-out ordering to parse expressions and track nested states.
    Read more

    A stack follows last-in, first-out ordering, meaning the last item added is the first one removed. You only interact with the top of the stack.

    Think of a spring-loaded stack of plates in a diner; you place a clean plate on top and take the top plate off when needed.

    Stacks are ideal for parsing code syntax, evaluating mathematical expressions, and tracking history like undo operations.

    • Last-in, first-out data ordering
    • Push and pop operations run in constant time
    • Used to track nested structures and states
    • Helpful for reversing sequences
    Use first-in, first-out ordering to process items sequentially or layer by layer.
    Read more

    A queue follows first-in, first-out ordering, meaning items are processed in the exact sequence they arrive. Breadth-first search relies heavily on this structure.

    Think of a queue of people waiting at a ticket office counter; the first person in line gets served first.

    Queues are essential for handling sequential tasks, scheduling background jobs, and exploring graphs layer by layer.

    • First-in, first-out data ordering
    • Enqueue at the back, dequeue from the front
    • Powers breadth-first search algorithms
    • Maintains fair processing order
    (optional)
    Keep elements in sorted order within a stack to find next greater elements quickly.
    Read more

    A monotonic stack keeps its elements strictly sorted in either ascending or descending order by popping elements that violate the rule.

    Think of stacking books by size where any new book smaller than the top one forces the larger ones underneath to be removed first.

    This advanced pattern lets you find the next greater or smaller element in an array efficiently.

    • Maintains sorted order within the stack
    • Removes elements that break the sorting rule
    • Finds next greater elements in linear time
    • Advanced pattern for tricky array challenges

    Step 4: Trees and Graphs

    Traverse parent-child node structures using recursive depth-first search methods.
    Read more

    Binary trees consist of nodes where each node has at most two children, commonly called left and right. Traversal algorithms explore these branches recursively.

    Think of a family tree where every parent branches out into two children down the generations.

    Understanding tree structures builds the foundation for more complex graph algorithms and hierarchical data storage.

    • Nodes have up to two child branches
    • Traversed using depth-first or breadth-first methods
    • Recursive functions fit naturally with tree shapes
    • Base cases prevent infinite loops
    Leverage sorted tree properties to search and insert values quickly.
    Read more

    A binary search tree is a special binary tree where the left child is smaller than the parent and the right child is larger, keeping data ordered.

    Think of a traditional paper dictionary where everything to the left of your open page comes alphabetically before it, and everything to the right comes after.

    This ordering allows you to search, insert, and delete values much faster than in an unsorted list.

    • Left child values are smaller than the parent
    • Right child values are larger than the parent
    • Enables fast logarithmic searching
    • Requires balancing to maintain efficiency
    Explore nodes and edges using depth-first and breadth-first search algorithms.
    Read more

    Graphs are collections of nodes connected by edges, representing networks. Traversing them means visiting connected nodes systematically without getting stuck in loops.

    Think of a map of city underground stations where stations are nodes and train tracks are edges connecting them.

    Graph traversal is crucial for routing, social network connections, and dependency resolution.

    • Nodes and edges form complex networks
    • Depth-first search explores deep down paths
    • Breadth-first search explores outwards in rings
    • Visited sets prevent infinite loops in cycles
    (optional)
    Track connected components in a graph efficiently.
    Read more

    A disjoint set union data structure tracks a set of elements partitioned into a number of non-overlapping subsets, supporting rapid union and find operations.

    Think of social friendship circles where you want to know quickly if two people belong to the same community network.

    It is widely used in network connectivity algorithms and finding minimum spanning trees.

    • Manages groups of connected elements
    • Supports fast find and union operations
    • Uses path compression for speed
    • Great for dynamic connectivity problems

    Step 5: Dynamic Programming

    Store results of expensive function calls to avoid redundant calculations.
    Read more

    Memoisation and tabulation are techniques used to store the results of expensive function calls and return the cached result when the same inputs occur again.

    Think of writing down the answer to a difficult maths sum on a notepad so you do not have to recalculate it if someone asks you again.

    This approach turns exponential time algorithms into efficient polynomial time solutions.

    • Caches results of subproblem calculations
    • Top-down approach uses recursion and a cache
    • Bottom-up approach uses tabulation and loops
    • Eliminates redundant calculation steps
    Solve sequence problems like climbing stairs or house robbing using past states.
    Read more

    One-dimensional dynamic programming solves sequence problems where the current state depends on a linear history of previous states.

    Think of climbing a staircase where each step cost is known, and your total cost depends on the choices made on the steps just before.

    This pattern teaches you how to define state transitions and build up solutions from base cases.

    • Solves linear sequence optimization problems
    • State depends on immediate predecessors
    • Builds solution iteratively from the bottom up
    • Reduces space complexity by keeping only recent states
    Handle grid and string matching problems with a matrix of states.
    Read more

    Two-dimensional dynamic programming uses a grid matrix of states to solve complex problems involving grids, paths, and string matching.

    Think of moving through a grid of rooms while collecting coins, where your best path into any room depends on the best routes from the rooms above and to the left.

    It is an advanced interview topic requiring careful attention to grid boundaries and state transitions.

    • Uses a 2D matrix to store subproblem states
    • Handles grid paths and string comparison challenges
    • Requires careful definition of boundary conditions
    • Transitions depend on multiple previous cells

    Step 6: Interview Simulation

    Learn to talk through your approach, clarify constraints, and discuss trade-offs out loud.
    Read more

    Explaining your thought process clearly lets the interviewer follow your logic, catch misunderstandings early, and offer helpful hints if you get stuck.

    Think of explaining a recipe step-by-step to a cooking partner so you both agree on what to do next before turning on the heat.

    Strong communication often matters more than getting the syntax 100 percent right on the first try.

    • Talk through your approach before writing code
    • Clarify constraints and input types upfront
    • Discuss trade-offs between different solutions
    • Listen carefully to hints from your interviewer
    Check your code against empty inputs, single items, and extreme values before submitting.
    Read more

    Testing your code against edge cases ensures your solution holds up under extreme conditions rather than just typical inputs.

    Think of testing a new lift design with zero passengers, maximum weight capacity, and sudden power cuts before opening it to the public.

    Catching these scenarios yourself demonstrates thorough engineering discipline.

    • Always test empty or null inputs
    • Check single-item and maximum-size inputs
    • Consider negative numbers and zero values
    • Walk through a trace of your code manually
    Simulate real pressure by coding against a timer with a peer.
    Read more

    Mock interview practice simulates real pressure, helping you manage time limits, nerves, and whiteboard coding alongside a peer.

    Think of running a dress rehearsal before a live theatre performance to build confidence and iron out mistakes.

    Regular simulation turns anxiety into routine, making real interviews feel familiar and manageable.

    • Simulates real time pressure and constraints
    • Builds confidence for live technical discussions
    • Highlights areas where you tend to rush
    • Provides honest feedback from your peers

    Related roadmaps