顯示廣告
隱藏 ✕
看板 rikaka
作者 rikaka (rikaka)
標題 Re: 面試考題整理
時間 2012年03月27日 Tue. PM 12:38:08


source: http://pesty.yichi.org/blog/2008/06/24/cs_interview_questions/

如果你說你修過演算法/資料結構…

*解釋時間複雜度?空間複雜度?兩者之間的關係?
*請解釋以下幾種資料結合及運作方式: hash, heap, stack, tree
*請提出一種時間複雜度為 NlogN 的演算法,並用你熟悉的語言寫出來

如果你說你修過作業系統/計算機系統…

*process & thread 有何不同?
*決定 cache 效能的兩個指標?
*什麼是同步化?要怎麼寫?
*什麼是 deadlock?要怎麼解決?


如果你說你會寫程式…
什麼是 call by value?什麼是 call by reference?兩者的優缺點?
*寫一個迴圈來看看?
*寫一個遞迴來看看?
*什麼是 function 的 signature?回傳值能不能是 signature 的一部份?
*什麼是 static function?什麼是 static variable?

如果你說你會資料庫…
*什麼是 normalization?為什麼要做 normalization?
http://sjchen.im.nuu.edu.tw/Database/99/Ch04.pdf
正規化主要是對表格做分割的動作
沒有正規化會造成:
{ 容易有資料重覆儲存的浪費情形
{ 資料在做插入、刪除或更新動作時產生異常(Anomalies)情形
目的:
{ 降低資料重覆性(Data Redundancy)
{ 避免產生插入、刪除或更新可能的異常(Anomalies)

*解釋 inner join, left (outer) join, right (outer) join
inner join是兩個table都有match  
	
	
	
return rows when there is at least one match in both tables.
left join是left table有match  
	
	
	
 all rows from the left table (table_name1), even if there are no matches in the right table (table_name2).
right join是right table有match
	
	
	
 returns all the rows from the right table (table_name2), even if there are no matches in the left table (table_name1).

*table 為什麼要做 index? 舉一個做 index 有用的例子和沒用的例子?
http://ithelp.ithome.com.tw/question/10012001
建index是為了加快查詢的速度,避免full table scan,通常資料量很大的table都需要建index,至於要用那些欄位建index,主要要看你常下的where條件,資料庫會自動採用適合的index來完成查詢,不過建索引在新增或更新資料列時會多花一些時間,所以沒用到的索引也不要亂建

如果你說你會 C/C++…
請搞懂 pointer
常考題:bit運算、call by value/reference


http://www.ptt.cc/bbs/C_and_CPP/M.1330191257.A.37C.html
美國某著名嵌入式系統公司2005年9月面試題,供板友們練習
Write in words the data type of the identifier involved in the following
definitions.
(1) float (**def)[10];
(2) double *(*gh)[10];
(3) double (*f[10])();
(4) int *((*b)[10]);
(5) long (*fun)(int);
(6) int (*(*F)(int, int))(int);

(1) def是一個指向指標的指標,*def是指向一個有10個元素的一維陣列的指標,陣列的
元素型別為float
(2) gh是一個指標,指向一個有10個元素的一維陣列,陣列元素型別為double*
(3) f是一個有10個元素的陣列,陣列的元素型別為函式指標,指向的函式為沒有參數且
返回值型別為double的函式
(4) b是一維陣列的指標,陣列元素型別為int*
(5) fun是一個函數指標。指向的函數輸入參數型別為int,回傳值型別為long
(6) F是一個函數指標,指向的函式輸入參數為(int, int),並返回一個函式指標。返回
的函式指標指向一個輸入參數為(int)回傳值型別為int的函式

如果你說你會 JAVA…

請搞懂 OOP
我遇過考Java的只有HTC,網路上有考古題可以看

如果你說你會 PERL…

請搞懂 Regular Expression
沒遇過關心Perl的公司,反而有在問python的,不過都說進去再學就好

如果你說你會 PHP…
給你半小時應該要能生出一個 Hello, Pesty 的網頁 (當然,Pesty 是 form input 的)

如果你說你會 TCP/IP…

*把下面幾個服務依使用到的原理照 OSI 層排序: http, telnet, DNS, MAC Address, ping, session, vpn


http://en.wikipedia.org/wiki/OSI_model
OSI model layer
7.application layer
NNTP  ·  SIP  ·  SSI  ·  DNS  ·  FTP  ·  Gopher  ·  
HTTP  ·  NFS  ·  NTP  ·  SMPP  ·  SMTP  ·  SNMP  ·  Telnet  ·  DHCP  ·  Netconf  ·  RTP  ·  SPDY  ·
DNS

6.presentation layer
MIME  ·  XDR  ·  TLS  ·  SSL

5.session layer
Named pipe  ·  NetBIOS  ·  SAP  ·  PPTP ·  SOCKS

4.transport layer
TCP  ·  UDP  ·  SCTP  ·  DCCP  ·  SPX

3.network layer
IP (IPv4, IPv6)  ·  ICMP  ·  IPsec  ·  IGMP  ·  IPX  ·  AppleTalk

ping的運作原理是:向目標主機傳出一個ICMPecho要求封包,等待接收echo回應封包。

http://answers.yahoo.com/question/index?qid=1006051613322
The answer is 1, 2, and 3.

Ping operates at the Network layer. An ICMP Packet is encapsulated in a Frame at layer 2 and then put on the wire at layer 1 in bits. When it gets to the destination, it is processed back up the stack in reverse manner.

You always go all the way down the stack, so 1 and 3 can't be right (skips layer 2).

ICMP (PING and Trace route) operate at layer 3, so 4 through 7 is incorrect.

2.data link layer
ATM  ·  SDLC  ·  HDLC  ·  ARP  ·  CSLIP  ·  SLIP  ·  GFP  ·  PLIP  ·  IEEE 802.2  ·  LLC  ·  L2TP  ·  IEEE 802.3  ·  Frame Relay  ·  ITU-T G.hn DLL  ·  PPP  ·  X.25  ·  Network switch

1.physical layer
EIA/TIA-232  ·  EIA/TIA-449  ·  ITU-T V-Series  ·  I.430  ·  I.431  ·  POTS  ·  PDH  ·  SONET/SDH  ·  PON  ·  OTN  ·  DSL  ·  IEEE 802.3  ·  IEEE 802.11  ·  IEEE 802.15  ·  IEEE 802.16  ·  IEEE 1394  ·  ITU-T G.hn PHY  ·  USB  ·  Bluetooth  ·  Hubs

*解釋 class A, B, C, 和 class-less
http://en.wikipedia.org/wiki/Classful_network

如果你說你會 UNIX….

*怎麼把 ls 的結果導到 /tmp/test.txt 中?
ls > /tmp/test.txt
*為什麼平常操作不該用 root?
這裡的 root 就是所謂的超級使用者,這個使用者是 UNIX 系統中的預設管理者名稱。
root 擁有系統所有權限,我們可以使用這個帳號登入系統進行管理。
root 這個使用者擁有許多一般使用者所沒有的權限,建議您平常使用時最好不要以 root 登入。
例如收發 email,程式開發、瀏覽網頁、練習 UNIX 指令等,應該以一般使用者的身份來進行。
因為您可能不小心打了某個指令而刪除不該被刪除的檔案、或因為不良的操作而影響系統的穩定。
因此,在我們設定完系統後,您應該新增一個一般使用者以減少錯誤的發生。

--
※ 作者: rikaka 時間: 2012-03-27 12:38:08
※ 編輯: rikaka 時間: 2012-03-27 14:23:47
※ 同主題文章:
※ 看板: rikaka 文章推薦值: 0 目前人氣: 0 累積人氣: 11644 
分享網址: 複製 已複製
guest
x)推文 r)回覆 e)編輯 d)刪除 M)收藏 ^x)轉錄 同主題: =)首篇 [)上篇 ])下篇