3013-04-13 腾讯笔试
題目及答案參考:地址
為什么騰訊筆試的時(shí)間是10:30到12:30?難道騰訊人事部認(rèn)為計(jì)算機(jī)的學(xué)生都是3點(diǎn)睡覺(jué),9點(diǎn)起床,13點(diǎn)吃飯的嗎?做了半個(gè)小時(shí)的題,就餓了;而且剛開(kāi)始發(fā)卷子的時(shí)候,那卷子的模樣,我是有多么熟悉啊:長(zhǎng)長(zhǎng)的,白白的,分明就是當(dāng)年血戰(zhàn)的高考卷子模樣啊,一瞬間心血沸騰。拿到卷子后,就有點(diǎn)暈了,我是真的在編程啊,可是我怎么對(duì)題目就不知道如何下手呢?感覺(jué)題目就像是這樣的:我們每天都在吃飯,然后問(wèn)我們當(dāng)拿筷子的時(shí)候,手握在離筷子尾部多長(zhǎng)的位置?此時(shí)此刻,我真想找雙筷子來(lái)我一下,誰(shuí)吃飯的時(shí)候會(huì)思考會(huì)留意這個(gè)問(wèn)題呢?我餓了,我要吃飯,我為什么要考慮吃飯的超級(jí)細(xì)節(jié)東西?我寫(xiě)程序,寫(xiě)程序只是個(gè)工具,我需要我的數(shù)據(jù)結(jié)果就ok了,我為什么要考慮一個(gè)無(wú)符號(hào)字符變量轉(zhuǎn)換成有符號(hào)字符變量時(shí)候是什么模樣?我突然意識(shí)到了我平常的訓(xùn)練目的和騰訊的考試目的差異是有多么的大:我是以解決問(wèn)題為目的而使用工具,騰訊希望找到的是一個(gè)會(huì)熟練使用工具的能工巧匠。很遺憾的是我不是一個(gè)能工巧匠,在此向騰訊的碼畜,碼農(nóng),碼工,碼管等各級(jí)碼人致敬!
言歸正傳,每次考試都要有所收獲,都要吸取教訓(xùn),我這次考試如同前幾次考試一樣,深深地意識(shí)到了本科不是計(jì)算機(jī)專(zhuān)業(yè)的各項(xiàng)劣勢(shì),要知道在一個(gè)和計(jì)算機(jī)沾一點(diǎn)點(diǎn)邊的數(shù)學(xué)系泡四年,和在計(jì)算機(jī)專(zhuān)業(yè)泡四年,差別還是很大的。操作系統(tǒng)方面是我嚴(yán)重的缺陷,數(shù)據(jù)類(lèi)型轉(zhuǎn)換也很無(wú)語(yǔ)。這次投的是測(cè)試開(kāi)發(fā)工程師,我壓根都不知道這是干嘛的。。。很?chē)?/p>
1 基本數(shù)據(jù)類(lèi)型轉(zhuǎn)換
1)解決有符號(hào)和無(wú)符號(hào)的問(wèn)題。 對(duì)于字符類(lèi)型和整型來(lái)說(shuō),?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) 類(lèi)型轉(zhuǎn)換。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 在實(shí)現(xiàn)DMA傳輸時(shí),是由DMA控制器直接掌管總線(xiàn),因此,存在著一個(gè)總線(xiàn)控制權(quán)轉(zhuǎn)移問(wèn)題。即DMA傳輸前,CPU要把總線(xiàn)控制權(quán)交給DMA控制器,而在結(jié)束DMA傳輸后,DMA控制器應(yīng)立即把總線(xiàn)控制權(quán)再交回給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.
轉(zhuǎn)載于:https://www.cnblogs.com/18fanna/archive/2013/04/16/3022005.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的3013-04-13 腾讯笔试的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 工行信用卡分期新品种e分期!先分后用新模
- 下一篇: 平安金管家联名信用卡申请条件:不是人人都