Hacker News new | ask | show | jobs
by LecroJS 1464 days ago
Hi Darek thanks for doing this AMA. If you had to pick 3 leetcode problems that are most representative of those seen in google interviews, which would they be (can just be topics too if you feel google tests for certain data structures etc)
1 comments

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/. 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-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/) 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/). 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!

Thanks 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