Blind 75

Revise 75 core DSA problems in Minutes

📝 75 problems⏱️ Est. 2-3 hours🎯 Interview Prep

Questions (75)

Tap on any question to view the full solution

E

Two Sum

#1

Use a hashmap to store complements and return indices when found.

E

Best Time to Buy and Sell Stock

#2

Track running minimum price and maximum profit in one pass.

E

Contains Duplicate

#3

Use a HashSet to detect duplicates quickly.

M

Maximum Subarray

#4

Use Kadane's algorithm: track max ending here and global max.

M

Product of Array Except Self

#5

Compute prefix and suffix products to avoid division.

M

Maximum Product Subarray

#6

Track both max and min products at each position, swapping when encountering negatives to handle sign flips.

M

Find Minimum in Rotated Sorted Array

#7

Use binary search comparing mid with right boundary to determine which half contains the minimum.

M

Search in Rotated Sorted Array

#8

Identify which half is sorted, then determine if target lies in that sorted half to decide search direction.

H

3Sum

#9

Sort and use two pointers to find triplets summing to zero, skipping duplicates.

M

Container With Most Water

#10

Two-pointer: move the shorter line inward to try larger area.

M

Sum of Two Integers

#11

Add two integers using bitwise operations without using + or - operators.

E

Number of 1 Bits

#12

Count the number of set bits (1s) in the binary representation of an integer.

E

Counting Bits

#13

Return array where result[i] is the number of 1 bits in binary representation of i.

E

Missing Number

#14

Find the missing number in array containing n distinct numbers from 0 to n.

E

Reverse Bits

#15

Reverse the bits of a 32-bit unsigned integer.

E

Climbing Stairs

#16

Count distinct ways to climb n stairs when you can take 1 or 2 steps at a time.

M

Coin Change

#17

Find minimum coins needed to make amount using unbounded knapsack DP.

M

Longest Increasing Subsequence

#18

Find length of longest strictly increasing subsequence using binary search on tails array.

M

Longest Common Subsequence

#19

Find longest common subsequence between two strings using 2D DP table.

M

Word Break

#20

Check if string can be segmented into dictionary words using DP.

M

Combination Sum IV

#21

Count number of combinations that sum to target where order matters (permutations).

M

Unique Paths

#22

Count unique paths from top-left to bottom-right in m×n grid moving only right/down.

M

Jump Game

#23

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

M

Clone Graph

#24

Deep clone undirected graph using DFS/BFS with HashMap to track old→new node mapping.

M

Course Schedule

#25

Detect if course prerequisites form a cycle using topological sort or DFS cycle detection.

M

Pacific Atlantic Water Flow

#26

Find cells that can flow to both oceans by doing reverse DFS from ocean borders.

M

Number of Islands

#27

Use DFS/BFS to flood-fill islands and count connected components.

M

Longest Consecutive Sequence

#28

Use HashSet to find sequence starts (no n-1) and count consecutive numbers in O(n).

H

Alien Dictionary

#29

Build graph from word order relationships and return topological sort of character ordering.

M

Graph Valid Tree

#30

Check if graph is a valid tree: must be connected and have exactly n-1 edges (no cycles).

H

Serialize and Deserialize Binary Tree

#31

Convert tree to string and back using BFS level-order or DFS pre-order traversal.

E

Invert Binary Tree

#32

Recursively swap left and right children of every node.

E

Maximum Depth of Binary Tree

#33

Return max depth using DFS: 1 + max of left and right subtree depths.

E

Diameter of Binary Tree

#34

Track max diameter as sum of left and right heights at each node during DFS.

E

Balanced Binary Tree

#35

Check if tree is height-balanced: at every node, left and right heights differ by at most 1.

E

Same Tree

#36

Recursively check if two trees have identical structure and node values.

E

Subtree of Another Tree

#37

Check if subRoot is identical to any subtree of root using isSameTree helper.

M

Lowest Common Ancestor of BST

#38

Use BST property: if p and q split at node (one left, one right), that node is LCA.

M

Binary Tree Level Order Traversal

#39

Use BFS with queue to traverse tree level by level, collecting nodes at each level.

M

Binary Tree Right Side View

#40

Use BFS to traverse level by level, collecting the rightmost node at each level.

M

Count Good Nodes in Binary Tree

#41

DFS tracking max value on path; count nodes where node.val >= maxSoFar.

M

Validate Binary Search Tree

#42

DFS with min/max bounds: left subtree < node < right subtree, recursively validate.

M

Kth Smallest Element in BST

#43

Inorder traversal of BST gives sorted order; return kth element encountered.

M

Construct Binary Tree from Preorder and Inorder Traversal

#44

Use preorder's first element as root, find it in inorder to split left/right subtrees recursively.

H

Binary Tree Maximum Path Sum

#45

Track global max while DFS returns max single-path sum from each node.

M

Implement Trie (Prefix Tree)

#46

Build tree where each node has 26 children (a-z) and boolean flag for word endings.

M

Design Add and Search Words Data Structure

#47

Implement Trie with wildcard search using DFS to try all branches when '.' encountered.

H

Word Search II

#48

Build Trie from words, then DFS on board checking Trie nodes to find all matching words.

H

Merge K Sorted Lists

#49

Use min-heap to always extract smallest element from k lists, adding next element from same list.

E

Merge Two Sorted Lists

#50

Use dummy node and two pointers to build merged list by comparing and advancing smaller node.

M

Reorder List

#51

Find middle, reverse second half, then merge alternating nodes from both halves.

M

Remove Nth Node From End of List

#52

Use two pointers with n-gap to find node before target, then skip target node.

E

Linked List Cycle

#53

Use Floyd's cycle detection: slow and fast pointers, if they meet there's a cycle.

E

Reverse Linked List

#54

Iteratively reverse pointers: track prev, current, and next nodes.

M

Linked List Cycle II

#55

Use Floyd's algorithm: detect cycle, then find entry point by resetting one pointer to head.

M

LRU Cache

#56

Use HashMap + doubly linked list: map for O(1) access, DLL for O(1) eviction of LRU.

M

Min Stack

#57

Use two stacks: one for values, one tracking minimum at each level.

E

Valid Parentheses

#58

Use stack to match closing brackets with their corresponding opening brackets.

M

Generate Parentheses

#59

Backtrack to generate valid combinations: add '(' if open < n, add ')' if close < open.

M

Daily Temperatures

#60

Use monotonic decreasing stack to track indices, pop when warmer day found.

M

Car Fleet

#61

Sort cars by position, calculate time to target, use stack to count fleets (slower cars create new fleets).

M

Evaluate Reverse Polish Notation

#62

Use stack: push numbers, pop two operands on operator, compute and push result.

E

Implement Queue using Stacks

#63

Use two stacks: push to stack1, pop/peek from stack2 (transfer when stack2 empty).

E

Implement Stack using Queues

#64

Use one queue: on push, add element then rotate queue size-1 times to move it to front.

M

Design Twitter

#65

Use HashMap for follows/tweets, merge k sorted lists with heap for news feed.

H

Find Median from Data Stream

#66

Use two heaps: max-heap for smaller half, min-heap for larger half, balance sizes for O(1) median.

E

Kth Largest Element in a Stream

#67

Maintain min-heap of size k; top element is always kth largest.

M

Top K Frequent Elements

#68

Count frequencies with HashMap, use min-heap of size k to track top k elements.

M

K Closest Points to Origin

#69

Use max-heap of size k tracking distances; maintain k closest points by comparing squared distances.

E

Meeting Rooms

#70

Sort intervals by start time, check if any meeting starts before previous ends.

M

Meeting Rooms II

#71

Sort by start time, use min-heap to track room end times, reuse rooms when available.

M

Non-overlapping Intervals

#72

Sort by end time, greedily keep intervals that end earliest to minimize removals.

M

Insert Interval

#73

Add non-overlapping intervals before newInterval, merge overlapping ones, add remaining intervals.

M

Merge Intervals

#74

Sort intervals by start time, merge overlapping ones by extending end time.

E

Move Zeroes

#75

Use write pointer to compact non-zero elements, then fill remaining positions with zeros.

Blind 75 - DSA Problems | dflo.io | dflo.io