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

Facebook 2015暑期实习面经

🔗
JamesJi 2015-4-11 05:17:27 | 只看该作者
全局:
emersonxsu 发表于 2015-4-10 12:04
会的,我刚刚问过HR...所以有点小慌. 今天店面.

那我还是不投他家实习了吧···好好准备明年full time再来···今天有个recruiter联系我要我投··
回复

使用道具 举报

🔗
Aprilyn 2015-4-11 05:28:35 | 只看该作者
全局:
JermaineDing 发表于 2015-4-10 00:52
我是三月下旬海投的,当时过了两天之后,安排我在4月7号面试。

哦哦,那肯定是简历很亮了,加油加油!
回复

使用道具 举报

🔗
emersonxsu 2015-4-11 07:21:32 | 只看该作者
全局:
JamesJi 发表于 2015-4-11 05:17
那我还是不投他家实习了吧···好好准备明年full time再来···今天有个recruiter联系我要我 ...

你也是phd intern么?
回复

使用道具 举报

🔗
JamesJi 2015-4-11 08:01:25 | 只看该作者
全局:
emersonxsu 发表于 2015-4-10 18:21
你也是phd intern么?

不是··我是ms··现在ms还没招满···
回复

使用道具 举报

🔗
offfer 2015-4-12 06:16:12 | 只看该作者
全局:
其实就是一个BFS..只是在expand node的时候check是否是gate或者wall.是wall就停止,是gate就添加到solution matrix...
回复

使用道具 举报

🔗
yanguango 2015-5-1 11:17:19 | 只看该作者
全局:
简单写了一下,在 BFS 的时候记录层数。
  1. #include <iostream>
  2. #include <string>
  3. #include <queue>
  4. #include <vector>
  5. using namespace std;

  6. void bfs(vector<vector<string>> &maze, int i, int j) {
  7.   queue<pair<int, int>> current;
  8.   queue<pair<int, int>> next;
  9.   vector<vector<bool>> visited(maze.size(),
  10.                                vector<bool>(maze[0].size(), false));
  11.   current.push(make_pair(i, j));
  12.   int steps = 0;
  13.   while (!current.empty()) {
  14.     int row = current.front().first;
  15.     int col = current.front().second;
  16.     current.pop();
  17.     visited[row][col] = true;

  18.     if (maze[row][col] != "G" &&
  19.         (maze[row][col] == "_" || stoi(maze[row][col]) > steps)) {
  20.       maze[row][col] = to_string(steps);
  21.     }
  22.     if (row > 0 && maze[row - 1][col] != "W" && maze[row - 1][col] != "G" &&
  23.         !visited[row - 1][col])
  24.       next.push(make_pair(row - 1, col));
  25.     if (row < maze.size() - 1 && maze[row + 1][col] != "W" &&
  26.         maze[row + 1][col] != "G" && !visited[row + 1][col])
  27.       next.push(make_pair(row + 1, col));
  28.     if (col > 0 && maze[row][col - 1] != "W" && maze[row][col - 1] != "G" &&
  29.         !visited[row][col - 1])
  30.       next.push(make_pair(row, col - 1));
  31.     if (col < maze[0].size() - 1 && maze[row][col + 1] != "W" &&
  32.         maze[row][col + 1] != "G" && !visited[row][col + 1])
  33.       next.push(make_pair(row, col + 1));

  34.     if (current.empty()) {
  35.       steps++;
  36.       swap(current, next);
  37.     }
  38.   }
  39. }

  40. void closestGates(vector<vector<string>> &maze) {
  41.   for (int i = 0; i < maze.size(); i++) {
  42.     for (int j = 0; j < maze[0].size(); j++) {
  43.       if (maze[i][j] == "G") bfs(maze, i, j);
  44.     }
  45.   }
  46. }

  47. int main(int argc, char const *argv[]) {
  48.   vector<vector<string>> maze;
  49.   maze.push_back(vector<string>{"_", "W", "G", "_"});
  50.   maze.push_back(vector<string>{"_", "_", "_", "W"});
  51.   maze.push_back(vector<string>{"_", "W", "_", "W"});
  52.   maze.push_back(vector<string>{"G", "W", "_", "_"});

  53.   closestGates(maze);

  54.   for (int i = 0; i < maze.size(); i++) {
  55.     for (int j = 0; j < maze[0].size(); j++) {
  56.       cout << maze[i][j] << " ";
  57.     }
  58.     cout << endl;
  59.   }
  60. }
复制代码
回复

使用道具 举报

🔗
沉-CS 2015-5-1 11:22:10 | 只看该作者
全局:
请问一下LZ的硕士是在哪个学校读的?
回复

使用道具 举报

🔗
 楼主| JermaineDing 2015-5-6 04:20:02 | 只看该作者
全局:
沉-CS 发表于 2015-5-1 11:22
请问一下LZ的硕士是在哪个学校读的?

Stevens Institute of Technology
回复

使用道具 举报

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

本版积分规则

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