Tuesday, August 26, 2014

My Notes

  1. Largest rectangle in histogram, max amount of trapped rain water
    1. When to use what sorting algorithm, why most of time quick sort is better than merge and heap sort
    2. Some good algorithms based upon trie
    3. Shortest string containing all 4-digit number (0000-9999, De Bruijn sequence)
    4. DP to minimize cost of cutting logs
    5. Print out all numbers containing 5 for a given n (groupon)
    6. Construct a long string by repeating a short string (amazon) 
    7. Fib series in O(logn)
    8. Huffman code
    9. Given two sorted array M and N with size m and n, each time pick one number from M and one number from N and add them them. Try to find the k smallest sum (given two ascending sorted array A and B)
    10. Dutch national flag problem
    11. Given an int array, find out if there exist 3 ints that can be used to contruct a triangle in O(nlogn). (51. google interview (3 numbers to form triangle))
    12. Given a set of movie starting / ending times, find out at most how many movies can be watched without conflict. Is that a graph problem? (51. google interview (reasonable but also requires some work)) 
    13. K-d tree to find out nearest neighbor in a given points set 
    14. Given n x n matrix with increasing rows and columns, find out k-th smallest element in O(nlogn)
    15. 平面N个点,找两点连线正好把点分到两半 
    16. Given a function of "int Read4096(char * buf)" implement "int ReadBytes(char * buf, num_bytes)"
    17. Sort linked list (better use merge sort rather than quick sort) 
    18. Mirror a BT 
    19. Count reverse ordered pair
      1. stackoverflow
      2. (53. facebook interview (how to use reverse ordered pair))

    No comments:

    Post a Comment