回复: 22
跳转到指定楼层
上一主题 下一主题
收起左侧

Facebook Production Engineer Intern

全局:

2016(1-3月) 码农类General 硕士 实习@meta - 内推 - HR筛选 技术电面  | | Pass | 应届毕业生
帮朋友发帖。
之前面了fb production engineer intern,现在将面经发一下感谢地里
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
但希望能帮助到需要的人。

感谢地里的好人。好人一生平安!



本帖子中包含更多资源

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

x

评分

参与人数 4大米 +67 收起 理由
berdde + 1 欢迎分享你知道的情况,会给更多积分奖励!
a8272322 + 3 坚持的不错,再接再厉!
真淘蛮 + 3 感谢分享!
夏虫不知雪花 + 60

查看全部评分


上一篇:提前跟面试官线下联系好不好?
下一篇:Flatiron Health面经

本帖被以下淘专辑推荐:

推荐
friendlybo 2018-3-9 23:58:57 | 只看该作者
全局:
自己下午闲着没事干写了一下恐龙题,可直接在coderpad上运行

#include <iostream>
#include <string>
#include <sstream>
#include <map>
#include <unordered_map>
#include <queue>
#include <cmath>
using namespace std;

/*
dinosaurs question

You will be supplied with two data files in CSV format. The first file contains
statistics about various dinosaurs. The second file contains additional data.

Given the following formula,

speed = ((STRIDE_LENGTH / LEG_LENGTH) - 1) * SQRT(LEG_LENGTH * g)
Where g = 9.8 m/s^2 (gravitational constant)
(normal code)
Write a program to read in the data files from disk, it must then print the names
of only the bipedal dinosaurs from fastest to slowest. Do not print any other information.

$ cat dataset1.csv
NAME,LEG_LENGTH,DIET
Hadrosaurus,1.2,herbivore
Struthiomimus,0.92,omnivore
Velociraptor,1.0,carnivore
Triceratops,0.87,herbivore
Euoplocephalus,1.6,herbivore
Stegosaurus,1.40,herbivore
Tyrannosaurus Rex,2.5,carnivore

$ cat dataset2.csv
NAME,STRIDE_LENGTH,STANCE
Euoplocephalus,1.87,quadrupedal
Stegosaurus,1.90,quadrupedal
Tyrannosaurus Rex,5.76,bipedal
Hadrosaurus,1.4,bipedal
Deinonychus,1.21,bipedal
Struthiomimus,1.34,bipedal
Velociraptor,2.72,bipedal
*/
class dinosaurs {
public:
  
/*** calculate speed  
speed = ((STRIDE_LENGTH / LEG_LENGTH) - 1) * SQRT(LEG_LENGTH * g)***/
  
  float speed(float leg_length, float stride_length) {
    return (stride_length / leg_length - 1) * sqrt(leg_length * 9.8);
  }
  
  vector <string> read_line(string s) {
    vector <string> m;
    s.push_back(',');
    string t;
    for(int i = 0; i < (int)s.size(); ++i) {
      if (s[i] == ',') {
        m.push_back(t);
        t.clear();
      }
      else t += s[i];
    }
    return m;
  }
  vector <string> calculate(vector <string> file1, vector <string> file2) {
    map <string, float> m2;
    for (int i = 0; i < (int)file2.size(); ++i) {
      vector <string> tmp = read_line(file2[i]);
      if (tmp[2] == "bipedal") m2[tmp[0]] = stof(tmp[1]);
    }
    map <string, float> m;
    for (int i = 0; i < (int)file1.size(); ++i) {
      vector <string> tmp = read_line(file1[i]);
      if (m2.count(tmp[0])) m[tmp[0]] = speed(m2[tmp[0]], stof(tmp[1]));
    }
    priority_queue <pair <float, string>> q;
    for (auto it : m) {
      q.push({it.second, it.first});
    }
    vector <string> res;
    while (!q.empty()) {
      auto t = q.top(); q.pop();
      res.push_back(t.second);
    }
    return res;
  }
};
int main () {
  vector <string> file1 = { "NAME,LEG_LENGTH,DIET",
                  "Hadrosaurus,1.2,herbivore",
                  "Struthiomimus,0.92,omnivore",
                  "Velociraptor,1.0,carnivore",
                  "Triceratops,0.87,herbivore",
                  "Euoplocephalus,1.6,herbivore",
                  "Stegosaurus,1.40,herbivore",
                  "Tyrannosaurus Rex,2.5,carnivore"};
  vector <string> file2 = {"NAME,STRIDE_LENGTH,STANCE",
                  "Euoplocephalus,1.87,quadrupedal",
                  "Stegosaurus,1.90,quadrupedal",
                  "Tyrannosaurus Rex,5.76,bipedal",
                  "Hadrosaurus,1.4,bipedal",
                  "Deinonychus,1.21,bipedal",
                  "Struthiomimus,1.34,bipedal",
                  "Velociraptor,2.72,bipedal"  
                 };
  dinosaurs d;
  vector <string> res = d.calculate(file1, file2);
  cout <<"The names of only the bipedal dinosaurs from fastest to slowest is:" <<endl;
  for (auto it : res)
    cout << it << endl;
  return 0;
}
回复

使用道具 举报

推荐
sealove999 2016-4-3 06:41:33 | 只看该作者
全局:
Dinosaur
  1. public class Solution {
  2.   int speed(int arg1, int arg2) {
  3.     return arg1 * arg2;
  4.   }

  5.   public List<String> dinosaur(String[] file1, String[] file2) {
  6.     Map<String, Integer> name_arg1 = new HashMap<>();
  7.     for (String s : file2) {
  8.       String ss[] = s.trim().split(",\\s*");
  9.       if (ss[2].equals("twoLegs")) {
  10.         name_arg1.put(ss[0], Integer.parseInt(ss[1]));
  11.       }
  12.     }
  13.     Map<String, Integer> name_speed = new HashMap<>();
  14.     for (String s : file1) {
  15.       String ss[] = s.trim().split(",\\s*");
  16.       if (name_arg1.containsKey(ss[0])) {
  17.         name_speed.put(ss[0], speed(name_arg1.get(ss[0]), Integer.parseInt(ss[1])));
  18.       }
  19.     }
  20.     Queue<String> maxheap = new PriorityQueue<>((x, y) -> name_speed.get(y) - name_speed.get(x));
  21.     maxheap.addAll(name_speed.keySet());
  22.     List<String> ret = new ArrayList<>();
  23.     while (!maxheap.isEmpty()) {
  24.       ret.add(maxheap.poll());
  25.     }
  26.     return ret;
  27.   }

  28.   public static void main(String[] args) {
  29.     String[] file1 = new String[] {
  30.         "dinosaur1,  30",
  31.         "dinosaur2,  40",
  32.         "dinosaur4,  30"
  33.     };
  34.     String[] file2 = new String[] {
  35.         "dinosaur1,  10, twoLegs",
  36.         "dinosaur2,  10, twoLegs",
  37.         "dinosaur3,  30, twoLegs",
  38.         "dinosaur4,  30, fourLegs"
  39.     };
  40.     Solution ss = new Solution();
  41.     for (String name : ss.dinosaur(file1, file2)) {
  42.       System.out.println(name);
  43.     }
  44.     return;
  45.   }
  46. }
复制代码
回复

使用道具 举报

推荐
sealove999 2016-4-3 06:40:58 | 只看该作者
全局:
Goat
  1. public class Solution {
  2.   public String GoatLatinLanguage(String s) {
  3.     String[] ss = s.trim().split("\\s+");
  4.     for (int i = 0; i < ss.length; i++) {
  5.       if (ss[i].matches("^[AEIOUaeiou]")) {
  6.         ss[i] = ss[i] + "ma";
  7.       } else {
  8.         ss[i] = ss[i].substring(1) + ss[i].charAt(0);
  9.       }
  10.       StringBuilder sb = new StringBuilder();
  11.       for (int j = 0; j <= i; j++) {
  12.         sb.append("a");
  13.       }
  14.       ss[i] += sb.toString();
  15.     }
  16.     return String.join(" ", ss);
  17.   }

  18.   public static void main(String[] args) {
  19.     Solution ss = new Solution();
  20.     System.out.println(ss.GoatLatinLanguage("I speak Goat Latin"));
  21.     return;
  22.   }
  23. }
复制代码
回复

使用道具 举报

无效楼层,该帖已经被删除
🔗
张维力 2016-3-24 03:26:48 | 只看该作者
全局:
不好意思,手滑了。。。请问读文件是怎么个读法?用BufferedReader 和 FileReader这种东西吗?
回复

使用道具 举报

🔗
jsjtzyy 2016-4-1 20:52:11 | 只看该作者
全局:
楼主真棒,希望以后在玉米地多多提携!
回复

使用道具 举报

🔗
sealove999 2016-4-3 06:07:55 | 只看该作者
全局:
张维力 发表于 2016-3-24 03:26
不好意思,手滑了。。。请问读文件是怎么个读法?用BufferedReader 和 FileReader这种东西吗?

同问同问同问同问同问同问
回复

使用道具 举报

🔗
KedamonoBaby 2016-9-3 09:10:02 | 只看该作者
全局:
谢谢,正在准备该intern电面中,好紧张。。

补充内容 (2016-9-3 09:23):
up主的pdf良心!
回复

使用道具 举报

🔗
Doyoulikeme4i 2016-11-22 00:18:14 | 只看该作者
全局:
博主,我看你把16spring的uiuc mcs defer到了16fall能不能私信教我一下怎么实现的....我也有这个打算...
回复

使用道具 举报

🔗
henryylb 2016-11-30 01:34:29 | 只看该作者
全局:
感谢楼主的总结,希望能有帮助!
回复

使用道具 举报

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

本版积分规则

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