contents: restructure best practice questions into table

This commit is contained in:
Yangshun
2022-02-11 12:21:06 +08:00
parent 0571af51c8
commit e9b1e515e7

View File

@ -35,81 +35,95 @@ If you're running low on time, [AlgoMonster](https://shareasale.com/r.cfm?b=1873
In week 1, we will warm up by doing a mix of easy and medium questions on arrays and strings. Arrays and strings are the most common types of questions to be found in interviews; gaining familiarity with them will help in building strong fundamentals to better handle tougher questions. In week 1, we will warm up by doing a mix of easy and medium questions on arrays and strings. Arrays and strings are the most common types of questions to be found in interviews; gaining familiarity with them will help in building strong fundamentals to better handle tougher questions.
- [Two Sum](https://leetcode.com/problems/two-sum/) | Question | Difficulty | LeetCode |
- [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | :-- | --- | --- |
- [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | Two Sum | Easy | [Link](https://leetcode.com/problems/two-sum/) |
- [Valid Anagram](https://leetcode.com/problems/valid-anagram/) | Contains Duplicate | Easy | [Link](https://leetcode.com/problems/contains-duplicate/) |
- [Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) | Best Time to Buy and Sell Stock | Easy | [Link](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) |
- [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/) | Valid Anagram | Easy | [Link](https://leetcode.com/problems/valid-anagram/) |
- [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | Valid Parentheses | Easy | [Link](https://leetcode.com/problems/valid-parentheses/) |
- [3Sum](https://leetcode.com/problems/3sum/) | Maximum Subarray | Easy | [Link](https://leetcode.com/problems/maximum-subarray/) |
- [Merge Intervals](https://leetcode.com/problems/merge-intervals/) | Product of Array Except Self | Medium | [Link](https://leetcode.com/problems/product-of-array-except-self/) |
- [Group Anagrams](https://leetcode.com/problems/group-anagrams/) | 3Sum | Medium | [Link](https://leetcode.com/problems/3sum/) |
| Merge Intervals | Medium | [Link](https://leetcode.com/problems/merge-intervals/) |
| Group Anagrams | Medium | [Link](https://leetcode.com/problems/group-anagrams/) |
#### Optional #### Optional
- [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | Question | Difficulty | LeetCode |
- [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | :-- | --- | --- |
| Maximum Product Subarray | Medium | [Link](https://leetcode.com/problems/maximum-product-subarray/) |
| Search in Rotated Sorted Array | Medium | [Link](https://leetcode.com/problems/search-in-rotated-sorted-array/) |
## Week 2 - Data structures ## Week 2 - Data structures
The focus of week 2 is on linked lists, strings and matrix-based questions. The goal is to learn the common routines dealing with linked lists, traversing matrices and sequence analysis (arrays/strings) techniques such as sliding window, linked list traversal and matrix traversal. The focus of week 2 is on linked lists, strings and matrix-based questions. The goal is to learn the common routines dealing with linked lists, traversing matrices and sequence analysis (arrays/strings) techniques such as sliding window, linked list traversal and matrix traversal.
- [Reverse a Linked List](https://leetcode.com/problems/reverse-linked-list/) | Question | Difficulty | LeetCode |
- [Detect Cycle in a Linked List](https://leetcode.com/problems/linked-list-cycle/) | :-- | --- | --- |
- [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | Reverse a Linked List | Easy | [Link](https://leetcode.com/problems/reverse-linked-list/) |
- [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | Detect Cycle in a Linked List | Easy | [Link](https://leetcode.com/problems/linked-list-cycle/) |
- [Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | Container With Most Water | Medium | [Link](https://leetcode.com/problems/container-with-most-water/) |
- [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | Find Minimum in Rotated Sorted Array | Medium | [Link](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) |
- [Minimum Window Substring](https://leetcode.com/problems/minimum-window-substring/) | Longest Repeating Character Replacement | Medium | [Link](https://leetcode.com/problems/longest-repeating-character-replacement/) |
- [Number of Islands](https://leetcode.com/problems/number-of-islands/) | Longest Substring Without Repeating Characters | Medium | [Link](https://leetcode.com/problems/longest-substring-without-repeating-characters/) |
- [Remove Nth Node From End Of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | Number of Islands | Medium | [Link](https://leetcode.com/problems/number-of-islands/) |
- [Palindromic Substrings](https://leetcode.com/problems/palindromic-substrings/) | Remove Nth Node From End Of List | Medium | [Link](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) |
- [Pacific Atlantic Water Flow](https://leetcode.com/problems/pacific-atlantic-water-flow/) | Palindromic Substrings | Medium | [Link](https://leetcode.com/problems/palindromic-substrings/) |
| Pacific Atlantic Water Flow | Medium | [Link](https://leetcode.com/problems/pacific-atlantic-water-flow/) |
| Minimum Window Substring | Hard | [Link](https://leetcode.com/problems/minimum-window-substring/) |
## Week 3 - Non-linear data structures ## Week 3 - Non-linear data structures
The focus of week 3 is on non-linear data structures like trees, graphs and heaps. You should be familiar with the various tree traversal (in-order, pre-order, post-order) algorithms and graph traversal algorithms such as breadth-first search and depth-first search. In my experience, using more advanced graph algorithms (Dijkstra's and Floyd-Warshall) is quite rare and usually not necessary. The focus of week 3 is on non-linear data structures like trees, graphs and heaps. You should be familiar with the various tree traversal (in-order, pre-order, post-order) algorithms and graph traversal algorithms such as breadth-first search and depth-first search. In my experience, using more advanced graph algorithms (Dijkstra's and Floyd-Warshall) is quite rare and usually not necessary.
- [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | Question | Difficulty | LeetCode |
- [Invert/Flip Binary Tree](https://leetcode.com/problems/invert-binary-tree/) | :-- | --- | --- |
- [Non-overlapping Intervals](https://leetcode.com/problems/non-overlapping-intervals/) | Invert/Flip Binary Tree | Easy | [Link](https://leetcode.com/problems/invert-binary-tree/) |
- [Serialize and Deserialize Binary Tree](https://leetcode.com/problems/serialize-and-deserialize-binary-tree/) | Validate Binary Search Tree | Medium | [Link](https://leetcode.com/problems/validate-binary-search-tree/) |
- [Construct Binary Tree from Preorder and Inorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/) | Non-overlapping Intervals | Medium | [Link](https://leetcode.com/problems/non-overlapping-intervals/) |
- [Top K Frequent Elements](https://leetcode.com/problems/top-k-frequent-elements/) | Construct Binary Tree from Preorder and Inorder Traversal | Medium | [Link](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/) |
- [Clone Graph](https://leetcode.com/problems/clone-graph/) | Top K Frequent Elements | Medium | [Link](https://leetcode.com/problems/top-k-frequent-elements/) |
- [Course Schedule](https://leetcode.com/problems/course-schedule/) | Clone Graph | Medium | [Link](https://leetcode.com/problems/clone-graph/) |
- [Binary Tree Maximum Path Sum](https://leetcode.com/problems/binary-tree-maximum-path-sum/) | Course Schedule | Medium | [Link](https://leetcode.com/problems/course-schedule/) |
| Serialize and Deserialize Binary Tree | Hard | [Link](https://leetcode.com/problems/serialize-and-deserialize-binary-tree/) |
| Binary Tree Maximum Path Sum | Hard | [Link](https://leetcode.com/problems/binary-tree-maximum-path-sum/) |
#### Optional #### Optional
- [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | Question | Difficulty | LeetCode |
- [Same Tree](https://leetcode.com/problems/same-tree/) | :-- | --- | --- |
- [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | Maximum Depth of Binary Tree | Easy | [Link](https://leetcode.com/problems/maximum-depth-of-binary-tree/) |
- [Encode and Decode Strings (LeetCode Premium)](https://leetcode.com/problems/encode-and-decode-strings/) | Same Tree | Easy | [Link](https://leetcode.com/problems/same-tree/) |
| Binary Tree Level Order Traversal | Medium | [Link](https://leetcode.com/problems/binary-tree-level-order-traversal/) |
| Encode and Decode Strings | Medium | [Link](https://leetcode.com/problems/encode-and-decode-strings/) (Premium) |
## Week 4 - More data structures ## Week 4 - More data structures
Week 4 builds up on knowledge from previous weeks but questions are of increased difficulty. Expect to see such level of questions during interviews. You get more practice on more advanced data structures such as (but not exclusively limited to) heaps and tries which are less common but are still asked. Week 4 builds up on knowledge from previous weeks but questions are of increased difficulty. Expect to see such level of questions during interviews. You get more practice on more advanced data structures such as (but not exclusively limited to) heaps and tries which are less common but are still asked.
- [Add and Search Word](https://leetcode.com/problems/add-and-search-word-data-structure-design/) | Question | Difficulty | LeetCode |
- [Implement Trie (Prefix Tree)](https://leetcode.com/problems/implement-trie-prefix-tree/) | :-- | --- | --- |
- [Subtree of Another Tree](https://leetcode.com/problems/subtree-of-another-tree/) | Subtree of Another Tree | Easy | [Link](https://leetcode.com/problems/subtree-of-another-tree/) |
- [Kth Smallest Element in a BST](https://leetcode.com/problems/kth-smallest-element-in-a-bst/) | Lowest Common Ancestor of BST | Easy | [Link](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/) |
- [Lowest Common Ancestor of BST](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/) | Add and Search Word | Medium | [Link](https://leetcode.com/problems/add-and-search-word-data-structure-design/) |
- [Merge K Sorted Lists](https://leetcode.com/problems/merge-k-sorted-lists/) | Implement Trie (Prefix Tree) | Medium | [Link](https://leetcode.com/problems/implement-trie-prefix-tree/) |
- [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | Kth Smallest Element in a BST | Medium | [Link](https://leetcode.com/problems/kth-smallest-element-in-a-bst/) |
- [Insert Interval](https://leetcode.com/problems/insert-interval/) | Merge K Sorted Lists | Hard | [Link](https://leetcode.com/problems/merge-k-sorted-lists/) |
- [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | Find Median from Data Stream | Hard | [Link](https://leetcode.com/problems/find-median-from-data-stream/) |
- [Word Search II](https://leetcode.com/problems/word-search-ii/) | Insert Interval | Medium | [Link](https://leetcode.com/problems/insert-interval/) |
| Longest Consecutive Sequence | Medium | [Link](https://leetcode.com/problems/longest-consecutive-sequence/) |
| Word Search II | Hard | [Link](https://leetcode.com/problems/word-search-ii/) |
#### Optional #### Optional
- [Meeting Rooms (LeetCode Premium)](https://leetcode.com/problems/meeting-rooms/) | Question | Difficulty | LeetCode |
- [Meeting Rooms II (LeetCode Premium)](https://leetcode.com/problems/meeting-rooms-ii/) | :-- | --- | --- |
- [Alien Dictionary (LeetCode Premium)](https://leetcode.com/problems/alien-dictionary/) | Meeting Rooms | Easy | [Link](https://leetcode.com/problems/meeting-rooms/) (Premium) |
- [Graph Valid Tree (LeetCode Premium)](https://leetcode.com/problems/graph-valid-tree/) | Meeting Rooms II | Medium | [Link](https://leetcode.com/problems/meeting-rooms-ii/) (Premium) |
- [Number of Connected Components in an Undirected Graph (LeetCode Premium)](https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/) | Graph Valid Tree | Medium | [Link](https://leetcode.com/problems/graph-valid-tree/) (Premium) |
| Number of Connected Components in an Undirected Graph | Medium | [Link](https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/) (Premium) |
| Alien Dictionary | Hard | [Link](https://leetcode.com/problems/alien-dictionary/) (Premium) |
## Week 5 - Dynamic programming ## Week 5 - Dynamic programming
@ -119,16 +133,18 @@ DP questions can be hard to master and the best way to get better at them is...
Practically speaking the return of investment (ROI) on studying and practicing for DP questions is very low. Hence DP questions are less important/optional and you should only do them if you have time to spare and you're very keen to have all bases covered (and interviewing with Google). Practically speaking the return of investment (ROI) on studying and practicing for DP questions is very low. Hence DP questions are less important/optional and you should only do them if you have time to spare and you're very keen to have all bases covered (and interviewing with Google).
- [Climbing Stairs](https://leetcode.com/problems/climbing-stairs/) | Question | Difficulty | LeetCode |
- [Coin Change](https://leetcode.com/problems/coin-change/) | :-- | --- | --- |
- [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | Climbing Stairs | Easy | [Link](https://leetcode.com/problems/climbing-stairs/) |
- [Combination Sum](https://leetcode.com/problems/combination-sum-iv/) | Coin Change | Medium | [Link](https://leetcode.com/problems/coin-change/) |
- [House Robber](https://leetcode.com/problems/house-robber/) | Longest Increasing Subsequence | Medium | [Link](https://leetcode.com/problems/longest-increasing-subsequence/) |
- [House Robber II](https://leetcode.com/problems/house-robber-ii/) | Combination Sum | Medium | [Link](https://leetcode.com/problems/combination-sum-iv/) |
- [Decode Ways](https://leetcode.com/problems/decode-ways/) | House Robber | Medium | [Link](https://leetcode.com/problems/house-robber/) |
- [Unique Paths](https://leetcode.com/problems/unique-paths/) | House Robber II | Medium | [Link](https://leetcode.com/problems/house-robber-ii/) |
- [Jump Game](https://leetcode.com/problems/jump-game/) | Decode Ways | Medium | [Link](https://leetcode.com/problems/decode-ways/) |
- [Word Break Problem](https://leetcode.com/problems/word-break/) | Unique Paths | Medium | [Link](https://leetcode.com/problems/unique-paths/) |
| Jump Game | Medium | [Link](https://leetcode.com/problems/jump-game/) |
| Word Break | Medium | [Link](https://leetcode.com/problems/word-break/) |
#### Dynamic programming course #### Dynamic programming course