注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
OA:
第一题简单的回溯
两个顶点最短路径,唯一需要注意的点就是检查当前位置是否是 perfect square
第二题十字路口堵车,求每辆车的通过时间
题目有三个具体要求,按题意疯狂if else就行
我用的是queue来分别存两个路车到达的时间,然后逐个pop
一个var 来存整体的timer
一个var 来记录前一辆通过的车来自那个路
!!!!注意在路口没有车的时候update 当前的timer,否则会超时
!!!!注意更新前一辆车通过的路
Video Interview:
BQ:
1.how would your friends describe you(45 s)
My friend would describe me as the one who seems to know everyone in the world. I don’t feel shy or embarrassed talking to strangers instead I can start the conversation pretty quickly. One time when me and my friends were at a party and we need some garlic and onions to cook which we forgot to buy, there isn’t enough time to buy and they are afraid talk to their neighbor, I took charge and friendly asked the neighbor if we can borrow something. It turns out our neighbor is very kind and I even invited him to our party. This is how I met one of my best friend.
I believe shyness and lack of courage to embrace new things is the largest barrier to success.
2 the hardest thing you have evees not require multi thread, the cost of creating a new thread and switching between each thread is higher than just processing the program in a single thread, and also when there exist a dead lock in multithread, single thread will be faster.
3:An O(1) algorithm can not be faster (45s)
It is possible if we can decrease the constant significantly, or when input is very small and O(log(n)) could outperform O(1)
But if we assume the input is large and keep increasing, O(1) is the fastest.
整理不易,求各位老爷赏点米如果对你有帮助的话,谢谢老板们! |