2 ms·
Oh wow that's a really good question. I would pick the following but keep in mind it's important to go through all the different solutions. 1. Unique Paths 2.
by coachdarek 4y ago
Oh wow that's a really good question. I would pick the following but keep in mind it's important to go through all the different solutions.
1. Unique Paths 2. https://leetcode.com/problems/unique-paths-ii/ https://leetcode.com/problems/unique-paths-ii/. This problem can be solved with dynamic programming, graph traversal, and recursion.
2. Max Product of K Integers. Not exactly on Leetcode, but this one I really like. https://leetcode.com/problems/maximum-product-of-three-numbers/discuss/210329/how-to-solve-the-generalized-problem-maximum-product-of-k-numbers https://leetcode.com/problems/maximum-product-of-three-numbe.... It's essentially finding the maximum product obtained by selecting k numbers from a list of N integers (1 <= k <= N). This problem can be solved with a greedy algorithm, two pointer with sorting, using heap, and dynamic programming.
3. Word Ladder (https://leetcode.com/problems/word-ladder/ https://leetcode.com/problems/word-ladder/) I think it would be wrong not to include a string problem. I think there are a lot of different ways to solve this one. You could use a trie or treat the strings as a graph. There are also a lot of optimizations you can make depending on the length of words vs number of words.
Honorable Mention. LRU Cache (https://leetcode.com/problems/lru-cache/ https://leetcode.com/problems/lru-cache/). This may be the most common interview question asked at one point. Being able to execute a doubly ended linked list, leverage a dictionary, and implementing them all in a class with object oriented principles.
These don't cover everything, but give pretty good coverage of all the topics.
Hopefully that answers your question!
- LecroJS 4y agoThanks for taking the time for this! 1, 3, and the honorable mention are among my all time favorites. I haven’t seen either variation of 2 before — Going to do it right now