ESC

Type to search the knowledge base.

Interview

DSA for frontend engineers

Pattern-first problems with brute force, optimized approaches, complexity, and company tags. JavaScript and TypeScript solutions.

Categories

  • Arrays
  • Strings
  • HashMaps
  • Linked List
  • Stack
  • Queue
  • Heap
  • Tree
  • Trie
  • Graph
  • Binary Search
  • Sliding Window
  • Dynamic Programming
  • Greedy
  • Backtracking

Problems

Two Sum

beginner

The classic warm-up: find two indices that add to a target — brute force, hash map, and the follow-ups interviewers love.

beginner · Google · Amazon · Meta

Contains Duplicate

beginner

Contains Duplicate explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta

Valid Anagram

beginner

Valid Anagram explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Group Anagrams

intermediate

Group Anagrams explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Top K Frequent Elements

intermediate

Top K Frequent Elements explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Product of Array Except Self

intermediate

Product of Array Except Self explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Longest Consecutive Sequence

intermediate

Longest Consecutive Sequence explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Valid Palindrome

beginner

Valid Palindrome explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

3Sum

intermediate

3Sum explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Container With Most Water

intermediate

Container With Most Water explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Best Time to Buy and Sell Stock

beginner

Best Time to Buy and Sell Stock explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Longest Substring Without Repeating

intermediate

Longest Substring Without Repeating explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Longest Repeating Character Replacement

intermediate

Longest Repeating Character Replacement explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Minimum Window Substring

advanced

Minimum Window Substring explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta

Valid Parentheses

beginner

Valid Parentheses explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Min Stack

intermediate

Min Stack explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Evaluate Reverse Polish Notation

intermediate

Evaluate Reverse Polish Notation explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Daily Temperatures

intermediate

Daily Temperatures explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Car Fleet

intermediate

Car Fleet explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Binary Search

beginner

Binary Search explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Search in Rotated Sorted Array

intermediate

Search in Rotated Sorted Array explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Find Minimum in Rotated Sorted Array

intermediate

Find Minimum in Rotated Sorted Array explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Time Based Key Value Store

intermediate

Time Based Key Value Store explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Reverse Linked List

beginner

Reverse Linked List explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Merge Two Sorted Lists

beginner

Merge Two Sorted Lists explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Linked List Cycle

beginner

Linked List Cycle explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Reorder List

intermediate

Reorder List explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Remove Nth Node From End

intermediate

Remove Nth Node From End explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Copy List with Random Pointer

intermediate

Copy List with Random Pointer explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Add Two Numbers Linked List

intermediate

Add Two Numbers Linked List explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Find Duplicate Number

intermediate

Find Duplicate Number explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

LRU Cache

advanced

LRU Cache explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta

Implement Trie

intermediate

Implement Trie explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Design Add and Search Words

intermediate

Design Add and Search Words explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Word Search II

advanced

Word Search II explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta · Amazon

Number of Islands

intermediate

Number of Islands explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Clone Graph

intermediate

Clone Graph explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Max Area of Island

intermediate

Max Area of Island explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Pacific Atlantic Water Flow

advanced

Pacific Atlantic Water Flow explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta

Course Schedule

intermediate

Course Schedule explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Course Schedule II

intermediate

Course Schedule II explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Redundant Connection

intermediate

Redundant Connection explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Word Ladder

advanced

Word Ladder explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta · Amazon

Climbing Stairs

beginner

Climbing Stairs explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta

House Robber

intermediate

House Robber explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

House Robber II

intermediate

House Robber II explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Longest Palindromic Substring

intermediate

Longest Palindromic Substring explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Coin Change

intermediate

Coin Change explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Word Break

intermediate

Word Break explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Longest Increasing Subsequence

intermediate

Longest Increasing Subsequence explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Unique Paths

intermediate

Unique Paths explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Jump Game

intermediate

Jump Game explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Jump Game II

intermediate

Jump Game II explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Gas Station

intermediate

Gas Station explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Hand of Straights

intermediate

Hand of Straights explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Merge Intervals

intermediate

Merge Intervals explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Insert Interval

intermediate

Insert Interval explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Non-overlapping Intervals

intermediate

Non-overlapping Intervals explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Meeting Rooms

beginner

Meeting Rooms explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Meeting Rooms II

intermediate

Meeting Rooms II explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Reverse Bits

beginner

Reverse Bits explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta

Number of 1 Bits

beginner

Number of 1 Bits explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Counting Bits

intermediate

Counting Bits explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Missing Number

beginner

Missing Number explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Sum of Two Integers

intermediate

Sum of Two Integers explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Invert Binary Tree

beginner

Invert Binary Tree explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta

Maximum Depth of Binary Tree

beginner

Maximum Depth of Binary Tree explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Same Tree

beginner

Same Tree explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta

Subtree of Another Tree

beginner

Subtree of Another Tree explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta · Amazon

Lowest Common Ancestor BST

intermediate

Lowest Common Ancestor BST explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Binary Tree Level Order

intermediate

Binary Tree Level Order explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Validate Binary Search Tree

intermediate

Validate Binary Search Tree explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Kth Smallest in BST

intermediate

Kth Smallest in BST explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Construct Tree from Preorder Inorder

advanced

Construct Tree from Preorder Inorder explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta

Binary Tree Max Path Sum

advanced

Binary Tree Max Path Sum explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta

Serialize Deserialize Binary Tree

advanced

Serialize Deserialize Binary Tree explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta

Implement Queue with Stacks

beginner

Implement Queue with Stacks explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta

Implement Stack with Queues

beginner

Implement Stack with Queues explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

beginner · Google · Meta

Sliding Window Maximum

advanced

Sliding Window Maximum explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta · Amazon

Find Median from Data Stream

advanced

Find Median from Data Stream explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta · Amazon

K Closest Points to Origin

intermediate

K Closest Points to Origin explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Task Scheduler

intermediate

Task Scheduler explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Design Twitter Lite

advanced

Design Twitter Lite explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta · Amazon

Encode and Decode Strings

intermediate

Encode and Decode Strings explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Valid Sudoku

intermediate

Valid Sudoku explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Spiral Matrix

intermediate

Spiral Matrix explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Rotate Image

intermediate

Rotate Image explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Set Matrix Zeroes

intermediate

Set Matrix Zeroes explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Word Search

intermediate

Word Search explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Subsets

intermediate

Subsets explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Combination Sum

intermediate

Combination Sum explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

Permutations

intermediate

Permutations explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta

N-Queens

advanced

N-Queens explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

advanced · Google · Meta · Amazon

Palindrome Partitioning

intermediate

Palindrome Partitioning explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon

Letter Combinations Phone Number

intermediate

Letter Combinations Phone Number explained for frontend engineers — mental model, examples, common mistakes, and interview tips.

intermediate · Google · Meta · Amazon