意法半导体笔试题目分享
面试笔试1.5W
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 a runtime C program, auto variables are stored in , staticvariables 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 a runtime C program, auto variables are stored in , staticvariables 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;
-
花旗商行笔试
花旗商行笔试发信站:北大未名站(2005年12月06日18:46:48星期二),转信看有人问,说一下吧先是numericalreasoning,和shl的题感觉不太相同,时间稍紧一些不许使用计算器,总体来说还没什么问题然后是groupdiscussion,一组九个人,15min看案例(5页英文)30min英文讨论,最后要有...
-
盛大笔经(经历而不是经验)
1)发卷子速度慢。。。恩2)公共卷是些逻辑,填数列,图形填空什么的iq题,难度一般(我就前两个数列题卡住了。。。0,10,24,68,?)==3)游戏软件工程师的专业题有些选做题是分两个方向的,要么选做socket要么选directx,想都不用想就选了前者=.=题目难度还可以,就是有些指针,内存...
-
阿里巴巴一个笔试题
A,B头上各有一顶帽子,帽子上各有一个大于0的整数,已知这两个整数相差1。A,B能看见对方的帽子,但是看不见自己。这时候:C问A:你知道你头上的数字是多少吗?A说:不知道C问B:你知道你头上的数字是多少吗?B说:不知道C又问A:你知道你头上的数字是多少吗?A说:不知道C又问B:你知道你头...
-
我的第一次笔试-麦德龙储备干部 中大 2006-12-10
我的第一次笔试-麦德龙储备干部中大2006-12-106日晚上12点,打算查查邮件,然后上床睡觉,竟然惊喜的发现麦德龙发了一份邮件给我,邀请我去参加9日在中大的笔试,虽然在500强企业精英学子见面会投简历的时候,我就觉得去麦德龙实习的机会是有的,那个可爱的HRJJ还问了我寒假...