Blind 75 + Amazon top 50 Flashcards

Memorize the best questions

1
Q

1.Two Sum

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

2.Longest Substring Without Repeating Characters

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

3.Longest Palindromic Substring

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

4.Container With Most Water

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

5.3Sum

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

6.Remove Nth Node From End of List

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

7.Valid Parentheses

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

8.Merge Two Sorted Lists

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

9.Merge k Sorted Lists

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

10.Search in Rotated Sorted Array

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

11.Combination Sum

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

12.Trapping Rain Water

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

13.Rotate Image

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

14.Group Anagrams

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

15.Maximum Subarray

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

16.Spiral Matrix

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

17.Jump Game

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

18.Merge Intervals

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

19.Insert Interval

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

20.Unique Paths

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

21.Climbing Stairs

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

22.Set Matrix Zeroes

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

23.Minimum Window Substring

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

24.Word Search

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

25.Decode Ways

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

26.Validate Binary Search Tree

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

27.Recover Binary Search Tree

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

28.Same Tree

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

29.Binary Tree Level Order Traversal

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

30.Maximum Depth of Binary Tree

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

31.Construct Binary Tree from Preorder and Inorder Traversal

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

32.Best Time to Buy and Sell Stock

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

33.Binary Tree Maximum Path Sum

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

34.Valid Palindrome

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

35.Word Ladder II

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

36.Word Ladder

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

37.Longest Consecutive Sequence

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

38.Clone Graph

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

39.Copy List with Random Pointer

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

40.Word Break

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

41.Word Break II

A

Time complexity is legit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

42.Linked List Cycle

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

43.Reorder List

A

Empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

44.LRU Cache

A

Empty

45
Q

45.Maximum Product Subarray

A

Empty

46
Q

46.Find Minimum in Rotated Sorted Array

A

Empty

47
Q

47.Min Stack

A

Empty

48
Q

48.Reverse Bits

A

Empty

49
Q

49.Number of 1 Bits

A

Empty

50
Q

50.House Robber

A

Empty

51
Q

51.Number of Islands*******

A

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
Q

52.Reverse Linked List

A

Empty

53
Q

53.Course Schedule

A

Empty

54
Q

54.Implement Trie (Prefix Tree)

A

Empty

55
Q

55.Course Schedule II

A

Empty

56
Q

56.Add and Search Word - Data structure design

A

Empty

57
Q

57.Word Search II

A

Best soln, one submitted 6/4, best for time and ease to implement

58
Q

58.House Robber II

A

Empty

59
Q

59.Contains Duplicate

A

Empty

60
Q

60.Invert Binary Tree

A

Empty

61
Q

61.Basic Calculator II

A

Empty

62
Q

62.Kth Smallest Element in a BST

A

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
Q

63.Lowest Common Ancestor of a Binary Search Tree

A

Empty

64
Q

64.Product of Array Except Self

A

Empty

65
Q

65.Sliding Window Maximum

A

Empty

66
Q

66.Search a 2D Matrix II

A

Empty

67
Q

67.Valid Anagram

A

Empty

68
Q

68.Meeting Rooms

A

Empty

69
Q

69.Meeting Rooms II

A

Also 2 ptr solution

70
Q

70.Graph Valid Tree****

A

TODO: Union Find

71
Q

71.Missing Number

A

Empty

72
Q

72.Alien Dictionary

A

Empty

73
Q

73.Encode and Decode Strings

A

Empty

74
Q

74.Integer to English Words********

A

MARKED AS 5 BC I DON’T WANT TO MEMORIZE IT RN

75
Q

75.Find Median from Data Stream

A

Empty

76
Q

76.Serialize and Deserialize Binary Tree

A

Empty

77
Q

77.Longest Increasing Subsequence

A

Empty

78
Q

78.Coin Change

A

Empty

79
Q

79.Number of Connected Components in an Undirected Graph***

A

TODO: Union Find

80
Q

80.Counting Bits

A

Empty

81
Q

81.Top K Frequent Elements*****

A

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
Q

82.Sum of Two Integers

A

Empty

83
Q

83.Insert Delete GetRandom O(1)

A

Empty

84
Q

84.Pacific Atlantic Water Flow

A

Empty

85
Q

85.Longest Repeating Character Replacement

A

Empty

86
Q

86.Non-overlapping Intervals

A

Empty

87
Q

87.LFU Cache****

A

TODO B/C Hard

88
Q

88.Concatenated Words

A

OJ is fucked up, my TLE submitted 6/9 is correct

Could do top-down version, seems easy

89
Q

89.Encode and Decode TinyURL

A

Empty

90
Q

90.Subtree of Another Tree

A

Empty

91
Q

91.Design In-Memory File System

A

Empty

92
Q

92.Design Search Autocomplete System

A

Empty

93
Q

93.Palindromic Substrings

A

Empty

94
Q

94.Top K Frequent Words

A
  1. sorting nlog(n)
  2. minheap nlog(k) (complicated by python heap module)
  3. bucket sort + trie O(n)
95
Q

95.Number of Distinct Islands

A

Empty

96
Q

96.Flood Fill

A

Empty

97
Q

97.Partition Labels

A

Empty

98
Q

98.Most Common Word

A

Empty

99
Q

99.All Nodes Distance K in Binary Tree

A

Empty

100
Q

100.Snakes and Ladders

A

Empty

101
Q

101.Reorder Data in Log Files

A

Empty

102
Q

103.K Closest Points to Origin*******

A

TODO: Quickselect

103
Q

104.Rotting Oranges

A

Empty

104
Q

105.Path With Maximum Minimum Value

A

Empty

105
Q

107.Minimum Cost to Connect Sticks

A

Empty

106
Q

108.Longest Common Subsequence

A

Empty

107
Q

109.Critical Connections in a Network

A

Empty

108
Q

110.Search Suggestions System

A

Empty