Blind 75 + Amazon top 50 Flashcards
Memorize the best questions (108 cards)
1
Q
1.Two Sum
A
Empty
2
Q
2.Longest Substring Without Repeating Characters
A
Empty
3
Q
3.Longest Palindromic Substring
A
Empty
4
Q
4.Container With Most Water
A
Empty
5
Q
5.3Sum
A
Empty
6
Q
6.Remove Nth Node From End of List
A
Empty
7
Q
7.Valid Parentheses
A
Empty
8
Q
8.Merge Two Sorted Lists
A
Empty
9
Q
9.Merge k Sorted Lists
A
Empty
10
Q
10.Search in Rotated Sorted Array
A
Empty
11
Q
11.Combination Sum
A
Empty
12
Q
12.Trapping Rain Water
A
Empty
13
Q
13.Rotate Image
A
Empty
14
Q
14.Group Anagrams
A
Empty
15
Q
15.Maximum Subarray
A
Empty
16
Q
16.Spiral Matrix
A
Empty
17
Q
17.Jump Game
A
Empty
18
Q
18.Merge Intervals
A
Empty
19
Q
19.Insert Interval
A
Empty
20
Q
20.Unique Paths
A
Empty
21
Q
21.Climbing Stairs
A
Empty
22
Q
22.Set Matrix Zeroes
A
Empty
23
Q
23.Minimum Window Substring
A
Empty
24
Q
24.Word Search
A
Empty
25
25. Decode Ways
Empty
26
26. Validate Binary Search Tree
Empty
27
27. Recover Binary Search Tree
Empty
28
28. Same Tree
Empty
29
29. Binary Tree Level Order Traversal
Empty
30
30. Maximum Depth of Binary Tree
Empty
31
31. Construct Binary Tree from Preorder and Inorder Traversal
Empty
32
32. Best Time to Buy and Sell Stock
Empty
33
33. Binary Tree Maximum Path Sum
Empty
34
34. Valid Palindrome
Empty
35
35. Word Ladder II
Empty
36
36. Word Ladder
Empty
37
37. Longest Consecutive Sequence
Empty
38
38. Clone Graph
Empty
39
39. Copy List with Random Pointer
Empty
40
40. Word Break
Empty
41
41. Word Break II
Time complexity is legit
42
42. Linked List Cycle
Empty
43
43. Reorder List
Empty
44
44. LRU Cache
Empty
45
45. Maximum Product Subarray
Empty
46
46. Find Minimum in Rotated Sorted Array
Empty
47
47. Min Stack
Empty
48
48. Reverse Bits
Empty
49
49. Number of 1 Bits
Empty
50
50. House Robber
Empty
51
51. Number of Islands*********
TODO: UNION FIND
If you don't want to modify array, use visited set. If don't want extra space, make the visited on the grid to '0' or '#'
52
52. Reverse Linked List
Empty
53
53. Course Schedule
Empty
54
54. Implement Trie (Prefix Tree)
Empty
55
55. Course Schedule II
Empty
56
56. Add and Search Word - Data structure design
Empty
57
57. Word Search II
Best soln, one submitted 6/4, best for time and ease to implement
58
58. House Robber II
Empty
59
59. Contains Duplicate
Empty
60
60. Invert Binary Tree
Empty
61
61. Basic Calculator II
Empty
62
62. Kth Smallest Element in a BST
Followup:
add self.numLeft = #values in left subtree + node itself
start at root.
if root.numLeft == k: return root
if root.numLeft > k: root = root.left
if root.numLeft < k: k - = root.numLeft; root = root.right
63
63. Lowest Common Ancestor of a Binary Search Tree
Empty
64
64. Product of Array Except Self
Empty
65
65. Sliding Window Maximum
Empty
66
66. Search a 2D Matrix II
Empty
67
67. Valid Anagram
Empty
68
68. Meeting Rooms
Empty
69
69. Meeting Rooms II
Also 2 ptr solution
70
70. Graph Valid Tree************
TODO: Union Find
71
71. Missing Number
Empty
72
72. Alien Dictionary
Empty
73
73. Encode and Decode Strings
Empty
74
74. Integer to English Words********************************
MARKED AS 5 BC I DON'T WANT TO MEMORIZE IT RN
75
75. Find Median from Data Stream
Empty
76
76. Serialize and Deserialize Binary Tree
Empty
77
77. Longest Increasing Subsequence
Empty
78
78. Coin Change
Empty
79
79. Number of Connected Components in an Undirected Graph*******
TODO: Union Find
80
80. Counting Bits
Empty
81
81. Top K Frequent Elements*************
TODO: QUICKSELECT!
1. Min heap: O(nlog(k))
2. Max heap: O(n + klog(n))
3. Quick Select: O(n) O(n^2) worst
4. Bucket Sort: O(n)
82
82. Sum of Two Integers
Empty
83
83. Insert Delete GetRandom O(1)
Empty
84
84. Pacific Atlantic Water Flow
Empty
85
85. Longest Repeating Character Replacement
Empty
86
86. Non-overlapping Intervals
Empty
87
87. LFU Cache******************
TODO B/C Hard
88
88. Concatenated Words
OJ is fucked up, my TLE submitted 6/9 is correct
| Could do top-down version, seems easy
89
89. Encode and Decode TinyURL
Empty
90
90. Subtree of Another Tree
Empty
91
91. Design In-Memory File System
Empty
92
92. Design Search Autocomplete System
Empty
93
93. Palindromic Substrings
Empty
94
94. Top K Frequent Words
1. sorting nlog(n)
3. minheap nlog(k) (complicated by python heap module)
4. bucket sort + trie O(n)
95
95. Number of Distinct Islands
Empty
96
96. Flood Fill
Empty
97
97. Partition Labels
Empty
98
98. Most Common Word
Empty
99
99. All Nodes Distance K in Binary Tree
Empty
100
100. Snakes and Ladders
Empty
101
101. Reorder Data in Log Files
Empty
102
103. K Closest Points to Origin***************
TODO: Quickselect
103
104. Rotting Oranges
Empty
104
105. Path With Maximum Minimum Value
Empty
105
107. Minimum Cost to Connect Sticks
Empty
106
108. Longest Common Subsequence
Empty
107
109. Critical Connections in a Network
Empty
108
110. Search Suggestions System
Empty