Lead Frontend
​
​
Log inSign up
© 2026 Lead Frontend. Free educational content, provided as is; it may contain errors. Not affiliated with any company or product named on this site.
TermsPrivacyDisclaimerCopyrightLicenses & credits

Algorithmic Coding

Data structures and algorithms questions that show up in front end loops.

Progress

0 / 46 completed

​
​
​
Difficulty
​
Topic
​
Status
Recommended
Sort

Showing 46 questions

Best Time to Buy and Sell Stock

Find the largest gain from one buy followed by one later sell in a price history.

Algorithms
Easy
15 min

Binary Search

Find a value's index in a sorted array in logarithmic time.

Algorithms
Easy
15 min

Binary Search Tree

Implement a binary search tree class with insert, lookup, delete, min/max and sorted iteration.

Algorithms
Medium
35 min

Binary Tree Traversals

Return the pre-order, in-order and post-order traversals of a binary tree.

Algorithms
Easy
20 min

Breadth-First Search

Find the fewest clicks between two pages of a site with breadth-first search.

Algorithms
Medium
20 min

Climbing Stairs

Count the ways to reach the top taking one or two steps at a time, the gentlest intro to DP.

Algorithms
Easy
15 min

Coin Change

Find the fewest coins (or credit packs) that add up exactly to an amount, using dynamic programming.

Algorithms
Medium
25 min

Combination Sum

List every multiset of values (reuse allowed) that adds up to a target, without duplicates.

Algorithms
Medium
25 min

Course Schedule

Decide whether a set of lessons with prerequisites can all be completed, by detecting cycles.

Algorithms
Medium
25 min

Depth-First Search

Traverse a graph depth-first from a start node and return the order nodes are visited.

Algorithms
Medium
20 min

Group Anagrams

Bucket words that are rearrangements of each other using a canonical hash key.

Algorithms
Medium
20 min

Heap Sort

Sort an array in place in guaranteed O(n log n) time using a binary max-heap.

Algorithms
Medium
30 min

House Robber

Pick non-adjacent items to maximise their total value, a classic 1-D dynamic programming problem.

Algorithms
Medium
20 min

Insert Interval

Add a new booking to a sorted list of busy blocks, merging where needed, in linear time.

Algorithms
Medium
20 min

Insertion Sort

Sort an array in place by growing a sorted prefix one element at a time.

Algorithms
Easy
15 min

Kth Largest Element

Find the k-th largest value without fully sorting, using a size-k heap or quickselect.

Algorithms
Medium
25 min

Binary Tree Level Order Traversal

Group a tree's values by depth, row by row, using breadth-first search.

Algorithms
Medium
20 min

Linked List

Implement a linked list class with insertion and removal at both ends, by index, and in-place reversal.

Algorithms
Medium
30 min

Longest Increasing Subsequence

Find the length of the longest strictly increasing subsequence, from O(n²) DP to O(n log n) patience sorting.

Algorithms
Medium
30 min

Longest Substring Without Repeating Characters

Find the length of the longest run of characters with no repeats using a sliding window.

Algorithms
Medium
20 min

Lowest Common Ancestor

Find the closest shared ancestor of two nodes in a DOM-like tree.

Algorithms
Medium
25 min

Maximum Subarray

Find the contiguous stretch with the largest sum using Kadane's algorithm.

Algorithms
Medium
20 min

Meeting Rooms II

Find the minimum number of rooms (or calendar columns) needed so no two overlapping meetings share one.

Algorithms
Medium
25 min

Merge Intervals

Collapse overlapping calendar events into the minimal set of busy blocks.

Algorithms
Medium
20 min

Merge Sort

Sort an array of numbers with the divide-and-conquer merge sort algorithm in O(n log n).

Algorithms
Medium
25 min

Min Heap

Implement a binary min-heap priority queue with a custom comparator.

Algorithms
Medium
30 min

Non-overlapping Intervals

Drop the fewest bookings so the remaining ones never overlap.

Algorithms
Medium
25 min

Number of Islands

Count connected regions of filled cells in a grid with flood fill.

Algorithms
Medium
20 min

Permutations

Generate every ordering of a list of distinct items with backtracking.

Algorithms
Medium
20 min

Product of Array Except Self

For each position, compute the product of every other element without using division.

Algorithms
Medium
20 min

Queue

Build a first-in, first-out queue class with O(1) enqueue and dequeue.

Algorithms
Easy
15 min

Quick Sort

Sort an array in place with quicksort, staying fast on sorted input and heavy duplicates.

Algorithms
Medium
30 min

Rotate Matrix

Rotate a square grid 90° clockwise in place, like rotating an image's pixel grid.

Algorithms
Medium
20 min

Selection Sort

Sort an array in place by repeatedly selecting the smallest remaining element.

Algorithms
Easy
15 min

Serialize and Deserialize a Binary Tree

Encode a binary tree as a string and rebuild an identical tree from it.

Algorithms
Hard
35 min

Sliding Window Maximum

Report the peak value in every window of k consecutive samples in O(n) with a monotonic deque.

Algorithms
Hard
35 min

Spiral Matrix

Read a rectangular grid in clockwise spiral order using shrinking boundaries.

Algorithms
Medium
20 min

Stack

Build a last-in, first-out stack class, the structure behind undo history and the call stack.

Algorithms
Easy
10 min

Subsets

Generate the power set of a list of distinct items, such as every combination of feature flags.

Algorithms
Medium
20 min

Top K Frequent Elements

Return the k most frequent values in a list, faster than sorting everything.

Algorithms
Medium
20 min

Topological Sort

Order modules so each one comes after everything it imports, and detect circular imports.

Algorithms
Medium
30 min

Trie

Build a prefix tree that powers autocomplete: insert words, look them up and list completions.

Algorithms
Medium
30 min

Two Sum

Find the two items in a list whose values add up to a target, in a single pass with a hash map.

Algorithms
Easy
15 min

Valid Parentheses

Check that every bracket in a code snippet is closed by the right kind, in the right order.

Algorithms
Easy
15 min

Validate Binary Search Tree

Check whether a binary tree satisfies the BST ordering rule across whole subtrees, not just parent and child.

Algorithms
Medium
20 min

Word Search

Check whether a word can be traced through adjacent letter tiles using backtracking.

Algorithms
Medium
25 min