微软面试 | 书脊



微软面试 | 书脊

  1. 中年烙印, 一路微笑, 结果找不到面试房间, 上来聊简历, 然后开始做题, Search in Rotated Sorted Array 开始的不得了, 准备开始演戏, 各种聊做法, 各种聊思路, 顺利秒掉, follow up: Search in Rotated Sorted Array II 问run time, 让举例 worst case….这轮感觉不错.
  2. 中年烙印, 光头那种..上来不聊简历, 聊项目, 问了一些mysql的基础问题, 比如怎么同步, 怎么rollback. 还问了序列化好像…然后开始做题: max sum subtree 秒了, 然后问path, bfs秒了, 然后问如果是product呢…这个…我想了十分钟, 聊了思路 时间到了…感觉不好, 不过这不是最不好的.
  3. 年轻烙印,. 这轮最不好, 上来各种聊简历, 然后看我在做TA, 跟我说,他是普度的算法TA. 然后问我个特别简单的sort singly link list…上来merge sort 解决. 然后follow up, 你会不会用quicksort.. 挂就挂在quicksort了. 也是我没练习到的愿意, 那个partition各种bug..好不容易写完, 最后问复杂度, 还说错了, 因为link list最后的swap pivot的时候, 也要走一遍list….算了..反正就挂这轮了
  4. 老年烙印, 看着像老大, 带我屋子一言不发, 我怀疑是不是和前面的面试人吵架了…上来reverse link list.. 然后隔一个reverse一个..都是lc原题…没有开心的聊天, 一直让我问他问题..我从西雅图的天气聊到吃的..最后板着脸走了…
  5. 最奇葩的是,我刚出门就进门, 白人manager… 我以为我前几轮早挂了, 加上前一天很晚才到, 困的要死了…结果白人manager拉住, 上来就说我是manager…我靠…我还想上个厕所…都不好意思…..进屋, 直接问我怎么valid bst…秒掉后, 问我能不能不用递归做..能啊..都看到manager了, 还不能…秒了后,说, 我问你一个难点的问题..: 一个lru cache 大小为n, 做PRAM CREW. 就是多线程, 多读单写, 读写双互斥锁.  我老师搞这个的….上来就准备写code..被拉住, 聊思路, 毁了..聊了两个设计都不满意, 反正到最后我也不知道怎么设计好:
    1. 因为lru大小n, n肯定不会很大..所以我第一方案是写时锁整体,读时不锁..这个最naive的思路, 立刻被嘲讽说 太慢.
    2. 第二个方案是多加range 参数, 比如write(x,1,5) 就是写x 锁1-5 block.. 结果被嘲讽说worst case会线程饥渴….


Read full article from 微软面试 | 书脊


No comments:

Post a Comment

Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts