临死一击
本来已经放弃了那个interview的机会。
但是今天我的Coursemates去了Interview回来,问我怎么回答他们给的那个Programming问题。
我大概花了十五分钟解答。
忽然就觉得我好像很容易这样。
所以Coursemates们便鼓励我把握最后的机会,直接拿Resume过去,跟他们说我要Interview。
我便听取了意见,再把Nassim的话牢牢记住。
就算是被赶出来,我也要硬着头皮进去。
去到那边的时候,已经5.30pm,洋佬说他六点就要收档,而且他还有一个人要Interviewed。
我便说我愿意等,看看还有没有时间剩下给我。
他说ok,我就等罗。
结果最后这个Interview时间超长,问的是我的Coursemate。
幸好有Cwan还有另一个随行而来的洋老,我们聊着聊着,我也这样没有放弃地等下去。
最后我的Coursemate问完的时候,已经六点二十分。
我以为已经完蛋了,哪知道Coursemate说:“他叫你等一下,他写东西。”
所以我便忽然充满希望起来。
坐下去的时候,他很Friendly地和我问候。
然后问了一个很尴尬的问题。
"Your cgpa doesn't meet our requirement"
耶,我直接傻掉,因为我不知道要超过3.5才能申请。
我就坦白跟他说我并不知道这回事。
他也没有生气,便给了我机会。
他拿了一张纸,用笔写了一个让我傻掉的问题:
int* add=0x01010101
*add=0xDEAD
printf("%+",*add)
我傻掉,不是因为我看不懂这三行。
而是接下来恐怖的问题:“What goes wrong if the output has only 'AD'”
哇靠,我看来看去都没有问题啊!
所以当机了很久后,我便开始思考这并不是program的问题。
我便支支吾吾地回答这是ROM和RAM的问题,或许ROM和RAM的Memory一个只能Store 8 bits的资料,所以DEAD换成ASCII,一共要吃16 bits,因此便只有AD。
“很好的答案嘛。”我心想。
但是,"It's right, but what kind of hardware problem else can cause this problem"
哇靠...
挤了半响脑筋后,我说:"The processor might be 8 bits, so it missed another 8 bits of data"
他点头说:“So there are three kinds of hardware problem, RAM/ROM or the DataBus”
我被他点醒,对,那个叫Data Bus。
正当我才要松一口气的时候,他又来:
“What kind of coding problem can cause this error?”
我再次傻去,这三行字完全没有错啊!
支吾了半响,“I guess this is the problem when we define it as Integer.”
"yeah, different compiler will have different definition for integer."
所以我顺便说了我刚刚写完的Calculator Lab所遇到的同个问题,就是那个Integer只能拥有2^15的数字,而且不能放Unsigned。
他笑着点点头,跟我说"This is also a problem to the rocket science"
我再次松了口气。
然后又再来:“What kind of software problem can happen here, if it is a multi-thread system.”
这次我捉不到重点。
支支吾吾说了很多有的没的。
他很有耐性,不停地重复,等着我回答。
我脑袋真是转到了极限,但幸好他真的没有放弃。
终于我想到了,“Other threads may also access this memory location and change its data.”
他这次是比较开心地笑了,我又再松口气。
"How do you protect this single memory location, from being accessed by other thread?"
这次他真的问倒我了。
这已经超出我的知识范围,我这辈子还没跟别人一起写过Program,所以从来都没有遇到这样的我问题。
我说:“We can assign a certain range of memory location for different threads, so we won't crash it.”
他说:“Nono, how do you protect this single memory location?”
我真的是完全不行了,就算把Data Encoded起来都没有用。
因为还是同样地能被Accessed。
所以我摇头,说:“I don't have a solution for this”
他说:“have you ever heard of miu words?”(拼音大概是这样,我听不懂。)
我说:“Sorry, I don't know about this.”
他笑了笑。
我说:“But i'm willing to learn, because this is really a very critical problem to me.”
然后我们的Interview便结束了。
虽然是被问到当机,但我至少也试过了!
p/s:
他是真的很看得起我,因为他给其他的人同一个问题,就是我十五分钟就解答掉的那个。
但是问我的时候,竟然问到这个程度。
也甘愿了啦,至少今天我学到原来Memory Location也是可以被Protect的!
- 要发表评论,请先登录
- 红点: Chinkang's Weblog
- 浏览原文
- 1077次阅读



















