85 hours total
1

Add Binary

Implement a function to add two binary strings and return the result as a binary string.

AlgorithmsStringseasyGoogle · Meta
2

Balanced Binary Tree

Implement a function to determine if a binary tree is height-balanced.

AlgorithmsBinary TreeseasyGoogle · Meta
3

Balanced Brackets

Implement a function to determine if a string contains balanced brackets.

AlgorithmsData StructureseasyGoogle · Meta · Amazon
4

Binary Search

Implement a function to search for a target in a sorted array using binary search.

AlgorithmsBinary SearcheasyGoogle · Meta
5

Binary Search Tree Lowest Common Ancestor

Implement a function to find the LCA in a binary search tree.

AlgorithmsData StructureseasyGoogle · Amazon · Meta
6

Binary Tree Maximum Depth

Implement a function to find the maximum depth of a binary tree.

AlgorithmsTreeseasyGoogle · Meta
7

Binary Tree Subtree

Implement a function to check if a binary tree is a subtree of another binary tree.

AlgorithmsTreeseasyGoogle · Meta
8

Bit Counting

Implement a function to find number of set bits from 0 to n.

AlgorithmsBit ManipulationeasyGoogle · Meta
9

Bit Reversal

Implement a function to flip the order of the bits in a given number.

AlgorithmsBit ManipulationeasyGoogle · Stripe
10

Count Set Bits in a Binary Number

Implement a function to find set bits in binary representation of a given integer.

AlgorithmsBit ManipulationeasyGoogle · Meta
11

Diameter of Binary Tree

Implement a function to find the diameter (longest path) of a binary tree.

AlgorithmsBinary TreeseasyGoogle · Meta
12

Find Duplicates in Array

Implement a function to check if there are any duplicate numbers in the array.

AlgorithmsData StructureseasyGoogle · Amazon · Meta
13

First Bad Version

Implement a function to find the first bad version using minimum API calls.

AlgorithmsBinary SearcheasyGoogle · Meta
14

Flip Binary Tree

Implement a function to flip the nodes in a binary tree.

AlgorithmsData StructureseasyGoogle · Amazon · Meta
15

Flood Fill

Implement a function to perform flood fill on an image grid.

AlgorithmsBFSeasyGoogle · Meta
16

Linked List Detect Cycle

Implement a function to detect if there are cycles in a linked list.

AlgorithmsLinked ListseasyGoogle · Meta
17

Linked List Reversal

Implement a function to reverse a linked list.

AlgorithmsLinked ListseasyGoogle · Meta
18

Linked Lists Combine Two Sorted

Implement a function to combine two sorted linked lists.

AlgorithmsLinked ListseasyGoogle · Meta
19

Longest Palindrome

Implement a function to find the length of the longest palindrome that can be built from given letters.

AlgorithmsHash MapeasyGoogle · Meta
20

Middle of the Linked List

Implement a function to find the middle node of a linked list.

AlgorithmsLinked ListseasyGoogle · Meta
21

Most Common Elements

Implement a function to determine the most common elements in an integer array.

AlgorithmsData StructureseasyGoogle · Amazon · Meta
22

Optimal Stock Trading

Implement a function to find the maximum profit achievable by buying and selling a stock once.

AlgorithmsDynamic ProgrammingeasyGoogle · Amazon · Meta · Stripe
23

Pair Sum

Implement a function to find two numbers within an array of integers that add up to a target integer.

AlgorithmsHash MapeasyGoogle · Amazon · Meta · Stripe
24

Ransom Note

Implement a function to check if a ransom note can be formed from a magazine.

AlgorithmsHash MapeasyGoogle · Meta
25

Staircase Climbing Combinations

Implement a function to find the number of ways to reach the top of a staircase.

AlgorithmsDynamic ProgrammingeasyGoogle · Amazon · Meta
26

String Anagram

Implement a function to determine if two strings are anagrams of each other.

AlgorithmsStringseasyGoogle · Amazon · Meta
27

String Palindrome

Implement a function to determine if a string is a palindrome.

AlgorithmsStringseasyGoogle · Meta
28

01 Matrix

Implement a function to find the distance of each cell to the nearest 0 in a binary matrix.

AlgorithmsBFSmediumGoogle · Meta
29

Accounts Merge

Implement a function to merge accounts that share common emails.

AlgorithmsUnion FindmediumGoogle · Meta
30

Array Product Excluding Current

Implement a function to find the product of elements in an array excluding the current element.

AlgorithmsData StructuresmediumGoogle · Amazon · Meta · Stripe
31

Binary Search Tree Kth Smallest Element

Implement a function to find the kth smallest node in a BST.

AlgorithmsData StructuresmediumGoogle · Amazon · Meta
32

Binary Tree Level Order Traversal

Implement a function to find the level order traversal of a binary tree.

AlgorithmsData StructuresmediumGoogle · Amazon · Meta
33

Binary Tree Rebuilding from Preorder and Inorder Traversals

Implement a function to construct a binary tree from preorder and inorder traversals.

AlgorithmsTreesmediumGoogle · Meta
34

Binary Tree Right Side View

Implement a function to return the right side view of a binary tree.

AlgorithmsBinary TreesmediumGoogle · Meta
35

Combinations for Target Sum

Implement a function to count combinations that sum to the target.

AlgorithmsBacktrackingmediumGoogle · Meta
36

Count Islands in a Grid

Implement a function to count distinct islands in a 2D binary grid.

AlgorithmsGraphsmediumGoogle · Amazon · Meta
37

Course Dependency

Implement a function to check if all courses can be completed given prerequisites.

AlgorithmsGraphsmediumGoogle · Meta · Stripe
38

Decode Message

Implement a function to count ways to decode a numeric string.

AlgorithmsDynamic ProgrammingmediumGoogle · Meta · Stripe
39

Disjoint Intervals

Implement a function to determine the minimum amount of removals to get non-overlapping intervals.

AlgorithmsGreedymediumGoogle · Stripe
40

Distinct Paths in Grid

Implement a function to calculate distinct paths for a robot moving on an m x n grid.

AlgorithmsDynamic ProgrammingmediumGoogle · Amazon · Meta
41

Evaluate Reverse Polish Notation

Implement a function to evaluate an expression in Reverse Polish Notation.

AlgorithmsStacksmediumGoogle · Meta
42

Find All Anagrams in a String

Implement a function to find all starting indices of anagrams of p in string s.

AlgorithmsSliding WindowmediumGoogle · Meta
43

Find Element in Rotated Array

Implement a function to find an integer in a rotated sorted array.

AlgorithmsBinary SearchmediumGoogle · Amazon · Meta
44

Find the Longest Palindromic Substring

Implement a function to find the longest palindromic substring.

AlgorithmsStringsmediumGoogle · Meta · Shopify
45

Find Word in Grid

Implement a function to check the existence of a word in a grid.

AlgorithmsGraphsmediumGoogle · Amazon · Meta
46

Graph Clone

Implement a function to deeply clone a connected and undirected graph.

AlgorithmsGraphsmediumMeta · Google
47

Graph Count Connected Components

Implement a function to count connected components in a graph.

AlgorithmsGraphsmediumGoogle · Meta
48

Is the Graph a Tree

Implement a function to determine if a graph is a valid tree.

AlgorithmsGraphsmediumGoogle · Meta
49

K Closest Points to Origin

Implement a function to find the k closest points to the origin.

AlgorithmsSortingmediumGoogle · Meta
50

Letter Combinations of a Phone Number

Implement a function to return all letter combinations that a phone number could represent.

AlgorithmsBacktrackingmediumGoogle · Meta
51

Longest Increasing Subsequence

Implement a function to find the length of the longest increasing subsequence.

AlgorithmsDynamic ProgrammingmediumGoogle · Meta · Stripe
52

Longest Non-repeating Substring

Implement a function to find the length of longest substring with unique characters.

AlgorithmsSliding WindowmediumGoogle · Meta · Stripe
53

Longest Repeating Substring After Replacements

Implement a function to find the longest uniform substring after up to k replacements.

AlgorithmsSliding WindowmediumGoogle · Meta
54

Lowest Common Ancestor of a Binary Tree

Implement a function to find the lowest common ancestor of two nodes in a binary tree.

AlgorithmsBinary TreesmediumGoogle · Meta
55

Matrix Rotation

Implement a function to rotate the given matrix by 90 degrees.

AlgorithmsMatrixmediumGoogle · Meta
56

Matrix Spiral Traversal

Implement a function to traverse the matrix in spiral order.

AlgorithmsMatrixmediumGoogle · Meta · Shopify
57

Matrix Zeroing

Implement a function to set matrix rows and columns to zero.

AlgorithmsMatrixmediumGoogle · Meta
58

Maximum Sum in Contiguous Array

Implement a function to find the subarray with the maximum sum.

AlgorithmsData StructuresmediumGoogle · Amazon · Stripe
59

Maximum Water Trapped Between Walls

Implement a function to find the maximum water volume between two walls in an array of walls.

AlgorithmsTwo PointersmediumGoogle · Meta · Stripe
60

Merge New Interval

Implement a function to insert a new interval into a sorted list of non-overlapping intervals, merging if necessary.

AlgorithmsSortingmediumGoogle · Meta · Amazon
61

Merge Overlapping Intervals

Implement a function to merge overlapping intervals.

AlgorithmsSortingmediumGoogle · Amazon · Meta · Stripe
62

Minimum Coins for Change

Implement a function to return minimum coins needed to make the given amount.

AlgorithmsDynamic ProgrammingmediumGoogle · Stripe · Meta
63

Minimum Height Trees

Implement a function to find all root labels that give minimum height trees.

AlgorithmsBFSmediumGoogle · Meta
64

Palindromic Substrings

Implement a function to count all palindromic substrings in a string.

AlgorithmsStringsmediumGoogle · Meta
65

Partition Equal Subset Sum

Implement a function to determine if an array can be partitioned into two subsets with equal sum.

AlgorithmsDynamic ProgrammingmediumGoogle · Meta
66

Permutations

Implement a function to generate all permutations of an array of distinct integers.

AlgorithmsBacktrackingmediumGoogle · Meta
67

Rotting Oranges

Implement a function to find the minimum time for all oranges to rot.

AlgorithmsBFSmediumGoogle · Meta
68

Segment Words

Implement a function to check whether a string be formed from dictionary words.

AlgorithmsDynamic ProgrammingmediumGoogle · Meta · Stripe
69

Sort Colors

Implement a function to sort an array of 0s, 1s, and 2s in-place (Dutch National Flag).

AlgorithmsTwo PointersmediumGoogle · Meta
70

String Anagram Groups

Implement a function to group an array of strings into anagrams.

AlgorithmsHash MapmediumGoogle · Meta · Stripe
71

String to Integer (atoi)

Implement a function to convert a string to a 32-bit signed integer (like C's atoi).

AlgorithmsStringsmediumGoogle · Meta
72

Subsets

Implement a function to generate all possible subsets (the power set) of an array.

AlgorithmsBacktrackingmediumGoogle · Meta
73

Sum Without Addition

Implement a function to find the sum of two integers without using + and - operator.

AlgorithmsBit ManipulationmediumGoogle · Meta
74

Task Coordination

Implement a function to find minimum intervals for tasks with cooldown.

AlgorithmsHash MapmediumGoogle · Meta · Stripe
75

Trie (Prefix Tree)

Implement a trie-prefix-tree with insert, search, and starts with functionality.

AlgorithmsData StructuresmediumGoogle · Amazon · Meta
76

Triplet Sum

Implement a function to find all unique triplets with distinct indices that sum to 0.

AlgorithmsTwo PointersmediumGoogle · Amazon · Meta · Stripe
77

Validate Binary Search Tree

Implement a function to validate whether a binary tree is a valid binary search tree.

AlgorithmsData StructuresmediumGoogle · Amazon · Meta
78

Basic Calculator

Implement a basic calculator to evaluate a string expression with +, -, and parentheses.

AlgorithmsStackhardGoogle · Meta
79

Binary Tree Equal

Implement a function to determine whether two binary trees are equal.

AlgorithmsData StructureshardGoogle · Amazon · Meta
80

Binary Tree Maximum Total Path

Implement a function to find the maximum total of nodes in a binary tree path.

AlgorithmsTreeshardMeta · Google
81

Delete Nth Node from End of Linked List

Implement a function to delete the nth node from the end of a linked list.

AlgorithmsLinked ListshardMeta · Google
82

End of Array Reachable

Implement a function to determine if the end of the array is reachable.

AlgorithmsData StructureshardGoogle · Amazon · Meta
83

Extraterrestrial Language

Implement a function to verify and return an extraterrestrial language's alphabet order.

AlgorithmsGraphshardMeta · Google
84

Find Missing Number in Sequence

Implement a function to find the missing element in a sorted array.

AlgorithmsData StructureshardGoogle · Amazon · Meta
85

Find Words in Grid

Implement a function to find all the words present in the grid.

AlgorithmsGraphshardGoogle · Amazon · Meta
86

Largest Rectangle in Histogram

Find the area of the largest rectangle in a histogram.

AlgorithmsStackhardGoogle · Meta
87

Linked Lists Combine K Sorted

Implement a function to combine k sorted linked lists.

AlgorithmsLinked ListshardMeta · Google · Stripe
88

Longest Common Subsequence

Implement a function to find the longest common subsequence in two strings.

AlgorithmsDynamic ProgramminghardGoogle · Meta · Stripe
89

Longest Consecutive Number Sequence

Implement a function to find the length of the longest consecutive number sequence.

AlgorithmsHash SethardGoogle · Meta · Stripe
90

Maximum Product in Contiguous Array

Implement a function to find the subarray which has the largest product.

AlgorithmsData StructureshardGoogle · Amazon · Meta
91

Maximum Profit in Job Scheduling

Find the maximum profit you can achieve by scheduling non-overlapping jobs.

AlgorithmsDynamic ProgramminghardGoogle · Meta
92

Meeting Calendar

Implement a function to check if all meetings can be attended without conflict.

AlgorithmsSortinghardGoogle · Amazon · Meta
93

Minimum Meeting Rooms Needed

Implement a function to find the minimum number of conference rooms required to hold all meetings.

AlgorithmsSortinghardGoogle · Amazon · Meta · Stripe
94

Neighborhood Theft

Implement a function to find maximum money to rob without alerting police.

AlgorithmsDynamic ProgramminghardGoogle · Amazon · Meta
95

Neighborhood Theft (Circular)

Implement a function to find maximum money to rob in circular houses without alerting police.

AlgorithmsDynamic ProgramminghardGoogle · Amazon · Meta
96

Number Stream Median

Implement a function to find the median of a dynamic stream of integers.

AlgorithmsData StructureshardGoogle · Amazon · Meta · Stripe
97

Ocean Flow

Implement a function returning cells with water flow to both oceans.

AlgorithmsGraphhardGoogle · Amazon · Meta
98

Rearrange Linked List

Implement a function to rearrange the nodes in a linked list.

AlgorithmsLinked ListshardMeta · Google
99

Shortest Substring Containing Characters

Implement a function to return the smallest substring of a string containing all characters from another string.

AlgorithmsSliding WindowhardGoogle · Meta · Stripe
100

Smallest Element in Rotated Sorted Array

Implement a function to find the smallest element in rotated sorted array.

AlgorithmsBinary SearchhardGoogle · Amazon · Meta
101

Trapping Rain Water

Compute how much rainwater can be trapped between elevation bars.

AlgorithmsArrayshardGoogle · Meta · Stripe
102

Word Finder

Implement a data structure where words can be added and support wildcard searching.

AlgorithmsData StructureshardGoogle · Amazon · Meta
103

Word Ladder

Find the length of the shortest transformation sequence from beginWord to endWord.

AlgorithmsBFShardGoogle · Meta