📣 独立日限时特惠: VIP通行证立减$68
回复: 8
跳转到指定楼层
上一主题 下一主题
收起左侧

脸家昂赛特

全局:

2017(4-6月) 码农类General 博士 全职@meta - 内推 - 技术电面 Onsite  | | Pass | 在职跳槽

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
面完才发现有很多其实都是LC(变形)题

店面
hamming distance problems (
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
d) behavior + ~LC78

coding都要求写测试

上一篇:fresh grad面试facebook onsite会考design问题吗?
下一篇:领英昂赛特

本帖被以下淘专辑推荐:

🔗
flgt2014 2017-8-2 19:37:58 | 只看该作者
全局:
楼主 ‘分析HTML建DOM树‘这题 能否展开说说?具体有什么要求?
回复

使用道具 举报

🔗
bearicc 2017-8-2 23:50:25 | 只看该作者
全局:
楼主方便透露下system design准备了多久吗?给自己点信心。。
回复

使用道具 举报

🔗
bearicc 2017-8-3 00:59:15 | 只看该作者
全局:
自己试着做了一下第一题:
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <stack>
  5. #include <tuple>

  6. using namespace std;

  7. struct TreeNode {
  8.     string tag;
  9.     string content;
  10.     string tail;
  11.     vector<TreeNode*> next;
  12.     TreeNode(string tag):tag(tag) {}
  13. };

  14. pair<string, string> read(const string& html, int& i) {
  15.     const int N = html.size();
  16.     string text, tag;
  17.     while (i < N && html[i] != '<') {
  18.         text += html[i++];
  19.     }
  20.     ++i;
  21.     while (i < N && html[i] != '>') {
  22.         tag += html[i++];
  23.     }
  24.     ++i; // skip '>'
  25.     return {text, tag};
  26. }

  27. TreeNode* parse(string html) {
  28.     const int N = html.size();
  29.     int i = 0;
  30.     string text, tag;
  31.     stack<TreeNode*> mystack;

  32.     tie(text, tag) = read(html, i);
  33.     if (tag.empty()) {
  34.         return NULL;
  35.     }
  36.     TreeNode* root = new TreeNode(tag);
  37.     mystack.push(root);
  38.     while (i < N) {
  39.         tie(text, tag) = read(html, i);
  40.         if (tag[0] != '/') {
  41.             mystack.top()->content = text;
  42.             TreeNode* p = new TreeNode(tag);
  43.             mystack.top()->next.push_back(p);
  44.             mystack.push(p);
  45.         } else {
  46.             if (mystack.top()->next.empty()) {
  47.                 mystack.top()->content = text;
  48.             } else {
  49.                 mystack.top()->tail = text;
  50.             }
  51.             mystack.pop();
  52.         }
  53.     }
  54.     return root;
  55. }

  56. void test(TreeNode* root) {
  57.     if (!root) {
  58.         return;
  59.     }
  60.     cout << "(" << root->tag << ") (" << root->content << ") (" << root->tail << ")" << endl;
  61.     for (TreeNode* p: root->next) {
  62.         test(p);
  63.     }
  64. }

  65. int main() {
  66.     string html = "<html><head><title>Test</title></head><body>It works!</body></html>";
  67.     cout << html << endl;
  68.     TreeNode* root = parse(html);
  69.     test(root);
  70.     return 0;
  71. }
复制代码
回复

使用道具 举报

🔗
say543 2017-8-3 14:58:23 | 只看该作者
全局:
memcache + hashtable (system design) 是不是就是设计一个key value store 有什么考察点吗?
回复

使用道具 举报

🔗
csytracy 2017-8-4 03:09:42 | 只看该作者
全局:
谢谢lz分享!我最关心的是:系统设计怎么复习?有没有推荐的书?九章系统设计课已经上过了。大牛对fresh phd有什么建议吗?
回复

使用道具 举报

🔗
 楼主| laiptony 2017-8-5 21:00:24 | 只看该作者
全局:
say543 发表于 2017-8-3 14:58
memcache + hashtable (system design) 是不是就是设计一个key value store 有什么考察点吗?

I think communication is the most important key. Discuss with the interviewer and make sure we design a system that satisfy the given constraints.
回复

使用道具 举报

🔗
 楼主| laiptony 2017-8-5 21:10:28 | 只看该作者
全局:
bearicc 发表于 2017-8-2 23:50
楼主方便透露下system design准备了多久吗?给自己点信心。。

Hard to estimate how long I prepared because a lot of system design concepts I learned from work.
Most of the system design problems are open-ended, so communication is very important.
I treat system design interviews as "checking if we can design a system together if we are teammates" (and "figure out what the interviewer wants to hear").
回复

使用道具 举报

🔗
king_lm 2017-10-17 21:53:11 | 只看该作者
全局:
请问楼主a) parse HTML and build a DOM tree这题能给下example或者corner case么?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表