意法半导体笔试题目分享
面试笔试1.65W
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;
-
马士基笔试有感
前天去马士基笔试,真是很认真的感受了一下大公司的氛围!3点去了之后,带我们进了一个会议室,然后电脑开始播放马士基的文化和业务。三点钟准时开始的笔试!第一项,填写个人简历,发下来一看,全是英文啊,根本也看不懂啊,没办法填吧,把我仅有的高中水平都用上了,接下来是靠英文...
-
今天去了明基笔试
今天是一个很郁闷的日子!下午去听了明基的宣讲会,是我第一次很认真的听的一次,连bj我都没有这么认真的听过,我还做了笔记。但是最悲惨的事情还是发生了。晚上笔试的时候,我心态一直都挺好的,6:00pm,IQ测试做起来除了几个单词不认识的都还可以,6:45发了第二套卷子,卷子上表...
-
工行数据中心面经--2006,北邮
工行数据中心面经--2006,北邮先说地点,在西三旗建材城东二里。确实如水母上说的,极其扎眼的一栋建筑物,就是没有什么标示(我学金融的同学说银行就是要让你觉得他们有钱)正题:和几个人在一个小会议室里瞎扯,等到10点,终于轮到了我这一组。(今天好希奇,是7vs3,而不是昨天那个...
-
Google笔试记
Google笔试是没有门槛的。这样说是因为Google根本没有限制笔试的人数,开了N个教室,让N多人参加……不过笔试本身却有门槛,看了题目就知道。本来想上午写写的,但是,嗯,出于攒人品的目的,还是等到现在才写——现在,面试通知已经发过,很显然我又被无...