获得信息来源有V2EX帖子:https://www.v2ex.com/t/754005
原来在eBay的同事Eric也帮忙内推:
如上明显2个方向:
https://time.geekbang.org/dailylesson/detail/100020744
巧的是这个HR我之前在19年就联系过,她有印象;上面这个精美的招聘图就是她做得
谈到我应聘他们的 AI ml平台,他们的数据源也是交易产生的,可以用于AI风控
我对应他们有大数据经验,另外还有全栈经验(但是要想好选哪个方向)
和hr说的点,why PayPal:
PayPal也有股票,3年拿完,每年一次vet,vet时间比eBay短点。
到傍晚约了下周五面试(留点时间复习下)
挑个最合适的项目,我介绍了mep项目的可视化,和性能调优cache,用redash原来的api
You are given an array of binary strings strs and two integers m and n.
Return the size of the largest subset of strs such that there are at most m 0's and n 1's in the subset.
A set x is a subset of a set y if all elements of x are also elements of y.
strs = ["10", "0001", "111001", "1", "0"], m = 5, n = 3
//calc all the 0s 1s
//dp: aux stack
const sovle = function(strs) {
const dp = [];
//init dp matrix
for (let i=0; i<=m; i++) {
const item = [];
for (let j=0; j<=n; j++) {
item.push(0);
}
dp.push(item);
}
//dp calc
for (let i=0; i= zeros; i--) {
for (let j = n; j >= ones; j--) {
//dp迁跃:要么维持原状,要么从dp[i-zeros][j-ones]加上当前这个str结果更大的,那么算入
dp[i][j] = Math.max(1 + dp[i-zeros][j-ones], dp[i][j]);
}
}
}
return dp[m][n];
}
const counts = function(str) {
let zeros = 0;
let ones = 0;
for (let i=0; i
问了我做的面广,那倾向于那个呢?我回答java
但是如下写法始终不够简洁且出错,后来受了启发:leetcode75 荷兰国旗问题终于理解,对应paypal的第二题,快排相关
终于复盘成功,正确解法应该是:先是荷兰国旗或者是3-way-partition,然后再sort
For lu wen
100 正整数 奇左 从大到小 ; 偶右 从小到大
//思路:sort -》 双指针 O(1)空间复杂度
import java.util.Arrays;
public class Main {
private static void swap(int[] input, int i, int j) {
if (i == j) return;
int tmp = input[i];
input[i] = input[j];
input[j] = tmp;
}
public static void main(String[] args) {
System.out.println("main");
int[] input = {1,2,3,4,5,6,7,8};
Arrays.sort(input);
System.out.println(Arrays.toString(input));
int pleft = -1;
int pright = input.length;
int pproc = input.length - 1;
while (pleft < pright) {
if (input[pproc] % 2 == 0) {
pright--;
swap(input, pright, pproc);
} else {
pleft++;
swap(input, pleft, pproc);
}
if (pleft == pproc) break;
pproc--;
}
System.out.println(Arrays.toString(input));
}
}
以上写的还是有点问题,最终挂了,第二个工作日得到了通知,应该还是算法题的问题:
Dear Zezhou,
Thanks for you participating PayPal interview and do appreciate your effort and time. We appreciate the opportunity to review your background, qualifications, and eligibility. The excellent qualifications of superior candidates, such as you, have made our selection process a difficult one.
Due to the selection requirements, we thought you are a good candidate but not the most suitable one on current stage. If we have any other suitable position, we will contact with you if you still have interest in joining PayPal.
We will keep your CV into our talent pool and contact you for any further potential suitable position. If you are interested in PayPal position, here are some way you can get the information:
Search the position in PayPal career page. Pls. click here to get it.
Join PayPal linkedin community
Once again, thank you for considering PayPal as your potential employer and we wish you every success to your career development.
HR: 之前团队觉得你不是特别合适,你还愿意尝试其他团队吗
我:非常乐意
GDS(global data science) GDS做的事情比之前 ai ml团队稍微上层一些些
可以上领英搜索GDS,了解下他们团队的背景信息
Leading global teams (60+ people in San Jose & Chennai) to develop & deliver data & data science solutions (AI/ML models, variables, data asset) on real time sync, near-real time async & offline Hadoop or Teradata batch platforms;
// package whatever; // don't place package name!
import java.io.*;
import java.util.*;
class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int val) {
this.val = val;
}
}
class MyCode {
//层序遍历 sum leaf.val
public int leafsum(TreeNode root) {
if (root == null) return 0;
Deque q = new LinkedList<>();
q.offerLast(root);
int sum = 0;
while (!q.isEmpty()) {
int size = q.size();
sum = 0;
for (int i=0; i
层序遍历我比较熟悉
如下编译一次通过:
问他的问题:
当前什么工作内容,最大挑战?
他有点像model engine,也是为data science服务,现在挑战是引入TensorFlow,引入其他开源的,如何集成和二次开发
还问了为什么离开eBay去paypal,我回答:2年了(意思是互联网2年也挺长了);而且两者在沟通方式,团队组成,思维习惯等有些不同,我喜欢做金融的;而且19年也是首先投的paypal。另外觉得paypla平台也很大
他有问我是内推还是外部投简历?为什么他要问这个,要拿内推奖?
提前了解到面试安排如下,这点PayPal这类的国际大公司还是做得很不错的,有充分的知情权:
2:00-2:45 Weiwei
2:45-3:30 Yubin
3:30-4:15 Teng
4:15-4:25 rest time
4:25-5:10 Yucheng
5:10-5:55 Feng
可以看到面试安排非常紧凑,要做好精神和体力上充分的准备。
具体分组:
2. 高级 /资深软件工程师 – 上海 /北京
两年以上工作经验;熟悉 Java/Scala/Python ;熟练操作各种数据库;熟悉 Unix/Linux, Bash, Shell Script 应用和系统操作;熟悉设计模式;有大数据或机器学习工作经验的优先
以下 4 种方向可供你选择:
- 大数据系统新功能实现,系统调优 /迁移
- 开发在线和离线特征变量和模型(主要是分类模型,深度学习模型等)
- 构建深度学习平台以及工具集合,帮助分析师 /数据科学家搭建深度学习的生命周期和管理的平台
- 数据准备,数据模拟,线上系统监控
后2者比较偏好,前者可以接触到这个TensorFlow之类框架;后者是智涵干过的,数据模拟
系统迁移调优对基础技术打磨比较好;开发在线和离线特征变量和模型 – 对各种深度学习模型比较了解
如下共同的反馈就是ebay和paypal的技术很像的,也是raptorIO
非常友好,整场只有他开了视频
先自我介绍,然后针对分布式锁,让我写下伪代码。讨论是写status必须在事务之外
//zzz distrubited lock
//demand: multi batch server to exec a batch, avoid dup
//distrubited lock : db redis zk , finally decide db
//db lock table design
create table lock_table {
id int,
batchId int,
workerId int,
ts TimeStamp,
status tinyint,
...
}
//app code
@Transactional
public void trans() {
//get lock
lockServ.getLock(status); //record
if (record.workerId != this.workerId) {
return;
}
// record.workerId == null or is this workerId
this.transBatch(batchSize); //config file
//update status
int ret = updateBatchStatus(); //timeout update sql : where status= true and workerId = this.workerId
if (ret == 0) {
rollback();
}
}
聊的时候了解到面试官他也在eBay干过,巧了。
// package whatever; // don't plac package name!
// combine 2 sorted linked list
// 1>2>4 1>3>4
// 1>1>2>3>4>4
//given a sorted int array, all elements appear twice except one element which appears once, find that element
// [1,2,2,4,4] -> 1
import java.io.*;
class Node {
int val;
Node next;
public Node(int val) {
this.val = val;
}
}
class MyCode {
public void sortedBsearch(int[] sorted) {
//in place search ; binary search O(logn)
//check
if (sorted.length == 1) return sorted[0];
int left = 0;
int right = sorted.length - 1;
int mid = (right - left)/2 + left;
int target = 0;
while (left < right) {
int ml = sorted[mid -1];
int mv = sorted[mid];
int mr = sorted[mid +1];
if (ml != mv && mv != mr) {
target = mv;
break;
}
//determine next step
if (ml == mv) {
if (mid%2 == 0) { //turn right
left = mid;
} else { //turn left
right = mid - 1;
}
} else {
if (mid%2 == 0) { //turn right
left = mid;
} else {
right = mid - 1;
}
}
}
return target;
}
public Node merge(Node a, Node b) {
//check
if (a == null) return b;
if (b == null) return a;
Node dummy = new Node(0);
Node curr = dummy;
Node p1 = a;
Node p2 = b;
while (p1 != null && p2 != null) {
if (p1.val < p2.val) {
curr.next = p1;
p1 = p1.next;
} else {
curr.next = p2;
p2 = p2.next;
}
curr = curr.next;
}
if (p1 != null) curr.next = p1;
if (p2 != null) curr.next = p2;
return dummy.next;
}
public static void main (String[] args) {
//combine link
Node n1 = new Node(1);
n1.next = new Node(2);
n1.next.next = new Node(4);
Node n2 = new Node(1);
n2.next = new Node(3);
n2.next.next = new Node(4);
MyCode code = new MyCode();
code.print(n1);
code.print(n2);
Node ret = code.merge(n1, n2);
code.print(ret);
Node n3 = new Node(1);
n3.next = new Node(2);
n3.next.next = new Node(4);
Node n4 = new Node(1);
n4.next = new Node(3);
n4.next.next = new Node(4);
//all null
code.print(code.merge(null, null));
code.print(code.merge(null, n3));
code.print(code.merge(n4, null));
Node n5 = new Node(1);
n5.next = new Node(2);
n5.next.next = new Node(4);
n5.next.next.next = new Node(14);
Node n6 = new Node(1);
n6.next = new Node(3);
n6.next.next = new Node(4);
code.print(code.merge(n5, n6));
System.out.println("Hello Java");
}
public void print(Node n) {
while (n != null) {
System.out.print(n.val + " -> ");
n = n.next;
}
System.out.println("");
}
}
第二场发挥较好,代码编译一次通过,而且二分查找法也弄出来了
一上来就英文自我介绍,介绍项目
然后问java问题,
// Binary Search Tree
// Find/Insert/Delete a node
// no dup
public class Node {
public Node left;
public Node right;
public int i;
public Node(Node left, Node right, int i) {
this.left = left;
this.right = right;
this.i = i;
}
// Find
public bool findNode(int k, Node tree) {
//check
if (tree == null) return false;
if (k == tree.i) {
return true;
} else if (k < tree.i) {
return findNode(k, tree.left);
} else {
return findNode(k, tree.right);
}
}
// Insert return operated node
public Node insertNode(int k, Node tree) {
if (tree == null) return new Node(k);
if (k == tree.i) {
throw new RuntimeException("No dup val.");
} else if (k < tree.i) {
if (tree.left == null) {
tree.left = new Node(k);
return tree.left;
} else {
return insertNode(k, tree.left);
}
} else {
if (tree.right == null) {
tree.right = new Node(k);
return tree.right;
} else {
return insertNode(k, tree.right);
}
}
}
// Delete
public Node deleteNode(int k, Node tree) {
if (tree == null) return null;
if (k == tree.i) {
//search the lowest left
if (tree.right == null || tree.left == null) return tree;
Node lowest = tree.right;
Node previous = lowest;
while (lowest != null) {
previous = lowest;
lowest = lowest.left;
}
previous.left = tree.left;
return tree;
} else if (k < tree.i) {
return deleteNode(k, tree.left);
} else {
retrun deleteNode(k, tree.right);
}
}
};
说实在,进行到这里,我已经有点疲惫了。持续高强度的思考和应答。
我要求喝口水歇下,上了厕所。
回来后,面试官问模式,设计等。没太纠结技术细节。主要是motivation
然后聊起来我过去项目经历 startup,连连那种上线压力
team的manager
主要检查动机
我说我要1.金融 2.外资 3.互联网 好像也就paypal了。他问为什么不外资银行,我说通过了渣打的终面了。但是我看重人,向同事多学习,这么多年银行,网易,startup等下来,还是eBay和Paypal素质高(有paypal来eBay的同事,我了解的)
问为什么没有转管理岗,我说不太适合干,短时间尝试过,但是国企管理岗很郁闷的,没有权限
后来他说他们还在wfh,不过反馈应该比较快
问他:怎么工作让领导可见。他说,工作分两种1.不错没人看,1️⃣错要死人(比如感冒,都治不好) 2.做了一点大家都知道,都喜欢(比如不孕不育,治不好正常,但是治好了大家都很happy)
所有人都喜欢干第二种,但是只有第二种工作你这个组没有价值,所以需要平衡。很好的经验总结,隐约感觉到这位Manager是平衡的高手,算是找对组了。
问他们的,都是工作挑战
数周之后,paypal终于来了口头offer:工资xxk(基本和eBay一样),年终10%浮动(就是1-2个月);股票多点,7万美金,3年行权; 餐补7500元,mini benefit 5000元;签字费5万,一次或者两次,绑定一年
后来因为Shopee的offer,最终没去PayPal,主要是Shopee的岗位是在新加坡,我想增加海外工作经历,另外报酬方面也是Shopee好点。不过PayPal的面试过程还是给我良好印象,一是问的比较细,考核扎实的基础,二是面试安排比较集中,节约时间,当然强度也比较大,需要做好准备。