📣 黑五网一特惠|VIP一年通行证5折,蓝莓、Offer多多同步特惠
回复: 12
跳转到指定楼层
上一主题 下一主题
收起左侧

奈飞全套挂经

全局:

2025(10-12月) 码农类General 硕士 全职@netflix - 内推 - Onsite  | 😐 Neutral 😣 Hard | Fail | 在职跳槽
面了两次Data Platform组,一次内推,一次海投,因为用的不同名字和邮箱,给了两次机会,但都是Onsite挂了,看来还是和奈妃差了点缘分,回馈地里攒攒人品

第一次
店面 Weighted Cache
Onsite
多线程轮: 考一个加锁问题,忘了具体题目,现场写的磕磕绊绊的。是跟 double checked locking 相关的
系统设计: Config Deployment System, roll out config across the globe,有点CICD的感觉

Coding: Inverted Index:
package netflix;

import java.util.*;

public class OptimalDocumentSearch {
  private final List<String> documents;
  // word -> (docId -> list of positions)
  private final Map<String, Map<Integer, List<Integer>>> index;
  public OptimalDocumentSearch(List<String> documents) {
    this.documents = documents;
    this.index = new HashMap<>();
    buildIndex();
  }

  private void buildIndex() {
    for (int docId = 0; docId < documents.size(); docId++) {
      String[] words = documents.get(docId)
          .toLowerCase()
          .split("\\s+");
      for (int pos = 0; pos < words.length; pos++) {
        String word = words[pos];
        index
            .computeIfAbsent(word, k -> new HashMap<>())
            .computeIfAbsent(docId, k -> new ArrayList<>())
            .add(pos);
      }
    }
  }

  public List<String> search(String phrase) {
    String[] words = phrase.toLowerCase().split("\\s+");
    if (words.length == 1) {
      return singleWordSearch(words[0]);
    }
    return phraseSearch(words);
  }

  private List<String> singleWordSearch(String word) {
    Map<Integer, List<Integer>> posting =
        index.getOrDefault(word, Collections.emptyMap());
    List<String> results = new ArrayList<>();
    for (int docId : posting.keySet()) {
      results.add(documents.get(docId));
    }
    return results;
  }

  // Must contain all words, get all documents for first word, iterate through each doc and positions of first word in that doc
  // Check if following words also show up in this doc in the consecutive positions
  private List<String> phraseSearch(String[] words) {
    if (!index.containsKey(words[0])) {
      return Collections.emptyList();
    }
    Map<Integer, List<Integer>> firstPosting = index.get(words[0]);
    List<String> results = new ArrayList<>();
    // Check only documents that contain the first word
    for (int docId : firstPosting.keySet()) {
      List<Integer> candidatePositions = firstPosting.get(docId);
      boolean matchFound = false;
      for (int pos : candidatePositions) {
        if (matchesAtPosition(docId, pos, words)) {
          matchFound = true;
          break;
        }
      }
      if (matchFound) {
        results.add(documents.get(docId));
      }
    }
    return results;
  }

  private boolean matchesAtPosition(int docId, int startPos, String
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
2() {
        Map<String, Object> json = new HashMap<>();
        json.put("fname", "masked_first_name");
        json.put("lname", "masked_last_name");
        
        Map<String, Object> contacts = new HashMap<>();
        contacts.put("home", "12345");
        json.put("contacts", contacts);
        
        return json;
    }
   
    private static Map<String, Object> createTestJson3() {
        Map<String, Object> json = new HashMap<>();
        json.put("fname", "masked_first_name");
        
        Map<String, Object> lname = new HashMap<>();
        lname.put("cell", "+1(888).999.9999");
        lname.put("home", "+1(555).333.3333");
        json.put("lname", lname);
        
        Map<String, Object> contacts = new HashMap<>();
        contacts.put("cell", "+1(999).999.9999");
        contacts.put("home", "+1(333).333.3333");
        json.put("contacts", contacts);
        
        return json;
    }
   
    private static Map<String, Object> createTestJson4() {
        Map<String, Object> json = new HashMap<>();
        json.put("fname", "masked_first_name");
        json.put("lname", "masked_last_name");
        
        
        Map<String, Object> contacts = new HashMap<>();
        contacts.put("cell", "+1(999).999.9999");
        contacts.put("home", "+1(333).333.3333");
        json.put("contacts", contacts);
        
        return json;
    }

}

本帖子中包含更多资源

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

x

评分

参与人数 11大米 +37 收起 理由
爱丽丝和鲍勃 + 20 谢谢分享!
umd2011 + 2 给你点个赞!
匿名用户-MUD7Z + 1 给你点个赞!
微信用户_1253f94 + 1 欢迎分享你知道的情况,会给更多积分奖励!
ssxxzyzybaba + 1 给你点个赞!

查看全部评分


上一篇:Google 26NG r1
下一篇:Roblox全套挂经
推荐
418Teapot 2026-4-1 13:08:12 | 只看该作者
全局:
匿名用户 发表于 2026-3-31 07:55
我两次都是bq挂
而且都是一轮bq比较水 另一轮细节狂魔

求分享下bq细节🙏
回复

使用道具 举报

地里匿名用户
推荐
匿名用户-6INYB  2026-4-1 10:54:55
楼主面的是5还是4  
请问这个 Json Parser 是原题吗 是面镜的原题吗 dp org的题目实在是太少了
回复

使用道具 举报

地里匿名用户
推荐
匿名用户-VBB6P  2026-4-4 08:03:50
所以楼主是on-site coding的第二问出了bug 但是还是move forward到了两轮bq是吗?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-QMFCU  2026-3-31 22:28:47
patpat 请问楼主觉得挂在哪一轮了?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-B1QV8  2026-3-31 22:55:34
我两次都是bq挂
而且都是一轮bq比较水 另一轮细节狂魔

评分

参与人数 1大米 +2 收起 理由
418Teapot + 2 楼主/层主请继续!

查看全部评分

回复

使用道具 举报

全局:
匿名用户 发表于 2026-03-31 07:55:34
我两次都是bq挂
而且都是一轮bq比较水 另一轮细节狂魔
好奇可以分享一下BQ问了哪些问题吗
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-DYPLC  2026-4-1 07:49:47
所以说换个邮箱和名字是可以拿到second chance的?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-GYFO4  2026-4-2 13:12:17
在并发性筛选轮中都问了些什么?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-GYFO4  2026-4-2 13:14:16
面试:关于“带并发支持的加权缓存”的问题,是在并发轮面试中被问到的吗?
回复

使用道具 举报

🔗
CodingMuggle 2026-4-4 00:16:35 | 只看该作者
全局:
已加米,请问能具体说说weighted cache题的要求吗
回复

使用道具 举报

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

本版积分规则

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