- Two Sum
- Best Time to Buy and Sell Stock
- Contains Duplicate
- Product of Array Except Self
- Maximum Subarray
- Maximum Product Subarray
- Find Minimum in Rotated Sorted Array
- Search in Rotated Sorted Array
- 3Sum
- Container With Most Water
- Climbing Stairs
- Coin Change
- Knapsack Problem 0-1 https://www.hackerearth.com/practice/notes/the-knapsack-problem/
- Longest Increasing Subsequence
- Longest Common Subsequence
- Word Break
- Combination Sum
- House Robber
- House Robber II
- Decode Ways
- Unique Paths
- Jump Game
- (Optional) Minimum number of cost tickets
- Clone Graph
- Course Schedule
- Pacific Atlantic Water Flow
- Number of Islands
- Longest Consecutive Sequence
- Alien Dictionary (Premium)
- Graph Valid Tree (Premium)
- Number of Connected Components in an Undirected Graph (Premium) https://www.geeksforgeeks.org/connected-components-in-an-undirected-graph/
- Cheapest Flights Within K Stops
- Insert Interval
- Merge Intervals
- Non-overlapping Intervals
- Meeting Rooms (Premium)
- Meeting Rooms II (Premium)
- Reverse a Linked List
- Detect Cycle in a Linked List
- Merge Two Sorted Lists
- Merge K Sorted Lists
- Remove Nth Node From End Of List
- Reorder List
- Longest Substring Without Repeating Characters
- Longest Repeating Character Replacement
- Minimum Window Substring
- Valid Anagram
- Group Anagrams
- Valid Parentheses
- Valid Palindrome
- Longest Palindromic Substring
- Palindromic Substrings
- Encode and Decode Strings (Premium)
- Maximum Depth of Binary Tree
- Same Tree
- Invert/Flip Binary Tree
- Binary Tree Maximum Path Sum
- Binary Tree Level Order Traversal
- Serialize and Deserialize Binary Tree
- Subtree of Another Tree
- Construct Binary Tree from Preorder and Inorder Traversal
- Validate Binary Search Tree
- Kth Smallest Element in a BST
- Lowest Common Ancestor of BST
- Implement Trie (Prefix Tree)
- Add and Search Word
- Word Search II
-
Ask Questions
-
Design Algorithm ( recommend to start with brute force -> then optimize )
-
Pseudocode ( Outline your thoughts)
-
Code
-
Test ( 1 Edge cases : negative, null, min, max )
( 2 General cases )
- Examplify -> start writing test examples
- Pattern Matching
- Simplify
- Base case and build
- Data structure and brainstorm
- Try to solve your own
- Write the code algorithm on paper
- Test your code
- Type your paper code into computer.
When solving problems, create a list to track mistakes you've made solving problems.
Before interview day, review the list of mistakes you usually made.
- Restate the question i.e. Check assumptions - ask questions and interviewer's expectations.
- Think of a simpler version of the problem with a few TEST CASES (e.g. array is sorted, using only a few numbers in array, or not constant space constraint using additional arrays/stacks/queues ).
- Come up with a brute-force solution first THINK OUT LOUD, mention that approach to interviewer asking, "Is the approach okay? Should I start writing the code?" and observe interviewer's body language and face. ( When you mention the overall approach before writing code, interviewer could say it is right or wrong. In that way, you don't waste time on rewriting the entire wrong code ). After brute force approach is mentioned, the interviewer usually asks if you can optimize the code, or he might ask you to start writing brute force approach and optimize it later. (Systems design interview: talk about different approach and the trade offs)
- Use some visualization.
- Test your solution on a few examples after coding.
A Googler wrote code on a paper to prepare for his interview. (Having a whiteboard at home is useful). He mentioned that after you solved enough problems around 200 LC problems, you will start to see the similar pattern: in a real interview, you might not have seen the problem before, the solving pattern would be similar. His distribution in practicing problem difficulty level is 30% easy, 60% medium, and 10% hard. Other people in big tech companies suggest to practice the problems by frequency occurrence of the problems specific to a company if you have a few days/one week to prepare for the interview.
- Elements of Programming Interview Online Judge Problems From Elements of Programming Interview Book
- Free Platform Pramp
- Free Platform Interviewing.io
- Paid Mock Interview
- Paid Mock Interview 2
- Paid Mock Interview 3
- Free Mock Online Assessment
- Topics to Study https://www.interviewbit.com/
- Interview Study Guide for Short Time Elements of Programming Interview Book
- Practice https://www.hackerrank.com
- Practice https://github.com/skygragon/leetcode-cli
- Competitive Programming https://www.topcoder.com/challenges/