意法半導體軟體測試筆試題分享
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;
root = dtree (root, h, w); // h and w are integers get from input
.........
}
-
2007.中國銀行筆試經驗
1月3號,別人都還在假期的幸福中呢,BT的中國銀行在這個時候開考,而且天還下著雨,陰冷陰冷的。。。不過確實是抱著體驗的心理,想去看看傳說中的4小時的考試到底考點什麼,所以我還是掛上mp3,衝進了雨裡。趕到那個在邊邊角角的上海商學院,在路上竟然險遇新疆小孩,發現有人拉...
-
2007年中國人民銀行經濟金融類筆試題目
2007年中國人民銀行經濟金融類筆試題目判斷題很多都是社會主義市場經濟理論的題,簡答最難的就是李嘉圖等價,誰也不知道到底是什麼。我身邊的人沒有一個人答上來的!汗!可以想起來的題目如下:1、AD?AS模型:用他分析資源產品價格上升對物價的影響2、什麼是李嘉圖等價(印...
-
國家電網筆試技巧
筆試很簡單。專業課,考的是最基礎的內容,考試時間2個半小時,充裕的可以當兔子。比如計算機,考了三門。一門資料庫,都是SQL操作,加一道元組運算操作一道關係代數操作(偶這個時候想砍那個傳資料庫課件給偶的師弟或是師妹,居然傳給偶的是高階資料庫,嗚嗚,一點基礎內容都沒...
-
五礦集團筆試經驗
昨天中午,老闆沒有請我吃飯。我就自己去吃了吉野家,吃完飯之後,就在座位上看人來人往。開始的時候,我的右邊坐的是一對情侶。不過還好,沒有像大學食堂裡面那麼膩歪歪的相互餵飯。情侶走後,就來了幾個甘家口商場的工作大媽。因為都是中年婦女,估計社會地位和工資都比較...