You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
172 lines
12 KiB
172 lines
12 KiB
---
|
|
id: best-practice-questions
|
|
title: Best practice questions
|
|
sidebar_label: 🔥 Best practice questions
|
|
description: The best practice questions to prepare for algorithmic coding interviews by the author of Blind 75 spread across a 5-week schedule
|
|
keywords: [algorithm, coding, interview, questions, leetcode, blind 75]
|
|
displayed_sidebar: docs
|
|
pagination_next: coding-interview-best-practices
|
|
---
|
|
|
|
import AlgorithmCourses from './\_courses/AlgorithmCourses.md'
|
|
|
|
import InDocAd from './\_components/InDocAd';
|
|
|
|
<head>
|
|
<title>Best practice questions by the author of Blind 75 | Tech Interview Handbook</title>
|
|
<meta property="og:title" content="Best practice questions by the author of Blind 75 | Tech Interview Handbook"/>
|
|
</head>
|
|
|
|
:::tip
|
|
|
|
As of April 2022, I've developed a [12-week study plan](./coding-interview-study-plan.md) which includes a curriculum for revision and practice questions. If you want to customize your own practice questions, I've also developed [Grind 75](https://www.techinterviewhandbook.org/grind75) which is a modern version of Blind 75 that you can customize.
|
|
|
|
:::
|
|
|
|
Hey there, the author of Blind 75 here 👋!
|
|
|
|
Practicing is the best way to prepare for coding interviews. LeetCode has over a thousand questions. Which should you practice? Hence years ago, I curated a list of the most important 75 questions on [LeetCode](https://leetcode.com). Many other LeetCode questions are a mash of the techniques from these individual questions. I used this list in my last job hunt to only do the important questions.
|
|
|
|
I [shared this list on Blind](https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-100-LeetCode-Questions-to-Save-Your-Time-OaM1orEU) by extracting the questions from [my freeCodeCamp article](https://www.freecodecamp.org/news/coding-interviews-for-dummies-5e048933b82b/) to save peoples' time when revising and someone reposted this list on [the LeetCode forum](https://leetcode.com/discuss/general-discussion/460599/blind-75-leetcode-questions). It somehow blew up and became super famous in the coding interview scene, people even gave it a name - **Blind 75**. The Blind 75 questions as a LeetCode list can be found [here](https://leetcode.com/list/xi4ci4ig/).
|
|
|
|
Years later, I further distilled the list down into only 50 questions and spread them across a 5-week schedule. Here is the suggested schedule for revising and practicing algorithm questions on LeetCode. Sign up for an account if you don't already have one, it's critical to your success in interviewing!
|
|
|
|
When practicing, you are advised to treat it like a real coding interview and check through thoroughly before submitting. Consider even manually coming up with some test cases and running through them to verify correctness!
|
|
|
|
I've created a [LeetCode list](https://leetcode.com/list/9h4lgwl2) for the following questions (except the Premium ones). Feel free to use it to track your practice progress.
|
|
|
|
:::tip Expert tip
|
|
|
|
If you're running low on time, [AlgoMonster](https://shareasale.com/r.cfm?b=1873647&u=3114753&m=114505&urllink=&afftrack=) aims to help you ace the technical interview **in the shortest time possible**. By Google engineers, [AlgoMonster](https://shareasale.com/r.cfm?b=1873647&u=3114753&m=114505&urllink=&afftrack=) uses a data-driven approach to teach you most useful key question patterns and has contents to help you quickly revise basic data structures and algorithms. **Learn and understand patterns, not memorize answers!**
|
|
|
|
:::
|
|
|
|
## Week 1 - Sequences
|
|
|
|
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.
|
|
|
|
| Question | Difficulty | LeetCode |
|
|
| :-- | --- | --- |
|
|
| Two Sum | Easy | [Link](https://leetcode.com/problems/two-sum/) |
|
|
| Contains Duplicate | Easy | [Link](https://leetcode.com/problems/contains-duplicate/) |
|
|
| Best Time to Buy and Sell Stock | Easy | [Link](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) |
|
|
| Valid Anagram | Easy | [Link](https://leetcode.com/problems/valid-anagram/) |
|
|
| Valid Parentheses | Easy | [Link](https://leetcode.com/problems/valid-parentheses/) |
|
|
| Maximum Subarray | Easy | [Link](https://leetcode.com/problems/maximum-subarray/) |
|
|
| Product of Array Except Self | Medium | [Link](https://leetcode.com/problems/product-of-array-except-self/) |
|
|
| 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
|
|
|
|
| Question | Difficulty | LeetCode |
|
|
| :-- | --- | --- |
|
|
| 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
|
|
|
|
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.
|
|
|
|
| Question | Difficulty | LeetCode |
|
|
| :-- | --- | --- |
|
|
| Reverse a Linked List | Easy | [Link](https://leetcode.com/problems/reverse-linked-list/) |
|
|
| Detect Cycle in a Linked List | Easy | [Link](https://leetcode.com/problems/linked-list-cycle/) |
|
|
| Container With Most Water | Medium | [Link](https://leetcode.com/problems/container-with-most-water/) |
|
|
| Find Minimum in Rotated Sorted Array | Medium | [Link](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) |
|
|
| Longest Repeating Character Replacement | Medium | [Link](https://leetcode.com/problems/longest-repeating-character-replacement/) |
|
|
| Longest Substring Without Repeating Characters | Medium | [Link](https://leetcode.com/problems/longest-substring-without-repeating-characters/) |
|
|
| Number of Islands | Medium | [Link](https://leetcode.com/problems/number-of-islands/) |
|
|
| Remove Nth Node From End Of List | Medium | [Link](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) |
|
|
| 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/) |
|
|
|
|
<InDocAd/>
|
|
|
|
## 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.
|
|
|
|
| Question | Difficulty | LeetCode |
|
|
| :-- | --- | --- |
|
|
| Invert/Flip Binary Tree | Easy | [Link](https://leetcode.com/problems/invert-binary-tree/) |
|
|
| Validate Binary Search Tree | Medium | [Link](https://leetcode.com/problems/validate-binary-search-tree/) |
|
|
| Non-overlapping Intervals | Medium | [Link](https://leetcode.com/problems/non-overlapping-intervals/) |
|
|
| Construct Binary Tree from Preorder and Inorder Traversal | Medium | [Link](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/) |
|
|
| Top K Frequent Elements | Medium | [Link](https://leetcode.com/problems/top-k-frequent-elements/) |
|
|
| Clone Graph | Medium | [Link](https://leetcode.com/problems/clone-graph/) |
|
|
| 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
|
|
|
|
| Question | Difficulty | LeetCode |
|
|
| :-- | --- | --- |
|
|
| Maximum Depth of Binary Tree | Easy | [Link](https://leetcode.com/problems/maximum-depth-of-binary-tree/) |
|
|
| 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 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.
|
|
|
|
| Question | Difficulty | LeetCode |
|
|
| :-- | --- | --- |
|
|
| Subtree of Another Tree | Easy | [Link](https://leetcode.com/problems/subtree-of-another-tree/) |
|
|
| Lowest Common Ancestor of BST | Easy | [Link](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/) |
|
|
| Implement Trie (Prefix Tree) | Medium | [Link](https://leetcode.com/problems/implement-trie-prefix-tree/) |
|
|
| Add and Search Word | Medium | [Link](https://leetcode.com/problems/add-and-search-word-data-structure-design/) |
|
|
| Kth Smallest Element in a BST | Medium | [Link](https://leetcode.com/problems/kth-smallest-element-in-a-bst/) |
|
|
| Merge K Sorted Lists | Hard | [Link](https://leetcode.com/problems/merge-k-sorted-lists/) |
|
|
| Find Median from Data Stream | Hard | [Link](https://leetcode.com/problems/find-median-from-data-stream/) |
|
|
| 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
|
|
|
|
| Question | Difficulty | LeetCode |
|
|
| :-- | --- | --- |
|
|
| Meeting Rooms | Easy | [Link](https://leetcode.com/problems/meeting-rooms/) (Premium) |
|
|
| Meeting Rooms II | Medium | [Link](https://leetcode.com/problems/meeting-rooms-ii/) (Premium) |
|
|
| 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) |
|
|
|
|
<InDocAd/>
|
|
|
|
## Week 5 - Dynamic programming
|
|
|
|
Week 5 focuses on Dynamic Programming (DP) questions. Personally as an interviewer, I'm not a fan of DP questions as they are not really applicable to practical scenarios and frankly if I were made to do the tough DP questions during my interviews I'd not have gotten the job. However, companies like Google still ask DP questions and if joining Google is your dream, DP is unavoidable.
|
|
|
|
DP questions can be hard to master and the best way to get better at them is... you guessed it - practice! Be familiar with the concepts of memoization and backtracking.
|
|
|
|
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).
|
|
|
|
| Question | Difficulty | LeetCode |
|
|
| :-- | --- | --- |
|
|
| Climbing Stairs | Easy | [Link](https://leetcode.com/problems/climbing-stairs/) |
|
|
| Coin Change | Medium | [Link](https://leetcode.com/problems/coin-change/) |
|
|
| Longest Increasing Subsequence | Medium | [Link](https://leetcode.com/problems/longest-increasing-subsequence/) |
|
|
| Combination Sum | Medium | [Link](https://leetcode.com/problems/combination-sum-iv/) |
|
|
| House Robber | Medium | [Link](https://leetcode.com/problems/house-robber/) |
|
|
| House Robber II | Medium | [Link](https://leetcode.com/problems/house-robber-ii/) |
|
|
| Decode Ways | Medium | [Link](https://leetcode.com/problems/decode-ways/) |
|
|
| 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
|
|
|
|
- [Grokking the Dynamic Programming Patterns for Coding Interviews](https://www.educative.io/courses/grokking-dynamic-programming-patterns-for-coding-interviews?aff=x23W)
|
|
|
|
## Quality courses
|
|
|
|
If you want more structured algorithms practice, I recommend the following courses:
|
|
|
|
<AlgorithmCourses />
|