登录
  • #美国面经
  • #码农类general
  • #面试经验
  • #facebook

2019 Facebook 电面面经

confidentKilby
1695
7
2018年,当时H1b跪了,回国北京快手工作。干了一阵子感觉还是跳出国吧。就在LinkedIn上直接找了几个FB自己的recruiters,在新加坡,欧洲的都找了(美国不能直接去嘛)

在这儿写下电面的两道题,接下来会写onsite,offer 和 签证(我现在已经伦敦入职)

一共给我出了2道题

[mw_shl_code=bash,true]

1. Constructing Messages

Mapping = {

1 → ['A', 'B', 'C'],

2 → ['D', 'E', 'F'],

3 -> ['G', [hide=188]

本帖隐藏的内容需要积分高于 188 才可浏览,点击前往一亩三分地论坛阅读

t[]> nearestK(int[][] points, int K) {[br]
Queue<CordDist> minHeap = new PriorityQueue((cd1, cd2) -> (cd1.dist - cd2.dist));

for (int[] point : points) {[br]
long dist = point[0]*point[0] + point[1]*point[1];

minHeap.offer(new CordDist(point, dist));

}

List<int[]> kPoints = new ArrayList<>();[br]
while (K-- > 0) {

kPoints.add(minHeap.poll().cord);

}

return kPoints;

}

private class CordDist {

int[] cord;[br]
long dist;

public CordDist(int[] cord, long dist) {[br]
this.cord = cord; this.dist = dist;

}

}

[/mw_shl_code]

希望有帮助。有空我会写现场面试和谈offer,办签证等等。多谢!
7条回复
热度排序

发表回复