via筆試題(software engineer)
發信人: szlychee ( whereami )
有些細節記不清了。
1、array和linked list的區別。
2、unsigned short a=65535;
unsigned short b=10;
unsigned short c=a+b;
問c是多少?
3、pop ebx
sub ebx,offset delta,
問ebx的含義。這個實在記不清了。
4、unsigned int 型一個數組,按照比特位中“1”的個數對數組元素進行從小到大排序,如果含有“1”的`個數相同,按從小到大排
序,unsigned int 32位。
函數原型: int sort(unsigned int *a, int len);
5、排列組合C(n,k)=n!/(n-k)!/k!,要求用(1)遞歸實現;(2)迭代實現;(3)用C(n,k)=C(n-1,k)+C(n-1,k-1)實現,可以用遞歸
。
函數原型: int combination(int k, int n);
6、爲了節省存儲,採用位域操作:
struct a{unsigned int a;
unsigned int b;
unsigned int c:21;
unsigned int d:6;
unsigned int e:3;
unsigned int f:2;};
但位域存在可移植性問題,考慮編譯器的可移植性和不同的系統架構(大體意思),重新定義:
struct a{unsigned int a;
unsigned int b;
unsigned int physicallocation;}psc,*psc;
其中c、d、e、f存儲在physicallocation裏,根據第一個位域的定義寫出對physicallocation中d的讀、寫、刪除操作,性
能越快越好(這個的意思估計要用宏或者inline函數)。
7、一道PCI總線中斷的題,光題目就佔了快2頁,問題一些寄存器,中斷號的題目。沒做過PCI的項目,而且時間也不夠了。