ImageVerifierCode 换一换
格式:DOC , 页数:29 ,大小:174.54KB ,
资源ID:4452496      下载积分:10 金币
验证码下载
登录下载
邮箱/手机:
图形码:
验证码: 获取验证码
温馨提示:
支付成功后,系统会自动生成账号(用户名为邮箱或者手机号,密码是验证码),方便下次登录下载和查询订单;
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/4452496.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请


权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4009-655-100;投诉/维权电话:18658249818。

注意事项

本文(2023年常见英文面试笔试题.doc)为本站上传会员【人****来】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

2023年常见英文面试笔试题.doc

1、C/C++ Programming interview questions and answers By Satish Shetty, July 14th, What is encapsulation?? Containing and hiding information about an object, such as internal data structures and code. Encapsulation isolates(使隔离) the internal complexity of an object's operation from the rest of

2、the application. For example, a client component asking for net revenue(收益) from a business object need not know the data's origin. What is inheritance? Inheritance allows one class to reuse the state and behavior of another class. The derived class inherits the properties and method implementat

3、ions of the base class and extends it by overriding methods and adding additional properties and methods. What is Polymorphism?? Polymorphism allows a client to treat different objects in the same way even if they were created from different classes and exhibit(展现) different behaviors. You can

4、use implementation(实现) inheritance to achieve polymorphism in languages such as C++ and Java. Base class object's pointer can invoke(调用) methods in derived class objects. You can also achieve polymorphism in C++ by function overloading and operator overloading. What is constructor or ctor? Con

5、structor creates an object and initializes it. It also creates vtable变量列表? for virtual functions. It is different from other methods in a class. What is destructor? Destructor usually deletes any extra resources allocated by the object. What is default constructor? Constructor with no argum

6、ents or all the arguments has default values. What is copy constructor? Constructor which initializes the it's object member variables ( by shallow copying) with another object of the same class. If you don't implement one in your class then compiler implements one for you. for example: Boo Ob

7、j1(10); // calling Boo constructor Boo Obj2(Obj1); // calling boo copy constructor Boo Obj2 = Obj1;// calling boo copy constructor When are copy constructors called? Copy constructors are called in following cases: a) when a function returns an object of that class by value b) when the objec

8、t of that class is passed by value as an argument to a function c) when you construct an object based on another object of the same class d) When compiler generates a temporary object What is assignment operator? Default assignment operator handles assigning one object to another of the same

9、class. Member to member copy (shallow copy) What are all the implicit member functions of the class? Or what are all the functions which compiler implements for us if we don't define one.?? default ctor copy ctor assignment operator default destructor address operator What is conversion c

10、onstructor? constructor with a single argument makes that constructor as conversion ctor and it can be used for type conversion. for example: class Boo { public: Boo( int i ); }; Boo BooObject = 10 ; // assigning int 10 Boo object What is conversion operator?? class can have

11、a public method for specific data type conversions. for example: class Boo { double value; public: Boo(int i ) operator double() { return value; } }; Boo BooObject; double i = BooObject; // assigning object to variable i of type double. now conversion opera

12、tor gets called to assign the value. What is diff between malloc()/free() and new/delete? malloc allocates memory for object in heap but doesn't invoke object's constructor to initiallize the object. new allocates memory and also invokes constructor to initialize the object. malloc() and fre

13、e() do not support object semantics Does not construct and destruct objects string * ptr = (string *)(malloc (sizeof(string))) Are not safe Does not calculate the size of the objects that it construct Returns a pointer to void int *p = (int *) (malloc(sizeof(int))); int *p = new int; Ar

14、e not extensible new and delete can be overloaded in a class "delete" first calls the object's termination routine (i.e. its destructor) and then releases the space the object occupied on the heap memory. If an array of objects was created using new, then delete must be told that it is dealing w

15、ith an array by preceding the name with an empty []:- Int_t *my_ints = new Int_t[10]; ... delete []my_ints; what is the diff between "new" and "operator new" ? "operator new" works like malloc. What is difference between template and macro?? There is no way for the compiler to verify

16、that the macro parameters are of compatible types. The macro is expanded without any special type checking. If macro parameter has a post-incremented variable ( like c++ ), the increment is performed two times. Because macros are expanded by the preprocessor, compiler error messages will refer to

17、the expanded macro, rather than the macro definition itself. Also, the macro will show up in expanded form during debugging. for example: Macro: #define min(i, j) (i < j ? i : j) template: template T min (T i, T j) { return i < j ? i : j; } What are C++ storage classes?

18、 auto register static extern auto: the default. Variables are automatically created and initialized when they are defined and are destroyed at the end of the block containing their definition. They are not visible outside that block register: a type of auto variable. a suggestion to the compil

19、er to use a CPU register for performance static: a variable that is known only in the function that contains its definition but is never destroyed and retains=keep its value between calls to that function. It exists from the time the program begins execution extern: a static variable whose definit

20、ion and placement is determined when all object and library modules are combined (linked) to form the executable code file. It can be visible outside the file where it is defined. What are storage qualifiers in C++ ? They are.. const volatile mutable Constkeyword indicates that memory once

21、 initialized, should not be altered by a program. volatilekeyword indicates that the value in the memory location can be altered even though nothing in the program code modifies the contents. for example if you have a pointer to hardware location that contains the time, where hardware changes the

22、value of this pointer variable and not the program. The intent of this keyword to improve the optimization ability of the compiler. mutable keyword indicates that particular member of a structure or class can be altered even if a particular structure variable, class, or class member function is

23、constant. struct data { char name[80]; mutable double salary; } const data MyStruct = { "Satish Shetty", 1000 }; //initlized by complier strcpy ( MyStruct.name, "Shilpa Shetty"); // compiler error MyStruct.salaray = ; // complier is happy allowed What is reference ?? reference is a na

24、me that acts as an alias, or alternative name, for a previously defined variable or an object. prepending variable with "&" symbol makes it as reference. for example: int a; int &b = a; & 读 amp What is passing by reference? Method of passing arguments to a function which takes parameter

25、 of type reference. for example: void swap( int & x, int & y ) { int temp = x; x = y; y = temp; } int a=2, b=3; swap( a, b ); Basically, inside the function there won't be any copy of the arguments "x" and "y" instead they refer to original variables a and b. so no extra memory needed

26、 to pass arguments and it is more efficient. When do use "const" reference arguments in function? a) Using const protects you against programming errors that inadvertently不经意旳 alter data. b) Using const allows function to process both const and non-const actual arguments, while a function

27、 without const in the prototype can only accept non constant arguments. c) Using a const reference allows the function to generate and use a temporary variable appropriately. When are temporary variables created by C++ compiler? Provided that function parameter is a "const reference", comp

28、iler generates temporary variable in following 2 ways. a) The actual argument is the correct type, but it isn't Lvalue double Cube(const double & num) { num = num * num * num; return num; } double temp = 2.0; double value = cube(3.0 + temp); // argument is a expression and not a Lvalue;

29、 b) The actual argument is of the wrong type, but of a type that can be converted to the correct type long temp = 3L; double value = cuberoot ( temp); // long to double conversion What is virtual function? When derived class overrides the base class method by redefining the same funct

30、ion, then if client wants to access redefined the method from derived class through a pointer from base class object, then you must define this function in base class as virtual function. class parent { void Show() { cout << "i'm parent" << endl; } }; class child: public parent {

31、 void Show() { cout << "i'm child" << endl; } }; parent * parent_object_ptr = new child; parent_object_ptr->show() // calls parent->show() i now we goto virtual world... class parent { virtual void Show() { cout << "i'm parent" << endl; } }; class child: public parent {

32、 void Show() { cout << "i'm child" << endl; } }; parent * parent_object_ptr = new child; parent_object_ptr->show() // calls child->show() What is pure virtual function? or what is abstract class? When you define only function prototype in a base class without implementation

33、 and do the complete implementation实现 in derived class. This base class is called abstract class and client won't able to instantiate an object using this base class. You can make a pure virtual function or abstract class this way.. class Boo { void foo() = 0; } Boo MyBoo; // compilation err

34、or What is Memory alignment?? The term alignment primarily means the tendency趋向of an address pointer value to be a multiple of some power of two. So a pointer with two byte alignment has a zero in the least significant bit. And a pointer with four byte alignment has a zero in both the two lea

35、st significant bits. And so on. More alignment means a longer sequence of zero bits in the lowest bits of a pointer. What problem does the namespace feature solve? Multiple providers of libraries might use common global identifiers causing a name collision when an application tries to link wit

36、h two or more such libraries. The namespace feature surrounds a library's external declarations with a unique namespace that eliminates消除 the potential for those collisions. namespace [identifier] { namespace-body } A namespace declaration identifies and assigns a name to a declarative region. Th

37、e identifier in a namespace declaration must be unique in the declarative region in which it is used. The identifier is the name of the namespace and is used to reference its members. What is the use of 'using' declaration? A using declaration makes it possible to use a name from a namespace wit

38、hout the scope范围 operator. What is an Iterator迭代器 class? A class that is used to traverse through穿过 the objects maintained by a container class. There are five categories of iterators: input iterators, output iterators, forward iterators, bidirectional iterators, random access. An iterator is a

39、n entity that gives access to the contents of a container object without violating encapsulation constraints. Access to the contents is granted on a one-at-a-time basis in order. The order can be storage order (as in lists and queues) or some arbitrary order (as in array indices) or according to som

40、e ordering relation (as in an ordered binary tree). The iterator is a construct, which provides an interface that, when called, yields either the next element in the container, or some value denoting the fact that there are no more elements to examine. Iterators hide the details of access to and upd

41、ate of the elements of a container class. Something like a pointer. What is a dangling悬挂 pointer? A dangling pointer arises when you use the address of an object after its lifetime is over. This may occur in situations like returning addresses of the automatic variables from a function or using

42、 the address of the memory block after it is freed. What do you mean by Stack unwinding? It is a process during exception handling when the destructor is called for all local objects in the stack between the place where the exception was thrown and where it is caught. 抛出异常与栈展开(stack unwinding)

43、 抛出异常时,将暂停目前函数旳执行,开始查找匹配旳catch子句。首先检查throw自身与否在try块内部,假如是,检查与该try有关旳catch子句,看与否可以处理该异常。假如不能处理,就退出目前函数,并且释放目前函数旳内存并销毁局部对象,继续到上层旳调用函数中查找,直到找到一种可以处理该异常旳catch。这个过程称为栈展开(stack unwinding)。当处理该异常旳catch结束之后,紧接着该catch之后旳点继续执行。 1. 为局部对象调用析构函数 如上所述,在栈展开旳过程中,会释放局部对象所占用旳内存并运行类类型局部对象旳析构函数。但需要注意旳是,假如一种块通过new动态分派

44、内存,并且在释放该资源之前发生异常,该块因异常而退出,那么在栈展开期间不会释放该资源,编译器不会删除该指针,这样就会导致内存泄露。 2. 析构函数应该从不抛出异常 在为某个异常进行栈展开旳时候,析构函数假如又抛出自己旳未经处理旳另一种异常,将会导致调用原则库terminate函数。一般terminate函数将调用abort函数,导致程序旳非正常退出。因此析构函数应该从不抛出异常。 3. 异常与构造函数 假如在构造函数对象时发生异常,此时该对象可能只是被部分构造,要保证可以合适旳撤销这些已构造旳组员。 4. 未捕捉旳异常将会终止程序 不能不处理异常。假如找不到匹配旳catch,程序就

45、会调用库函数terminate。 Name the operators that cannot be overloaded?? sizeof, ., .*, .->, ::, ?: What is a container class? What are the types of container classes? A container class is a class that is used to hold objects in memory or external storage. A container class acts as a generic holder.

46、 A container class has a predefined behavior and a well-known interface. A container class is a supporting class whose purpose is to hide the topology used for maintaining the list of objects in memory. When a container class contains a group of mixed objects, the container is called a heterogeneous

47、不均匀旳多样旳 container; when the container is holding a group of objects that are all the same, the container is called a homogeneous单一旳均匀旳 container. What is inline function?? The __inline keyword tells the compiler to substitute替代 the code within the function definition for every instance of a fun

48、ction call. However, substitution occurs only at the compiler's discretion灵活性. For example, the compiler does not inline a function if its address is taken or if it is too large to inline. 使用预处理器实现,没有了参数压栈,代码生成等一系列旳操作,因此,效率很高,这是它在C中被使用旳一种重要原因 What is overloading?? With the C++ language, you

49、can overload functions and operators. Overloading is the practice of supplying more than one definition for a given function name in the same scope. - Any two functions in a set of overloaded functions must have different argument lists. - Overloading functions with argument lists of the same type

50、s, based on return type alone, is an error. What is Overriding? To override a method, a subclass of the class that originally declared the method must declare a method with the same name, return type (or a subclass of that return type), and same parameter list. The definition of the method o

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服