外企技术面试题_which statements below are reasons for a corporati-程序员宅基地

技术标签: 10_笔/面试题集锦分析  

1.From secure programming perspective, which line of the following code has problem?         

line 1:     int main ( int argc, char* argv [] )

line 2:     {

line 3:        char buff [32];

line 4:        if ( argc != 2 ) return ( -1 );

line 5:        strncpy (buff, argv[1], sizeof(buff));

line 6         exit(0);

line 7:     }

 

A. Line 3

B. Line 4

C. Line 5

D. Line 6

2.Which is the correct description of the static data member of a class in C++ language? 

A.  The static data member is allocated in heap. 

B.  The static data member exists before any object of this class is created. 

C.  The static data member in a class has different value in respective instance of this class. 

D.  The declaration for a static data member of a class is as below: 

3.

class A 

﹛  

protected: 

static int nVariable = 0; 

…  

class B : public A ﹛  

public: 

B() ﹛ Funcl(); ﹜ ; 

      void Funcl(){ cout<< 〝 B: : Funcl  is  called! 〞 <<endl; }; 

      void Func2(int n){ cout<< 〝 B: : Func2  is  called! 〞 <<endl; }; 

﹜ ; 

void main(void){ 

A a, *pa; 

B b; 

pa=&b; 

       pa->Funcl(); 

       pa->Func2(); 

﹜  

A.  A::Func1 is called! 

    A::Func1 is called! 

    A::Func2 is called! 

B.  A::Func1 is called! 

    A::Func1 is called! 

    B::Func2 is called! 

C.  A::Func1 is called! 

    B::Func1 is called! 

    A::Func2 is called! 

D.  B::Func1 is called! 

    A::Func1 is called! 

    A::Func2 is called! 

E.  B::Func1 is called! 

    A::Func1 is called! 

    B::Func2 is called! 

F.  B::Func1 is called! 

    B::Func1 is called! 

A::Func2 is called!

 

4.What is the output of the following C code when running on 32-bit system?

#include <stdio.h> 

#include <malloc.h> 

int main(void) ﹛  

char array[5] = {0}; 

char *pa = array; 

char *pb = (char*)malloc(5) ; 

printf( “ %d, %d, %d/n 〞 ,  sizeof(array), sizeof(pa), sizeof(pb)); 

free(pb); 

return 0; 

A. 5, 5, 5 

B. 4, 4, 5 

C. 5, 4, 4 

D. 4, 5, 4

5.What's the output of below code in 32-bit little endian system? 

#include <stdio.h>

typedef union A{ 

  short a;

  char b[2];

  long c;

} UNION_A; 

int main(void){ 

  UNION_A a;

  a.b[0] = 10;

  a.b[1] = 1;

  printf("%d, %d", a.a, sizeof(a));

  return 0;

A. 266, 2 

B. 266, 4 

C. 2561, 2 

D. 2561, 4

6.If the system RAM memory address is valid from 0x10000000 to 0x20000000, what’s the behavior of running below code in 32-bit system? 

#include <iostream.h> 

using namespace std; 

int main(void){ 

  int *pvalue = (int*) 0x10000003;

  *pvalue = 0x01020304;

cout << *pvalue << endl; 

return 0;

A. 0x020304; 

B. 0x01020304 

C. 0x01 

D. Exception

7.If taking the following definitions, how can we call the CObject toString method in CCircle class? 

class CObject { 

public: 

  virtual void toString(){

   // do something..

  }

}; 

class CCircle : public CObject{ 

public: 

  void toString(){

  __________

  }

A.  toString();

B.  ((CObject*)this)->toString();

C.  CObject::toString();

D.  CObject obj; 

    obj.toString();

8.Which protocol could be at the lowest layer?

A. ICMP

B. UDP

C. ARP

D. HTTP

9.Which one of below is NOT the functionality of IP layer?

A. Receive a message to send from a higher-level protocol layer such as TCP or UDP

B. Place the message in an IP datagram that consists of an IP header, followed by the message to send

C. Pass the datagram to a lower layer such as an Ethernet driver which sends the datagram on the network

D. Send the data, name the port that will use the data at the destination, handshake to inform the source whether the destination received the data

10.In linux kernel, which state is for a blocked process?

A. TASK_INTERRUPTIBLE

B. TASK_UNINTERRUPTIBLE

C. TASK_KILLABLE

D. All of the above

11.Which statements of below are true in term of priority inversion in real-time system? (Multiple choices)

A. Have at least 3 tasks with different priority

B. Have at least 2 tasks with different priority

C. A shared resource that may block requesting tasks

D. Can be resolved by priority ceiling or priority inheritance algorithm

12.For what kind of device, Linux can NOT access it through the file in /dev

A. Character device

B. Block device

C. Network interface

D. All of the above

13.Which statements below are the possible reasons that can cause a thread been suspended? (Multiple choice)

a) Higher priority task is ready

b) An interrupt occur

c) The thread is waiting a message

d) Thread is in progress of I/O operation

14.How to change the access permissions of the specified files or directories?

A. more

B. ps

C. chmod

D. fsck

15.Which of the following mechanisms should be used when multiple processes need to communicate and the communicated item need be accessed randomly?

A. Shared memory

B. Message queue

C. Pipe

16.In UNIX system,if file A has the permission of 0740, the same group's users of file A may do:

A. Read A only

B. Write A

C. Execute A

D. Non-operation

17.In network interface driver, which function can send the packet received to protocol layer?

A. register_netdev

B. netif_rx

C. ioremap

D. net_pkg_route

18.Which device can put JFFS2 file system above it?

A. /dev/mtd0

B. /dev/mtdblock0

C. /sys/bus/mtd0

D. /dev/ram0

19.In linux kernel, which struct is used to descibe the charactor device?

A. Struct cdev

B. Struct net_device

C. Struct file_operations

D. Struct char_dev

20.In linux kernel module,which macro is used to define a module parameter?

A. MODULE_AUTHOR

B. MODULE_LICENSE

C. MODULE_ALIAS_MISCDEV

D. module_param

21.In linux kernel, which function is used to covert physical address to virtual address?

A. mmap

B. malloc

C. ioremap

D. ioctl

22.In linux kernel, which struct is used to USB transfer?

A. skb

B. urb

C. cdev

D. udev

23.which is the default syslog level for printk()?

A. KERN_INFO

B. KERN_DEBUG

C. KERN_WARN

D. KERN_EMERG

24.In linux tty subsystem, bluetooth protocol is located in?

A. tty core

B. tty line discipline

C. tty driver

D. tty device

25.Which function should be used when we want to enable hardware interrupt, but disable software interrupt in spin lock?

A. spin_lock

B. spin_lock_irqsave

C. spin_lock_irq

D. spin_lock_bh

26.How can we use disk partition to store hibernate image?

A. make this partition as swap and enable swap on it

B. make this partition as swap but disable swap on it

C. fill this partition with magic number

D. make ext2 file system on this partition and mount it to /hibernate

27.In linux driver, when request_irq, which flag is used to quick irq?

A. SA_INTERRUPT

B. SA_SHIRQ

C. SA_QUICKIRQ

D. SA_IRQ

28.Which function shall block when call?

A. bind

B. listen

C. accept

D. socket

29.What's the behavior of signal for NPTL thread?

A. signal send to the whole process

B. signal send to the main thread

C. signal send to random thread

D. signal send to all threads except the main thread

30.Which type of linux kernel image can be boot by u-boot "bootm" command?

A. zImage

B. bzImage

C. vmlinux

D. uImage

 

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/xiaopangzi313/article/details/9275013

智能推荐

【Python】处理 WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)_ignoring invalid distribution -ip (e:\python\lib\s-程序员宅基地

文章浏览阅读3.2w次,点赞69次,收藏62次。@[TOC](【Python】处理 WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)错误)最近在使用pip 安装插件的时候,出现下面的警告信息:WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)解决方法:找到警告信息中报错的目录,然后删掉~开头_ignoring invalid distribution -ip (e:\python\lib\site-packages)

python3 urllib.request程序崩溃,被Python3搞得好崩溃,抓取网页的有关问题-程序员宅基地

文章浏览阅读296次。被Python3搞得好崩溃,抓取网页的问题赶时髦,装了个python3.3,发现网上很多资料都是2.7的,没关系,自己慢慢研究吧,可是搞了个抓取网页的程序,一运行就报错,找了几个网上类似的Python3的代码,跑了一下一样的错误,真的被这些脚本语言的环境和版本匹配搞得快崩溃了,哪位有类似经验的帮我看看吧:代码:importurllib.parseimporturllib.requesturl=..._urllib线程不安全

XML解析文件出错解决方法_xml解析错误-程序员宅基地

文章浏览阅读4.6w次。在解析xml时,经常因为文件中含特殊字符而解析失败。原因有两个:一是内容中含有XML预定义好的实体,二是内容中含有低位非打印字符。 1.内容中含有xml预定好的实体,如“&lt;”_xml解析错误

用 CentOS 7 打造合适的科研环境-程序员宅基地

文章浏览阅读188次。这篇博文记录了我用 CentOS 7 搭建 地震学科研环境 的过程,供我个人在未来重装系统时参考。对于其他地震学科研人员,也许有借鉴意义。阅读须知:本文适用于个人电脑,不适用于服务器;不推荐刚接触 Linux 的人使用 CentOS 发行版;本文尽量写的浅显易懂,但要求读者掌握 Linux 基础知识;本文所有操作均在 CentOS 7 下完成,其他发行版或多或少与 Cent..._centos 集成电路

基于YOLOV5的水果识别+Pyqt界面+水果计价_二、 基于yolov5的水果识别csdn-程序员宅基地

文章浏览阅读921次。YOLOv5是一种快速、高效的目标检测算法,可以广泛应用于各种物体检测任务。本文将介绍如何使用YOLOv5进行水果识别任务的实现,识别水果并且计价。_二、 基于yolov5的水果识别csdn

第二章 计算机信息安全技术-程序员宅基地

文章浏览阅读907次,点赞19次,收藏23次。信息安全是一门涉及计算机科学、通信技术、网络技术、信息安全技术、密码技术、应用数学、数论、信息论等多个学科的综合性学科。信息安全是指保护信息网络的硬件、软件及系统中的数据不受偶然的或恶意的原因而遭到破坏、更改、泄露,并维持系统连续、可靠、正常地运行。广义上讲,凡是涉及信息的保密性、完整性、可用性等方面的相关技术和理论,都是信息安全的研究领域。大到国家军事、政治等机密安全,小到防止商业机密、个人信息的泄露等,都属于信息安全的范畴。考点概述。_计算机信息安全技术

随便推点

C语言数组大小-程序员宅基地

文章浏览阅读4.9k次,点赞2次,收藏9次。通过sizeof()函数得到C语言数组长度_c语言数组大小

即使是庸才我也要成为庸才中的人才-程序员宅基地

文章浏览阅读122次。个人篇本人一个农村娃,接触电脑晚,从小蛮羡慕那些计算机高手,尤其是那些黑客,可以出入他人电脑就像在自家院子闲逛一样,由于见识少,以为这些高深的技术都是天才才能玩的,对这些也只是想想,从来不认为自己也可以学这些。想想那时候还是蛮傻的啊,那些人即使是天才那也还只是一个人,人和人刚出生时候的差距能有多大啊(也就是一个人比另一个人体重重那么点的差距)。后来慢慢接触电脑了,也是看看电影,...

YOLOv5进阶 | 利用PyQt搭建YOLOv5目标检测系统(附可视化界面+功能介绍+源代码)_yolo界面-程序员宅基地

文章浏览阅读9.6k次,点赞16次,收藏161次。系统支持输入图片、视频、摄像头和RTSP视频流的目标检测,其中,可以对图片进行处理,包括灰度化、平滑处理、均衡化、形态学、图像梯度、阈值处理、边缘检测、轮廓检测、直线检测、亮度调节和伽玛校正。_yolo界面

微信红包——功能测试用例_微信红包测试用例设计-程序员宅基地

文章浏览阅读1.8k次,点赞4次,收藏9次。微信红包测试用例_微信红包测试用例设计

UI设计中开屏页如何设计_ui设计开屏页的种类-程序员宅基地

文章浏览阅读446次。  大家好,今天我为大家带来的文章是开屏页设计。用户只需要50毫秒(0.05秒)就能对网站/App做出评价,从而决定是留下还是离开。开屏页设计的合理性很大程度上影响了用户的初体验。  第一印象很重要!很多用户会根据App/网站的初始形象来判断是否可以信任这家公司或这个产品。  那么如何解决快速感知的问题呢?首先将关注点放在App带给我们的第一印象上。合理的启动页能激发用户的潜意识,有助于吸引和留存合适的用户。  在深入研究设计策略之前,先来了解一下启动画面的基本知识。  什么是启动画面?_ui设计开屏页的种类

linux下qt中获取内存大小,qt 获取磁盘空间大小,cpu利用率,内存使用率-程序员宅基地

文章浏览阅读2.2k次。1:封装成一个类,直接调用即可。已经在多个商业项目中使用。2:所有功能全平台 win linux armlinux 亲测无误,网络上的基本上是烂的或者不可用的,不知道走过多少弯路。3:linux下CPU占用率的计算非常准确,支持多核。4:硬盘容量计算极速。进度条显示占用比例。5:多彩数码管实时显示当前时间。6:自定义颜色下拉框,选择即可看到效果。完整源码下载:demo1.zip(10 K) 下载..._qt获取cpu使用率linux