Coding Interview Cheat Sheet
Coding Interview Cheat Sheet
Yes
Look for each
Problem asking for possible occurrence
sorting based on Bellman Ford Prefix Sum Sliding Window and count subarrays
Dijkstra's Algorithm containing that
special criteria Algorithm
occurrence
bisect_left(val) bisect_right(val) List of <index, val> TreeMap (Linked Monotonic Stack (not
Fast Pointer + Slow
Returns index of first Retruns index of first Overwrite the input pairs, excluding one PrefixTree (Trie) HashMap, Orded a stack, created with http://tiny.cc/e416wz
Pointer
item >= val item > val val Dictionary) a stack)
Coding Interview - Helpful Tips & Strategies
Helpful Python Features Spaced Repetition Strategy
If you're going to spend a lot of time preparing for coding interviews, I think it's worth while to learn Python. Start Here
It's easy to learn, easy to write, and has a lot of helpful features that can make it much easier to solve
problems. Below is a list of some helpful features in Python.
List comprehensions can save time by using much shorter syntax to create a list
Do a coding interview 20 minutes or less and no hints Done with that
Tutorial: http://tinyurl.com/2uek6vxt problem problem
The combination and permutation functions can save a lot of time by returning all the
combinations or permuations for a given list of elements
More than 20 minutes or need hints This strategy helps you get better at
Tutorial: http://tinyurl.com/3aan5kby
problems that you struggle with.
lru_cache can be used to quickly optimize certain functions. It is often used to solve
dynamic programming problems using a top down approach. Lookup solution for
Repeating the same problem after
Tutorial: http://tiny.cc/opj0wz problem waiting several days helps you
remember the solution to that
bisect_left and bisect_right are quick ways to binary serach a sorted list problem in the long term. If you do
3 days later
Tutorial: http://tiny.cc/pwj0wz this for problems that you either
Nested functions can help make your code readable and maintainable needed help solving or took you too
Implement solution long to solve, you will quickly
Tutorial: http://tiny.cc/jxj0wz (don't copy paste) improve in the areas that you are
You can easily return multiple values from a function as a tuple weak.
Tutorial: http://tiny.cc/dyj0wz
Key functions can be used to easily sort a list based on complex criteria
Set a reminder to
Tutorial: http://tiny.cc/dyj0wz redo this problem 3
days from now
G H I
G H I
http://tiny.cc/e416wz