Karat 视频面试,都是地里的面筋题,感谢之前大家的分享!面试官是个大叔,态度极其友好。基本流程,先2min自我介绍,再10分钟project介绍,然后开始coding。总共面了3道题,面试官会先带着过一下题,然后说思路开始coding,会提供test case现场run,最后分析复杂度
-
subDomain count, 高频题,蠡口8摇摇,字典很容易就解决了
-
longest common visit history, 和 longest common substring类似,https://www.geeksforgeeks.org/longest-common-substring-dp-29/,只不过把char变成了string而已
-
ad click conversion rate,给了几组数据
completedPurchaseUsers = [‘id1’, ‘id2’, ‘id3’]
adClicks = [‘ip1, timestamp, ad1’, ‘ip2, timestamp, ad1’,‘ip3, timestamp, ad2’, ‘ip4, timestamp, ad2’]
userIp = [‘id1, ip1’, ‘id2, ip2’, ‘id3, ip3’, ‘id4, ip4’]
让找出每个ad的点击转化率,即点击了ad的user有多少最后购买了商品,比如ad1被ip1,ip2的用户点击过,ip1,ip2分别对应user id1, id2, 最终id1,id2都purchase了,所有ad1的conversionrate是1