• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  面经

1 2 3 4 下一页
Mock G interview

只有注册用户登录后才能阅读该文。
posted @ 2019-12-16 10:53 neverlandly 阅读(9) 评论(0) 推荐(0)
Salesforce phone screen

只有注册用户登录后才能阅读该文。
posted @ 2019-11-09 05:09 neverlandly 阅读(4) 评论(0) 推荐(0)
Robinhood phone screen

只有注册用户登录后才能阅读该文。
posted @ 2019-11-08 03:04 neverlandly 阅读(2) 评论(0) 推荐(0)
Microsoft OA

摘要:没有想到要再存一个HashMap, appearance to character mapping 阅读全文
posted @ 2019-10-14 08:34 neverlandly 阅读(515) 评论(0) 推荐(0)
FB面经Prepare: Email User

摘要:账号之间如果有公共email就连边,我觉得要用hashMap, 存(email, user) pair 如果当前user的某个email在hashMap里出现过,当时是user1, 就看user和user1是否connected,否的话就要union,根据Union Find Union Find 阅读全文
posted @ 2017-03-18 02:30 neverlandly 阅读(851) 评论(1) 推荐(0)
FB面经Prepare: Merge K sorted Array

摘要:跟Merge K sorted lists不同在于,从PQ里poll出来以后不知道下一个需要被加入PQ的是哪一个 所以需要写一个wrapper class 阅读全文
posted @ 2017-03-17 04:45 neverlandly 阅读(684) 评论(0) 推荐(0)
FB面经 Prepare: Count Unique Island

摘要:方法可以是记录每次新的岛屿搜索的路径,left,right,up,down, 作为标志是否相同的key,存hashset 阅读全文
posted @ 2017-03-17 02:46 neverlandly 阅读(641) 评论(0) 推荐(0)
FB面经 Prepare: Make Parentheses valid

摘要:从左从右各scan一次 阅读全文
posted @ 2017-03-16 22:59 neverlandly 阅读(561) 评论(0) 推荐(0)
FB面经 Prepare: LCA of Deepest Nodes in Binary Tree

摘要:Recursion: 返回的时候返回lca和depth,每个node如果有大于一个子节点的depth相同就返回这个node,如果有一个子节点depth更深就返回个子节点lca,这个o(n)就可以了 Iteration: tree的recursion换成iteration处理,一般用stack都能解决 阅读全文
posted @ 2017-03-15 00:38 neverlandly 阅读(1576) 评论(0) 推荐(0)
FB面经 Prepare: K closest point to the origin

摘要:Based on bucket sort: Based on Quick Select 当然,还有的方法是维护一个size为k的最大堆 阅读全文
posted @ 2017-03-14 09:58 neverlandly 阅读(2108) 评论(0) 推荐(0)
FB面经prepare: 3 Window Max Sum

摘要:Follow Up: 这个其实可以优化到O(n)时间。建从左端到每个下标的最大window数组,再建从右端到每个下标的最大window数组。再从左往右走一遍所有的size k window,将其和与上一步建的两个数组一起加起来。遍历一遍取最大值即可。 阅读全文
posted @ 2017-03-14 05:39 neverlandly 阅读(630) 评论(0) 推荐(0)
Pocket Gems面经prepare: Diamond and Ruby

摘要:类似Ones and Zeroes Dp[i][j][k] = Max(dp[i-5][j][k] + 5*10, dp[i][j-5][k] + 5*5, dp[i][j][k-1] + 1*25) reduce了dimension,其实还有一个维度是前k个格子,直接用倒序省掉了这个维度 阅读全文
posted @ 2017-02-21 14:11 neverlandly 阅读(924) 评论(0) 推荐(0)
FB面经Prepare: Find Longest Path in a Multi-Tree

摘要:解法就是在子树里面找最大的两个(或一个,如果只有一个子树的话)高度加起来。 对于每一个treenode, 维护它的最高的高度和第二高的高度,经过该点的最大路径就是: 最高高度+第二高高度,然后return 最高高度 阅读全文
posted @ 2017-02-16 05:02 neverlandly 阅读(446) 评论(0) 推荐(0)
FB面经Prepare: Dot Product

摘要:1. two pointers 2. hashmap 3. 如果没有额外空间,如果一个很大,一个很小,适合scan小的,并且在大的里面做binary search 阅读全文
posted @ 2017-02-15 06:13 neverlandly 阅读(1624) 评论(0) 推荐(0)
FB面经prepare: Count the number of Vector

摘要:分析: 如果是binary search找每个char的上下界,worst case要找n次,时间复杂度O(nlogn) 所以考虑每次比较start point和start point + 2^n位置上的数,假如一样就continue,不一样就在区间里面binary search找上界,这样wors 阅读全文
posted @ 2017-02-15 03:29 neverlandly 阅读(445) 评论(0) 推荐(0)
G面经: Design Stock Price Display System

摘要:简单说来PriceUpdate就是添加新的(timestamp, price), Correction是改之前的(timestamp, price), 求实现当前high(), low(), last() LZ是用的Heap + HashMap, 特别问了时间复杂度(我猜到他想考heap的remov 阅读全文
posted @ 2017-02-06 08:06 neverlandly 阅读(608) 评论(0) 推荐(0)
U面经Prepare: Web Address

摘要:虽然我觉得这道题用set倒着来就可以解决,但是看到一个Trie的做法也很不错 这里TrieNode.val不再是char, 而是String. children array也变成了Map<String, TrieNode> 我的做法: 阅读全文
posted @ 2017-02-04 12:48 neverlandly 阅读(443) 评论(0) 推荐(0)
G面经Prepare: Longest All One Substring

摘要:这是一个简单版本of LC 424 Longest Repeating Character Replacement 又是Window, 又是Two Pointers Window还是采用每次都try to update left使得window valid, 每次都检查最大window 阅读全文
posted @ 2017-02-01 08:20 neverlandly 阅读(358) 评论(0) 推荐(0)
G面经Prepare: Print Zigzag Matrix

摘要:For instance, give row = 4, col = 5, print matrix in zigzag order like: [1, 8, 9, 16, 17] [2, 7, 10, 15, 18] [3, 6, 11, 14, 19] [4, 5, 12, 13, 20] 1 package GooglePhone; 2 3 import java.util... 阅读全文
posted @ 2017-02-01 01:09 neverlandly 阅读(374) 评论(0) 推荐(0)
FG面经: Interval问题合集

摘要:O(N) solution: 两个interval overlap条件: interval1.end >= interval2.start && interval1.start <= interval2.end 问:一个query数在不在已经加入的区间? 如果interval是sorted, 就可以 阅读全文
posted @ 2017-01-31 07:34 neverlandly 阅读(604) 评论(0) 推荐(0)

1 2 3 4 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3