資訊科技產業專案設計 作業3
contributed by <魏昇芷 - tissue
>
What we need to see:
- Experience in relevant domain.
- Good English language skills to work effectively with global teams.
- Full experience at Linux, QNX or Android.
- Excellent C skills.
- Experience working on embedded systems and ARM processor specific.
問題一
下面的程式碼是在做 str 的初始化,請問可能有什麼潛在的問題?
取自 https://www.pttweb.cc/bbs/Tech_Job/M.1612848862.A.6D2
試答
C 語言中的 char
是一個 8 bit 的有號數,其範圍為 127 ~ -128,因此這個迴圈會成為無迴圈,因為其數值永遠不會超過 128。
問題二
如果硬體不支援乘法,那 x = y * 200 要怎麼改才能得到正確答案
取自 https://www.pttweb.cc/bbs/Tech_Job/M.1612848862.A.6D2
試答
首先先將 200 轉成 2 進位, = ,由 2 進位可知 200 = 128 + 64 + 8。 接著我們可以反覆 y + y = 2y, 2y + 2y = 4y …,過程中我們可以得到 8y、64y、128y,將這三個數字相加 8y + 64y + 128y 即可得到 200y。 也可以用 shift 的。
問題三
實作一個 function,參數是 32-bit integer,回傳共有幾個 bits 是 1
取自 https://www.pttweb.cc/bbs/Tech_Job/M.1612848862.A.6D2
試答
用一個 for loop 逐一走訪 32 個 bit,並計算有幾個 bit 是 1
問題四
承上題,有沒有什麼更快的做法
取自 https://www.pttweb.cc/bbs/Tech_Job/M.1612848862.A.6D2
試答
改成一次走訪 2 個 bit,並利用建表的方式快速得知該數字有幾個 bit 是 1
另外,也可以繼續延伸成 1 次走訪 4、8、16、32 個 bit,一次走訪的 bit 數量越多,要建的表就越大,花費的記憶體資源就越多,因此必須在效能與記憶體空間之間做取捨。
更佳解法
Minimum qualifications:
- Master's degree in Electrical Engineering, Computer Science, relevant technical field or equivalent practical experience.
- Experience coding in C or C++.
Preferred qualifications:
- Experience in ARM architecture and standard interfaces, bare-metal programming, bootloader, and firmware.
- Experience in Linux kernel, device drivers, and Android system programming.
- Experience in software/hardware integration.
- Experience in optimizing algorithms with OpenGL/OpenCL/NEON/LLVM on CPU/TPU/GPU/DSP.
- Verification experience using FPGAs and/or emulation platforms.
- Familiarity with computer architecture, compilers, machine learning, or image processing.
相關面試經驗