聯發科 C語言測試題目

Jaime Lin
4 min readMar 20, 2021

MediaTek Interview Questions

Okay 上一篇才剛發沒有多久, 趁著還稍微記得題目內容來記錄一下, 希望可以幫到迷途的孩子們

C語言測試

筆試14題(C/C++), 包含填充題跟選擇與填充題 & 兩題上機考, 共50分鐘

螢幕會提示時間, 並建議分配26分鐘在選擇與填充題, 24分鐘在上機考

由於時間緊迫, 非常難以記住全部14題, 此部分僅回憶出題目想考的概念, 實際數字並不相同, 請同學們當成練習題即可

選擇與填充題

  • Question 1

keyword: (1) global variable (2) pointers as function arguments

  • Question 2

keyword: (1) global variable

  • Question 3

keyword: (1) Macro

  • Question 4

此題為選擇題, 題目會列出4個選項, 問實例出的func會是什麼內容

Ans: A function takes double and integer argument and return double.

keyword: (1) C++ template

  • Question 5

實際題目比我列出來的還要繁瑣一點, 但概念上是相同的

keyword: (1) Char array and index

  • Question 6

題目Explanation of the following code, 為四選一選擇題, 實際題目還要複雜一些, 建議清楚弄懂function pointer的英文解釋

keyword: (1) function pointer and array

補充: 這邊有份網路上常見之pointer explanation, 不懂的同學可從此下手

  • Question 7

此題為四選一選擇題, 求執行結果

Ans: compiler error

keyword: (1) Macro

  • Question 8

這題是四選一選擇題, 但其實我不太明白想考什麼…

我的想法是 a 肯定跟 b c 不一樣, b 也跟 c不一樣, 我就直接挑了三者皆不同之答案, 有其他想法的網友們歡迎分享答案

上機考

  1. An integer array is given. The system gives you a series of integers, and please find it as a correct position in the sequence then print the corresponding value.
For example:
arr = [5, 8, 4, 9, 1] is given
Please find the position 2 , 1, 3 , 4, 0in this array
Print: 5, 4, 8 , 9 , 1

簡單來說就是sort之後query 就ok了

後記

由螢幕上可看出考題應該是從莫約100題中挑出14題, 如果運氣不錯搞不好看完這一篇會如有神助呢! 後面順便整理列出我有讀過的題目錦集, 如此一來這篇文就能成為一個大補帖啦!

Reference

打完這一大篇加修飾也是好累der, 如果有幫助到您請不要吝嗇您的讚 :)

If you like this post, you can buy me a coffee! :)

--

--

Jaime Lin

From Taiwan, a beautiful island. Learning English and sharing code experience.