網易遊戲運維筆試題



看完題目你有何感覺?滿滿的都是鳥哥的影響啊,出題人在拿着鳥哥那本書出題目的吧,有木有大哭


1、

  1. 普通文件、目錄、字符設備文件、塊設備文件、符號鏈接文件  
  2.   
  3. http://blog.csdn.net/yangcs2009/article/details/38011137  
普通文件、目錄、字符設備文件、塊設備文件、符號鏈接文件

http://blog.csdn.net/yangcs2009/article/details/38011137

2、
  1. 常見的格式包括有rpm、tar、gz、tgz、bz、bz2等等。   
常見的格式包括有rpm、tar、gz、tgz、bz、bz2等等。 


3、常見Linux文件系統4個

  1. 網絡文件系統,如 nfs、cifs 等;
  2. 磁盤文件系統,如 ext4、ext3 等;
  3. 特殊文件系統,如 proc、sysfs、ramfs、tmpfs 等。

4、shell腳本中  /bash/false的作用

10、NAT的實現方式有3種 1、靜態NAT(一對一)  2、動態NAT(多對多)  3、端口多路複用NAT(多對一)

http://20100823.blog.51cto.com/2031838/401704

14、使用shell命令輸出當前時間  輸出格式爲 2012-12-12 12:12:12

  1. michael@ubuntu:~$ date "+%Y-%m-%d %H:%M:%S"  
  2. 2014-09-28 05:27:12  
michael@ubuntu:~$ date "+%Y-%m-%d %H:%M:%S"
2014-09-28 05:27:12

15、在shell中 *表示 0個或多個字符     在正則表達式中*表示 匹配前面的子表達式零次或多次


三、簡答

1、Linux常用 load balance的3個數字表示系統負載,請問

1)這三個數字分別代表什麼?

The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes.

可以用以下命令獲取系統的平均負載值.

top

uptime

w


2)這裏的”負載“的真實含義是什麼?


3)請列舉3個可能導致負載高的原因

http://wenku.baidu.com/view/bd3c31fa700abb68a982fb40.html

http://blog.chinaunix.net/uid-22646981-id-3196212.html

查看系統負載

  1. michael@ubuntu:~$ vmstat  
  2. procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----  
  3.  r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa  
  4.  0  0      0 474124  38812 563256    0    0   217   357   80  215  3  5 87  5  
  5. michael@ubuntu:~$   
michael@ubuntu:~$ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  0      0 474124  38812 563256    0    0   217   357   80  215  3  5 87  5
michael@ubuntu:~$ 

2、


3、foo1; foo2 && foo3 | foo4 > foo5

請解釋該命令執行的過程,其中foo5可能包含什麼內容?

  1. foo1, foo2 , foo3 與 foo4 都是命令, foo5 是裝置或文件。整串命令意義爲:  
  2.   
  3. (0)執行 foo1 ;  
  4. (1)執行foo2,當 foo2 運行結果有錯誤時,則該命令串結束;  
  5. (2)若 foo2 運行結果沒有錯誤時,則運行 foo3 | foo4 > foo5 ;其中:  
  6. (2-1)foo3 將 stdout 輸出的結果傳給 foo4 處理;  
  7. (2-2)foo4 將來自 foo3 的 stdout 當成 stdin ,處理完後將數據流重新導向 foo5 這個裝置/文件  
  8.   
  9. http://vbird.dic.ksu.edu.tw/linux_basic/0320bash_7.php  
foo1, foo2 , foo3 與 foo4 都是命令, foo5 是裝置或文件。整串命令意義爲:

(0)執行 foo1 ;
(1)執行foo2,當 foo2 運行結果有錯誤時,則該命令串結束;
(2)若 foo2 運行結果沒有錯誤時,則運行 foo3 | foo4 > foo5 ;其中:
(2-1)foo3 將 stdout 輸出的結果傳給 foo4 處理;
(2-2)foo4 將來自 foo3 的 stdout 當成 stdin ,處理完後將數據流重新導向 foo5 這個裝置/文件

http://vbird.dic.ksu.edu.tw/linux_basic/0320bash_7.php




6、AB

行內元素有:a b span I b em img input select strong
塊級元素有:div ul ol li dl dt dd h1 h2 h3 h4…p
盒模型:margin border padding content


8、C

http://zh.wikipedia.org/wiki/%E8%BF%9E%E6%8E%A5_(SQL)#.E8.87.AA.E8.BF.9E.E6.8E.A5


9、AD

聚集索引(clustered index)就是按照每張表的主鍵構造一棵B+樹,同時葉子節點中存放的爲整張表的行記錄數據。也將聚集索引的葉子節點稱爲數據頁。同B+樹數據結構一樣,每個數據頁都通過一個雙向鏈表進行鏈接。

由於實際的數據頁只能按照一棵B+樹進行排序,因此每張表只能擁有一個聚集索引。在多數情況下,查詢優化傾向於採用聚集索引。因爲聚集索引能夠在B+樹索引的葉子節點直接找到數據。另外,由於定義了數據的邏輯順序,聚集索引能夠特別快的訪問針對範圍的查詢。

聚集索引的存儲並不是物理上連續的,而是邏輯上連續的。這其中有兩點原因:一是數據頁通過雙向鏈表鏈接,數據頁按照主鍵的順序排序;另一點是每個頁中的記錄也是通過雙向鏈表進行維護的,物理存儲上可以同樣不按照主鍵存儲。


3、-*+-*+ABCDEFG

中綴表達式:運算符放在兩個運算對象中間,如:(2+1)*3

後綴表達式:不包含括號,運算符放在兩個運算對象的後面,所有的計算按運算符出現的順序,嚴格從左向右進行(不再考慮運算符的優先規則,如:2 1 + 3 *

前綴表達式:同後綴表達式一樣,不包含括號,運算符放在兩個運算對象的前面,如:* + 2 1 3

6、5

8、

304(未修改)

自從上次請求後,請求的網頁未修改過。服務器返回此響應時,不會返回網頁內容。

如果網頁自請求者上次請求後再也沒有更改過,您應將服務器配置爲返回此響應(稱爲 If-Modified-Since HTTP標頭)。服務器可以告訴 Googlebot 自從上次抓取後網頁沒有變更,進而節省帶寬和開銷。

403(禁止) 服務器拒絕請求。如果您在 Googlebot 嘗試抓取您網站上的有效網頁時看到此狀態碼(您可以在 Google網站管理員工具診斷下的網絡抓取頁面上看到此信息),可能是您的服務器或主機拒絕了Googlebot 訪問。


六.2  上面寫的答案錯誤( ⊙ o ⊙ )啊!

1)一棵二叉搜索樹的中續遍歷結果是從小到大排序好的,算法時間複雜度O(n),空間複雜度O(1)

2)可以先對二叉搜索樹進行中序遍歷,然後將遍歷結果存放到一個數組中,然後判斷這個數組是否是從小到大排好序,而且無重複元素的。時間複雜度O(n),空間複雜度O(n).

參見








1、

1)

  1. mody@mac:~$ w  
  2.   
  3. 18:36  up  6:42, 6 users, load averages: 1.60 1.74 1.68  
  4.   
  5. USER     TTY      FROM   LOGIN@  IDLE WHAT  
  6.   
  7. mody     console  -                11:55    6:41 -  
  8.   
  9. mody     s000     -                11:55       - -bash  
  10.   
  11. mody     s001     -                12:01    6:35 /usr/bin/python /usr/local/bin/ipython  
  12.   
  13. mody     s002     -                15:31      52 -bash  
  14.   
  15. mody     s003     -                18:33       2 -bash  
  16.   
  17. mody     s004     -                18:36       - w  -h  
mody@mac:~$ w

18:36  up  6:42, 6 users, load averages: 1.60 1.74 1.68

USER     TTY      FROM   LOGIN@  IDLE WHAT

mody     console  -                11:55    6:41 -

mody     s000     -                11:55       - -bash

mody     s001     -                12:01    6:35 /usr/bin/python /usr/local/bin/ipython

mody     s002     -                15:31      52 -bash

mody     s003     -                18:33       2 -bash

mody     s004     -                18:36       - w  -h

mody@mac:~$ man w

W(1)                      BSD General Commands Manual                     W(1)

NAME

     w -- display who is logged in and what they are doing


SYNOPSIS

     w [-hin] [user...]


DESCRIPTION

     The w utility prints a summary of the current activity on the system, including what each user is doing.  The first line displays the current time of day, how long the system has been running, the number of users logged into the system, and the load averages. The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes.

     The fields output are the user's login name, the name of the terminal the user is on, the host from which the user is logged in, the time the user logged on, the time since the user last typed anything, and the name and arguments of the current process.

     The options are as follows:

     -h      Suppress the heading.   忽略第一行信息

     -i      Output is sorted by idle time.


2)

  1. mody@mac:~$ uptime  
  2.   
  3. 19:08  up  7:14, 6 users, load averages: 1.42 1.23 1.24  
  4.   
  5. mody@mac:~$ man uptime  
mody@mac:~$ uptime

19:08  up  7:14, 6 users, load averages: 1.42 1.23 1.24

mody@mac:~$ man uptime

UPTIME(1)                 BSD General Commands Manual                UPTIME(1)


NAME

     uptime -- show how long system has been running


3)

  1. michael@ubuntu:~$ top  
  2. top - 05:11:28 up 17 min,  2 users,  load average: 0.05, 0.25, 0.34  
  3. Tasks: 178 total,   1 running, 177 sleeping,   0 stopped,   0 zombie  
  4. Cpu(s):  3.0%us,  0.3%sy,  0.0%ni, 90.7%id,  5.6%wa,  0.3%hi,  0.0%si,  0.0%s  
  5. Mem:   1345964k total,   891400k used,   454564k free,    38652k buffers  
  6. Swap:  1340408k total,        0k used,  1340408k free,   562812k cached  
  7.   
  8.   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
  9.  6207 root      20   0  242m  19m 7616 S  3.0  1.5   0:04.49 Xorg              
  10.  6624 michael   20   0  208m  14m  10m S  1.3  1.1   0:02.33 gnome-terminal    
  11.  6045 root      20   0 98.6m 4548 3644 S  0.7  0.3   0:02.85 vmtoolsd          
  12.  6865 michael   20   0 19224 1456 1060 R  0.7  0.1   0:00.09 top               
  13.  6462 michael   20   0  302m  10m 7548 S  0.3  0.8   0:00.32 gnome-settings-   
  14.  6478 michael   20   0  260m  24m  18m S  0.3  1.9   0:05.97 vmtoolsd          
  15.     1 root      20   0 23692 1944 1272 S  0.0  0.1   0:01.86 init              
  16.     2 root      20   0     0    0    0 S  0.0  0.0   0:00.01 kthreadd          
  17.     3 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0       
  18.     4 root      20   0     0    0    0 S  0.0  0.0   0:00.08 ksoftirqd/0       
  19.     5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0        
  20.     6 root      20   0     0    0    0 S  0.0  0.0   0:00.13 events/0          
  21.     7 root      20   0     0    0    0 S  0.0  0.0   0:00.00 cpuset            
  22.     8 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper    
michael@ubuntu:~$ top
top - 05:11:28 up 17 min,  2 users,  load average: 0.05, 0.25, 0.34
Tasks: 178 total,   1 running, 177 sleeping,   0 stopped,   0 zombie
Cpu(s):  3.0%us,  0.3%sy,  0.0%ni, 90.7%id,  5.6%wa,  0.3%hi,  0.0%si,  0.0%s
Mem:   1345964k total,   891400k used,   454564k free,    38652k buffers
Swap:  1340408k total,        0k used,  1340408k free,   562812k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND         
 6207 root      20   0  242m  19m 7616 S  3.0  1.5   0:04.49 Xorg            
 6624 michael   20   0  208m  14m  10m S  1.3  1.1   0:02.33 gnome-terminal  
 6045 root      20   0 98.6m 4548 3644 S  0.7  0.3   0:02.85 vmtoolsd        
 6865 michael   20   0 19224 1456 1060 R  0.7  0.1   0:00.09 top             
 6462 michael   20   0  302m  10m 7548 S  0.3  0.8   0:00.32 gnome-settings- 
 6478 michael   20   0  260m  24m  18m S  0.3  1.9   0:05.97 vmtoolsd        
    1 root      20   0 23692 1944 1272 S  0.0  0.1   0:01.86 init            
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.01 kthreadd        
    3 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0     
    4 root      20   0     0    0    0 S  0.0  0.0   0:00.08 ksoftirqd/0     
    5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0      
    6 root      20   0     0    0    0 S  0.0  0.0   0:00.13 events/0        
    7 root      20   0     0    0    0 S  0.0  0.0   0:00.00 cpuset          
    8 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper  

michael@ubuntu:~$ man top



NAME
       top - display Linux tasks

SYNOPSIS
       top -hv | -bcHisS -d delay -n iterations -p pid [, pid ...]

       The traditional switches '-' and whitespace are optional.

DESCRIPTION
       The  top program provides a dynamic real-time view of a running system.  It can display system summary information as well as a list of  tasks  currently  being  managed  by the Linux kernel.  The types of system summary information shown and the types, order  and  size  of  information  displayed  for tasks are all user configurable and that configuration can be made persistent across restarts.

4)

  1. michael@ubuntu:~$ ps  
  2.   PID TTY          TIME CMD  
  3.  6626 pts/0    00:00:00 bash  
  4.  6874 pts/0    00:00:00 ps  
  5. michael@ubuntu:~$ man ps  
michael@ubuntu:~$ ps
  PID TTY          TIME CMD
 6626 pts/0    00:00:00 bash
 6874 pts/0    00:00:00 ps
michael@ubuntu:~$ man ps
PS(1)                       Linux User's Manual                       PS(1)

NAME
       ps - report a snapshot of the current processes.

SYNOPSIS
       ps [options]

DESCRIPTION
       ps displays information about a selection of the active processes.   If you want a repetitive update of the selection and the displayed  information, use top(1) instead.


2、B

3、BD

http://blog.csdn.net/yangcs2009/article/details/39639749

11、AD

$代表當前shell線程號,即PID;


?代表執行上一條命令返回值,0代表成功,非0代表錯誤代碼

$0就是該bash文件名
$?是上一指令的返回值
$*所有位置參數的內容:就是調用調用本bash shell的參數。
$@基本上與上面相同。
"$*"返回的是一個字符串,字符串中存在多處空格。
"$@"返回多個字符串。
$#返回所有位置參數的個數。

12、AC

>表示以覆蓋方式輸出,>>表示以追加方式輸出



13、A

變量賦值使用=,等號兩邊不能有空格;變量名只能是英文字母或數字,開頭不能是數字;可使用雙引號(可轉義)、單引號(不可轉義);


14、D

2.1 p命令
命令p用於顯示模式空間的內容。默認情況下,sed把輸入行打印在屏幕上,選項-n用於取消默認的打印操作。當選項-n和命令p同時出現時,sed可打印選定的內容。
 

sed'/my/p' datafile
#默認情況下,sed把所有輸入行都打印在標準輸出上。如果某行匹配模式my,p命令將把該行另外打印一遍。


sed -n '/my/p' datafile
#選項-n取消sed默認的打印,p命令把匹配模式my的行打印一遍。


15、CD

*     匹配前面的子表達式零次或多次。例如,zo*能匹配“z”以及“zoo”。*等價於{0,}。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章