各公司c面试题.pdf
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《各公司c面试题.pdf》由会员分享,可在线阅读,更多相关《各公司c面试题.pdf(83页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、发信人:L e o n i x(L e o n),信区:j o b标 题:中兴面试过程发信站:饮 水 思 源(2 0 0 2 年 1 1 月 2 0 日2 1:1 0:39 星期三),站内信件面试我的一个男的和一个p p j j。p p j j 不时微笑一下,另一位老沉着脸。我是学网络的,本来我想先介绍一下做的项目,后来都没有机会,只把其中两个附带介绍了一下。p p j j 好像不太懂技术,只问我最后一个项目中担任具体工作,我刚好想说,因为这个项目我做总体设计和项目管理。另一个问我I P v 6 对 V 4 的改进之处,I P v 6 的过渡技术,我们的改进方案的原 理(这是我的研究方向),U
2、 D P 的应用场合,p i n g 的实现原理(让我f t)还让我写二分法的算法(太简单了,很 f t,问了他几次证实,他有点不悦)我就很快写了一下,可能有些小错。最核然后问我想在哪儿工作,p p j j 代我回答了,对他说上海深圳都可以的。他们就是问你项目然后逮住你自己说精通的或者他懂的东西深入问一下。复旦大学网络乒协X 来源:饮水思源 b b s.s j tu.e d u.c n F R O M:so c k s,f ud a n.e d u.c n E:面 试 题 中 兴 面 试 过程.txt.m a zC+object-oriented questionsZZshury 160 20
3、04-12-5 17:40:00Q.What is pure virtual function?A class is made abstract by declaring one or more of its virtualfunctions to be pure.A pure virtual function is one with an initializerof=0 in its declarationQ Write a Struct Time where integer m,h,s are its membersstruct Time(int m;int h;int s;;how do
4、 you traverse a Btree in Backward in-order?Process the node in the right subtreeProcess the rootProcess the node in the left subtreeQ What is the two main roles of Operating System?As a resource managerAs a virtual machineQ In the derived class z which data member of the base class are visible?In th
5、e public and protected sections.What is a modifier?A modifier,also called a modifying function is a member function thatchanges the value of at least one data member.In other words,anoperation that modifies the state of an object.Modifiers are alsoknown as jmutators .Example:The function mod is a mo
6、difier in thefollowing code snippet:class test(int xz y;public:test()x=0;y=0;void mod()x=10;y=15;What is an accessor?An accessor is a class operation thatdoes not modify the state of an object.The accessor functions needtobe declared as const operationsDifferentiate between a template class and clas
7、s template.Template class:A generic definition or a parameterized class notinstantiated until the client provides the needed information.It j -sjargon for plain templates.Class template:A class template specifieshow individual classes can be constructed much like the way a classspecifies how individ
8、ual objects can be constructed.Its jargon forplain classes.When does a name clash occur?A name clash occurs when a name is defined in more than one place.For example.t twodifferent class libraries could give two different classes the samename.If you try to use many class libraries at the same time,t
9、hereisa fair chance that you will be unable to compile or link the programbecause of name clashes.Define namespace.It is a feature in C+tominimize name collisions in the global name space.This namespacekeyword assigns a distinct name to a library that allows otherlibraries to use the same identifier
10、 names without creating any namecollisions.Furthermore,the compiler uses the namespace signaturefordifferentiating the definitions.What is the use of(using i -declaration.A using declaration makes it possible to use a name from a namespacewithout the scope operator.What is an Iterator class?A class
11、that is used to traverse through the objects maintained bya container class.There arefive categories of iterators:input iterators,output iterators,forward iterators,bidirectional iterators,random access.Aniteratoris an entity that gives access to the contents of a container objectwithout violating e
12、ncapsulation constraints.Access to the contentsisgranted on a one-at-a-time basis in order.The order can be storageorder(as in lists and queues)or some arbitrary order(as in arrayindices)or according to some ordering relation(as in an orderedbinary tree).The iterator is a construct,which provides an
13、 interfacethat,when called,yields either the next element in the container,orsome value denoting the fact that there are no more elements toexamine.Iterators hide the details of access to and update of theelements of a container class.The simplest and safest iterators are those that permit read-only
14、access to the contents of a container class.List out some of the OODBMS available.GEMSTONE/OPALof Gemstone systems,ONTOS of Ontos,Objectivity of Objectivity Inc,Versant of Versant object technology,Object store of Object Design,ARDENT of ARDENT software,POET of POET software.List out some of the obj
15、ect-oriented methodologies.Object Oriented Development(00D)(Booch 1991,1994),Object Oriented Analysis and Design(OOA/D)(Coad and Yourdon 1991),Object Modelling Techniques(OMT)(Rumbaugh 1991)rObject Oriented Software Engineering(Objectory)(Jacobson 1992),0bject Oriented Analysis(00A)(Shlaer and Mello
16、r 1992),The Fusion Method(Coleman 1991).What is an incomplete type?Incomplete types refers to pointers in which there is non availabilityof theimplementation of the referenced location or it points to some locationwhose value is not available for modification.int*i=0 x400/i points to address 400*i=0
17、;/set the value of memory location pointed by i.Incomplete types are otherwise called uninitialized pointers.What is a dangling pointer?A dangling pointer arises when you use the address of an object afterits lifetime is over.This may occur in situations like returningaddresses of the automatic vari
18、ables from a function or using theaddress of the memory block after it is freed.The followingcode snippet shows this:class Sample(public:int*ptr;Sample(int i)(ptr=new int(i);-Sample()(delete ptr;void PrintVal()(cout i The value is j *ptr;);void SomeFunc(Sample x)(cout j Say i am in someFunc endl;)in
19、t main()(Sample si=10;SomeFunc(si);si.PrintVal();)In the above example when PrintVal()function iscalled it is called by the pointer that has been freed by thedestructor in SomeFunc.Differentiate between the message and method.Message:Objects communicate by sending messages to each other.A message is
20、 sent to invoke a method.Method Provides response to a message.It is an implementation of an operation.What is an adaptor class or Wrapper class?A class that has no functionality of its own.Its member functionshidethe use of a third party software component or an object with thenon-compatible interf
21、ace or a non-object-oriented implementation.What is a Null object?It is an object of some class whose purpose is to indicate that a realobject of that classdoes not exist.One common use for a null object is a return valuefroma member function that is supposed to return an object with somespecified p
22、roperties but cannot find such an object.What is class invariant?A class invariant is a condition that defines all valid states foran object.It is a logicalcondition to ensure the correct working of a class.Class invariantsmust hold when an object is created,and they must be preserved underall opera
23、tions of the class.In particular all class invariants areboth preconditions and post-conditions for all operations or memberfunctions of the class.What do you mean by Stack unwinding?It is a process during exception handling when the destructor is calledfor alllocal objects between the place where t
24、he exception was thrown andwhere it is caught.Define precondition and post-condition to a member function.Precondition:A precondition is a condition that must be true on entryto a member function.A class is used correctly if preconditions arenever false.An operation is not responsible for doing anyt
25、hingsensible if its precondition fails to hold.For example,the interfaceinvariants of stack class say nothing about pushing yet another elementon a stack that is already full.We say that isful()is a preconditionof the push operation.Post-condition:A post-condition is a conditionthat must be true on
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 公司 试题
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内