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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/261780.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

jquery调用asp.net 页面后台方法

先创建一个aspx页面编写一个客户端控件<input type"button" id"AjaxDemo" value"AjaxDemo"> 再aspx后台的页面编写一个简单的方法,代码如下: [WebMethod]public static string ABC(string ABC){ return ABC;} 必须声明为静态方法&#…

powerdesigner怎么导出pdf_各种科研绘图软件中的矢量图导出技巧

引言科技论文常含有插图&#xff0c;借助插图来形象直观、简明扼要地表达所要表述的内容(梁福军. 科技论文规范写作与编辑[M]. 清华大学出版社, 2014.)。科研绘图软件有很多种&#xff0c;而软件导出的图片可以分为矢量图&#xff08;vector&#xff09;和位图&#xff08;bitm…

江西计算机一级考试教程,江西省2019年下半年计算机一级考试复习教程:计算机基础及MS Office应用上机指导...

&nbsp&nbsp[导读]:江西省2019年下半年计算机一级考试复习教程&#xff1a;计算机基础及MS Office应用上机指导&#xff0c;更多江西等级考试用书&#xff0c;请访问易考吧江西等级考试栏目江西省2019年下半年计算机一级考试复习教程&#xff1a;计算机基础及MS Office应…

Typesafe公司正式更名为Lightbend公司

Scala编程语言的发明者&#xff1a;Typesafe公司&#xff0c;已经完成他们的更名计划&#xff0c;改名后成为Lightbend公司。Typesafe公司在去年五月就宣布了他们的更名计划&#xff0c;从那时起&#xff0c;他们希望可以在两个月内完成改名相关事宜。Typesafe公司邀请了社区的…

理解Javascript_12_执行模型浅析

大家有没有想过&#xff0c;一段javascript脚本从载入浏览器到显示执行都经过了哪些流程&#xff0c;其执行次序又是如何。本篇博文将引出javascript执行模型的概念&#xff0c;并带领大家理解javascript在执行时的处理机制。 简单的开始 简单的代码&#xff1a; <script ty…

怎么制作铁闸门_“短笛”拿铁,最近的心头好!

其实花式咖啡除了市面上一些常见的款式外&#xff0c;还有一些是不常见又好喝的&#xff01;今天来给大家推荐一款“短笛”拿铁&#xff0c;最近的最爱&#xff01;什么是短笛拿铁&#xff1f;piccolo latte&#xff0c;在意大利文中“piccolo”是小的意思&#xff0c;而latte则…

计算机发展趋势是规格化,2016年春季计算机应用基础月考卷(4月).doc

2016年春季学期计算机应用基础4月考卷姓名&#xff1a; 得分&#xff1a;一、单项选择题。(共有75个小题&#xff0c;每小题2分&#xff0c;共计150分)1. 计算机的发展通常认为经历了四代&#xff0c;第二代计算机的主要元器件是( )A. 电子管 B&#xff0e;晶体管 C&#xff0e…

C#与.NET程序员面试宝典 1.3 投递简历

在IT行业中&#xff0c;应聘是大多数人获得工作机会的主要途径&#xff0c;通常人们从学校毕业后即开始参加各种形式的招聘场合。从招聘方的角度来说&#xff0c;不同的公司有不同的招聘渠道&#xff0c;但大多数都会重点采用网络、校园、招聘会3个渠道进行招聘员工。想要应聘到…

回归初心

软件工程这门课程已经上了两周了&#xff0c;可以说这两周过得非常的充实&#xff0c;除了上课时间&#xff0c;其余的课余时间都用来写作业和看书了。我想&#xff0c;这才是刚进入大学时&#xff0c;我憧憬的生活。现在看来&#xff0c;过去的三年确实会感到有点遗憾&#xf…

scipy是python下的什么_Python下科学计算包numpy和SciPy的安装

Python下大多数工具包的安装都很简单&#xff0c;只需要执行 “python setup.py install”命令即可。然而&#xff0c;由于SciPy和numpy这两个科学计算包的依赖关系较多&#xff0c;安装过程较为复杂。网上教程较为混乱&#xff0c;而且照着做基本都不能用。在仔细研读各个包里…

计算机指令格式哪几部分组成,计算机的指令格式,通常是由()两部分组成。 - 百科题库网...

1.8086汇编语言指令由标号、操作码、操作数和注释组成,其中标号和注释可以省略&#xff0c;操作码指出指令要过盛的功能,操作数指出完成的对象. 2.变量和标号的区别是变量由伪指令定义&#xff0c;标号是指令前面的符号&#xff0c;变量也伪指令定义符之间由空格分隔&#xff0…

执行phpinfo();时提示:date_default_timezone_set()

执行phpinfo();时提示&#xff1a; Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the systems timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those …

nlog轻量级日志组件

一.NLog简要介绍: 1.NLog是一个简单灵活的.NET日志记录类库。通过使用NLog&#xff0c;我们可以在任何一种.NET语言中输出带有上下文的&#xff08;contextual information&#xff09;调试诊断信息&#xff0c;根据喜好配置其表现样式之…

SQL Server 2016 RC0 安装(超多图)

微软最新版本的数据库SQL Server 2016在2016年3月9日推出了RC0版本。已经提供了包括简体中文等多种语言版本&#xff0c;不过联机丛书还是英文版的。对OS的要求是WIN8&#xff0c;WIN10&#xff0c; WIN2012&#xff0c;只有64位版本。让我们下载最新的版本安装测试下。Figure-…

vfp赋值超过7位出错_JDK1.7下的HashMap的源码分析

源码分析jdk1.7下的HashMap我们都知道1.7版本的hashmap的底层是数组加链表构成的&#xff0c;那么今天我们就来自己分析一波源码~篇幅有点长&#xff0c;废话不多说&#xff0c;直接开始分析~「属性声明」//初始化容量 static final int DEFAULT_INITIAL_CAPACITY 1 <4;…

计算机常用数制转换说课稿,进制与进制转换说课稿

《数制及其转换》 尊敬的各位老师&#xff1a;大家好&#xff01;我说课的内容是《数制及其转换》。一、说教材1、教材分析《数制及其转换》是从人民邮电出版社教材《大学计算机基础》第一章第三节内容&#xff0c;它是理解计算机原理的重要突破点&#xff0c;奠定了学生对计算…

java.net.SocketException: Permission denied解决

该文引自&#xff1a;http://hi.baidu.com/sunfengwei/item/6c4c8b68d015ea2569105bc2 在Android项目开发时&#xff0c;在获取IP地址时出现java.net.SocketException: Permission denied异常&#xff0c;这是一个典型的异常。 解决方法&#xff1a; 在AndroidManifest.xml 配置…

Android代码优化——使用Android lint工具

Android代码优化——使用Android lint工具

【转】wordpress/wp-includes目录文件概述

wp-includes目录1.wp-includes/cache.php2.wp-includes/capabilities.php3.wp-includes/class-IXR.php&#xff1a;Incutio XML-RPC库。包括了 XML RPC支持函数。由http://scripts.incutio.com/xmlrpc/提供支持。4.wp-includes/classes.php&#xff1a;包括了基本的类&#xff…

python自带的统计函数_NumPy统计函数的实现方法

numpy.amin()和numpy.amax()numpy.amin()用于计算数组中元素沿着指定轴的最小值。numpy.amax()用于计算数组中元素沿着指定轴的最大值anp.array([1,3,6],[3,4,11],[6,1,4])print(np.amin(a,1) #每行最小值print(np.amin(a,0) #每列最小值print(np.amax(a) #所有元素中最大值pri…