3013-04-13 腾讯笔试
題目及答案參考:地址
為什么騰訊筆試的時間是10:30到12:30?難道騰訊人事部認為計算機的學生都是3點睡覺,9點起床,13點吃飯的嗎?做了半個小時的題,就餓了;而且剛開始發卷子的時候,那卷子的模樣,我是有多么熟悉啊:長長的,白白的,分明就是當年血戰的高考卷子模樣啊,一瞬間心血沸騰。拿到卷子后,就有點暈了,我是真的在編程啊,可是我怎么對題目就不知道如何下手呢?感覺題目就像是這樣的:我們每天都在吃飯,然后問我們當拿筷子的時候,手握在離筷子尾部多長的位置?此時此刻,我真想找雙筷子來我一下,誰吃飯的時候會思考會留意這個問題呢?我餓了,我要吃飯,我為什么要考慮吃飯的超級細節東西?我寫程序,寫程序只是個工具,我需要我的數據結果就ok了,我為什么要考慮一個無符號字符變量轉換成有符號字符變量時候是什么模樣?我突然意識到了我平常的訓練目的和騰訊的考試目的差異是有多么的大:我是以解決問題為目的而使用工具,騰訊希望找到的是一個會熟練使用工具的能工巧匠。很遺憾的是我不是一個能工巧匠,在此向騰訊的碼畜,碼農,碼工,碼管等各級碼人致敬!
言歸正傳,每次考試都要有所收獲,都要吸取教訓,我這次考試如同前幾次考試一樣,深深地意識到了本科不是計算機專業的各項劣勢,要知道在一個和計算機沾一點點邊的數學系泡四年,和在計算機專業泡四年,差別還是很大的。操作系統方面是我嚴重的缺陷,數據類型轉換也很無語。這次投的是測試開發工程師,我壓根都不知道這是干嘛的。。。很囧
1 基本數據類型轉換
1)解決有符號和無符號的問題。 對于字符類型和整型來說,?Assuming the size of type is k, if one unsigned data type a ?is converted to the signed one b ,when a is?larger than 2^(k-1), b is equal to a-2^(k)+1; otherwise, b is equal to a. If one signed data type b is converted to the unsigned one a,? when b is less than 0, a is equal to b+2^k. We have to understand that the changing of "signed" aims to??change the range of number presented by the k bits, but also maintain the same meaning as much as possible. Generally, the highest bit is the signal, if this highest bit is explained ?as unsignal, so the range of number can be expanded. Noted that when the changing of "signed" happened, the explaination of meaning is changed , but the real bits do not change.
2) 類型轉換。if there are converation between two different data types having different size, we have to handle the transfomation. First, if we converted a long data type to a short data type, we truncate the long data bits based on the size of short data type. Assuming we have to truncate1 Bytes from?the 4 Bytes(0xff fe? fd? f7), which Bytes do we obtain? the left ,the most right? or the other.? This is decided by the big-endain storage or the little-endain storage. If it is the former, we get ff; If it is the latter, we get f7. Second, if we convert a short data type to a long data type, it is not as easy as filling enough 0 to the vacancy bits. For instance,? convertation from char to int, the most improtant?thing is?keeping the value unchanged.?For any positive value of char type, we fill?24 0. For any negtive value of char type, we filee 24 1.?For instance , 1111 1100=-4, the int is 0xff ff ff fc(1111 1100)??. If we convert one int to ont float , There is some complex operation to finish.
All the above conversions are kind of standard conversion, there is still another conversion:forced conversion. there is no complement, no add 1. Baed on the changing of ?point,?the machine just explain the real bits in the memary, and?do not change?bits.?
2 ?About the parameters of functions. const parameter
3 For a point a ,a++ is rather different with a=a+1
4 sizeof(long long) is 8. I do not even know this kind of spelling!? but in the function of "printf", the format is %d, so for every parameter, it only read 4 Bytes every time, then we can find the real resluts .Note that it is little-endian storage.
?5 operation system?? : kernel mode and user mode: the kernel mode has the highest priority, and does some operation such as resource allocation, computing adn so on. the user mode mainly lies on the cache. Some approaches from the suer mode to the kernel mode: 1)system calling (like applying a new process);2)interruption of peripherals(finishing the reading disks);3) some specific conversion operation(search information following the describer, keep the current information, keep them in regesters) open function belonging to system calling?can open device files, fopen belonging to the standard C library can open general files.
6 some algorithms about memary management. Lru least recently used
7 DMA 在實現DMA傳輸時,是由DMA控制器直接掌管總線,因此,存在著一個總線控制權轉移問題。即DMA傳輸前,CPU要把總線控制權交給DMA控制器,而在結束DMA傳輸后,DMA控制器應立即把總線控制權再交回給CPU。
8 I am not familar about the concepts of trees,? what a pity.
keep studying ,
Thanks my friend XinXin Zhang, who helps me fighure out most of the above mentioned thing patiently.
Sometimes I feel discussion contributes to keep things in mind and long time. After discussion , we conclude it and check them in the book c++ primer.
轉載于:https://www.cnblogs.com/18fanna/archive/2013/04/16/3022005.html
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的3013-04-13 腾讯笔试的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 工行信用卡分期新品种e分期!先分后用新模
- 下一篇: java.net.SocketExcep