意法半导体笔试题目分享(软件测试)
面试笔试1.9W
A Test for The C Programming Language
I. History
1. C was originally designed for and implemented on the (what) operating system on the DEC PDP-11, by (who) .
2. The most recently approved ANSI/ISO C standard was issued in (when) , and single line comments notation “//” is or isn’t a feature of C89.
II. Syntax and Semantics 1. In a runtime C program, auto variables are stored in , static variables are stored in , and function parameters are stored in .
a. stack b. heap c. neither stack nor heap
2. The statement “extern int x;” is a , and the keyword extern is used during .
a. variable declaration b. variable definition c. compilation time d. runtime
3. There is a complicated declaration: void ( * signal (int, void (*)(int)) ) (int);If a statement “typedef void (*p) (int);” is given, please rewrite this complicated declaration.
4. The following code is a segment of C program.
..........
void func(int *p)
{...........}
..........
main()
{
int num=0;
.........
func(&num);
........
}
..........
Here, the function argument “&num” is passed .
a. by value b. by reference
III. Practice
Create a tree, which has h (h>0) layers, and its each node has w (w>0) se complete the following incomplete solution.
#include <stdlib.h>
#include <string.h>
struct tree{
char info;
p_sub; //link to sub-nodes};
// allocate memory and initiate
void dnode ( struct tree* tmp )
{
= malloc( sizeof (struct tree) );
= 0x41;
= NULL;
}
struct tree *dtree (struct tree* subtree, int height, int width)
{
int i;
if ( !subtree ) //if necessary, allocte memory for subtree
denode(subtree);
if ( height == 1 )
return subtree;
else if ( height == 2 ) {
struct tree *leaf = NULL;
for ( i=0; i<width; i++ ) {
denode ( );
;
leaf = NULL;}
return subtree;}
else {
for ( i=0; i<width; i++ ) {
}
return subtree;
}
}
main()
{
.........
struct tree *root = NULL;
I. History
1. C was originally designed for and implemented on the (what) operating system on the DEC PDP-11, by (who) .
2. The most recently approved ANSI/ISO C standard was issued in (when) , and single line comments notation “//” is or isn’t a feature of C89.
II. Syntax and Semantics 1. In a runtime C program, auto variables are stored in , static variables are stored in , and function parameters are stored in .
a. stack b. heap c. neither stack nor heap
2. The statement “extern int x;” is a , and the keyword extern is used during .
a. variable declaration b. variable definition c. compilation time d. runtime
3. There is a complicated declaration: void ( * signal (int, void (*)(int)) ) (int);If a statement “typedef void (*p) (int);” is given, please rewrite this complicated declaration.
4. The following code is a segment of C program.
..........
void func(int *p)
{...........}
..........
main()
{
int num=0;
.........
func(&num);
........
}
..........
Here, the function argument “&num” is passed .
a. by value b. by reference
III. Practice
Create a tree, which has h (h>0) layers, and its each node has w (w>0) se complete the following incomplete solution.
#include <stdlib.h>
#include <string.h>
struct tree{
char info;
p_sub; //link to sub-nodes};
// allocate memory and initiate
void dnode ( struct tree* tmp )
{
= malloc( sizeof (struct tree) );
= 0x41;
= NULL;
}
struct tree *dtree (struct tree* subtree, int height, int width)
{
int i;
if ( !subtree ) //if necessary, allocte memory for subtree
denode(subtree);
if ( height == 1 )
return subtree;
else if ( height == 2 ) {
struct tree *leaf = NULL;
for ( i=0; i<width; i++ ) {
denode ( );
;
leaf = NULL;}
return subtree;}
else {
for ( i=0; i<width; i++ ) {
}
return subtree;
}
}
main()
{
.........
struct tree *root = NULL;
-
我的第一次笔试-麦德龙储备干部 中大 2006-12-10
我的第一次笔试-麦德龙储备干部中大2006-12-106日晚上12点,打算查查邮件,然后上床睡觉,竟然惊喜的发现麦德龙发了一份邮件给我,邀请我去参加9日在中大的笔试,虽然在500强企业精英学子见面会投简历的时候,我就觉得去麦德龙实习的机会是有的,那个可爱的HRJJ还问了我寒假...
-
大唐电信笔试题
大唐电信笔试题考试时间一小时,第一部分是填空和选择:1.数列6,10,18,32,?,问?是几?2.某人出70买进一个x,80卖出,90买回,100卖出,这桩买卖怎么样?3.月球绕地球一圈,至少要多少时间?4.7个人用7小时挖了7米的沟,以同样的速度在50小时挖50米的沟要多少人?5.鱼头长9,鱼尾等于鱼头加半个鱼身,鱼...
-
马士基笔试经历--厦门
昨晚还在琢磨到底穿不穿正装。不过还是比较羞涩不敢穿今天就穿了有领短袖+西裤+皮鞋。。恩一般正式10点多就伙同一群厦大的一起坐车过去。在国际银行20楼maersklogetics的office在等候了40多分钟后终于把我们请进了会议室(期间一直观察那些staff在office是不是...
-
重庆联通笔试--通信类
前两周忘了什么时间去笔试重庆联通,地点重庆党校,又是大清早浑浑僵僵下了山,按点到了河运校附近。通信的看考场笔试的一共60位,其它的考场则是考人力之类,似乎搞的还满正式。开考前,周围看看,重邮通信的研究生至少也有个十五个吧。考场的HR先是恭喜大家顺利参加笔试,说...