# 群聯 板橋 05xx SSD 開發部門 ## 一面 ## A部份 ### 第一大題 : 五題 bitwise 的操作 寫出function 操作某個特定位置的bit , 給的條件有 clear ,set , inverse ### 第二大題 :給一個 struct 其中有Bit field 的題目 , 要算出 sizeof(struct) #### bit field :::info >C99 standard (§6.7.2.1) >A bit-field shall have a type that is a qualified or unqualified version >of _Bool, signed int, unsigned int, or some other implementation-defined >type. ::: ``` C struct field{ unsigned int a; unsigned int b; unsigned int c :7; unsigned char d:1; unsigned char e; } ``` 求出 sizeof(field) ### 第三大題 考 linked-list 的 binary search ### 第四大題 用 linked-list 實做 queue ## B部份 (硬體) ### 1.考ISR過程 ### 2.考 Harvard 架構 and Von-Neumann 架構的比較 ### 3. ALU CU Memory bus 在 電腦中的關係 ### 4. 舉例 Greedy algo , Brute-force algo , Heuristic algo > reference: https://www.cs.utexas.edu/~mitra/csFall2020/cs313/lectures/algo_classes.html :::info **Greedy** : Greedy Algorithms are simple, straightforward and short sighted. They are easy to implement and sometimes produce results that we can live with. In a greedy algorithm you are always looking for the immediate gain without considering the long term effect. Even though you get short term gains with a greedy algorithm, it does not always produce the optimal solution. Like a naive algorithm, a greedy algorithm is built on a simple principle: during an iteration, the algorithm always makes the “best choice” decision. It is necessary to have a locally optimal choice in the objective that this choice will lead to the optimal global solution. However, the algorithm gives no guarantee that the last solution is an optimal solution. Intuitively, we can say that to maximize the utility in the problem of the knapsack: just put the element with the greatest utility (with a size compatible with the remaining size in the bag) until there is no longer space in the bag. e.g. MST(Minimal Spanning Tree) , Making Change **Brute-force** : Unlike a naive algorithm, this method guarantees the overall optimum, but its execution time and memory consumption can quickly exceed the limits of a computer. The principle is simple, it is necessary to enumerate all the possible solutions of the problem and to choose the best solution. Another name for brute force is exhaustive search. In these algorithms you consider every possible solution in the solution domain to find the optimal solution. Depending on the type of problem that you are doing, if you have n items to consider you will be either doing n! searches (Permutations) or ${2^n}$ searches (Combinations). Brute force algorithms are simple to implement but computationally intensive to run. They are reasonable solutions when n is small but even for moderately large values of n the solutions become too intensive to produce results in a reasonable time frame. One advantage of the the brute force algorithms is that they give the optimal solution. **Traveling Salesman Problem**: A salesman has to visit n cities. Going from any one city to another has a certain cost - think cost of airline or railway ticket or gas cost. Map a route that has the least cost that the salesman can follow so that he visits each city exactly once and he returns to the city that he started from. If each city is connected to every other city directly there are n! routes to consider. **Knapsack Problem**: Given a set of items that each have a weight and value, the problem is to fill a knapsack that has a weight capacity with items of the most value. In the brute force algorithm you will consider 2n combinations. You get the set of combinations that do not exceed the capacity of the knapsack. The combination with the largest value in that set is the optimal solution. **Dynamic Programming** : Divide and conquer is a top down approach to solve a problem. We start with the largest instance of the problem that we continually decrease in size until we reach the base case. In dynamic programming we start with the simplest case and work systematically to the values we need. e.g. Floyd-Warshall ::: ### 5. PMU , ALU, CU , Control Bus PMU(performance Management unit) ### 6. ISR 與 function call 的比較 OS 管理所有 Process 的方法,就是對每一個 Process 建立一個表格,稱為 PCB (Process Control Block),紀錄該 Process 相關狀態和資訊。 OS 在切換不同 Process 時,會先保存原本 Process 當下執行狀態,再切換到下一個 Process ,並恢復此 Process 最後停留的狀態,繼續執行。OS 就是透過 PCB 掌控 Process 的運行 #### 待補 ## 面試結果 感謝信 檢討 : 沒準備 ppt , 群聯官網履歷沒寫.... # 群聯 板橋 05XX UFS 部門 ![image](https://hackmd.io/_uploads/rJoVEUu1R.png) ![image](https://hackmd.io/_uploads/ryWvNIuk0.png) ## A部份程式 1. 考 bit mask ```clike= # define a 0x12345678 # define b 0x32547698 int main() { unsigned int mask = 0x00001101 unsigned int val = a & (~mask); unsigned int val1 = val & b ; printf("%u" , val1); return 0; } ``` 2. 考 union 中記憶體的配置() 題目概要: ```clike= union bigb{ unsigned long val ; struct Low{ char p1 ; char p2 ; char p3 ; char p4 ; }; }Bigb; int main() { Bigb.val = 0x12345678 ; Bigb.p1 = 0xAA; Bigb.p2 = 0xBB; Bigb.p3 &= 0xCC; Bigb.p4 &= 0xDD; printf("%ld",Bigb.val); } ``` 4. 考 function scope 的 array 題目概要: ```clike= #define SIZE (20) char * func() { char c[SIZE]; for(int i =0; i < SIZE; i++) { c[i] = 'A'; } return c; } int main() { char * c; c = func(); printf("%s\n",c); } ``` ans: return local variable , so no output. 5. 考 define的用法 ```clike= #include <stdio.h> # define SIZE (20) # define VAL_MIN_MASK(v1,v2,mask) (v1 & mask) > (v2 & mask) ? (v2 & mask) : (v1 & mask) # define VAL_MAX_MASK(v1,v2,mask) (v2 & mask) > (v1 & mask) ? (v2 & mask) : (v1 & mask) int main() { char *c ; // c = func(); int a = 7 , b = 9; int val1 = VAL_MAX_MASK( ++a , ++b ,0x7); printf("%d %d %d\n" , a , b, val1); return 0; } ``` ## B 部份 ## 主管面試 主要提問履歷的經驗跟B大題題目東西 # Sunbird 面試 ## 一面 英文選擇題 + 英文自我介紹 + 邏輯測驗 ### 英文選擇 25題 , 大多都是學測以上接近指考(分科)水準的題目, 文法介係詞的題目頗多, 還有閱讀填空. ### 邏輯測驗 類似離散數學的題目, 總共 10題 , 高中水準就可以作答正確 ### 結果 : 一週後通知二面 ## 二面 一個禮拜後寄來二面邀請 # 美超微 ### part 1 1. C 30 題選擇題 ( 簡單的 loop ,typecast 等) 2. C++ 15 題選擇題 ( class 宣告 , public, private, protected , default constructer , default destructer 等 ) 3. 一些 linux 指令 (apt , lsmod , grep , ...) ### part 2 主管面談 ### part 3 英文文章閱讀 + 口頭詢問問題 ## 二面 HR 面試 要告知第幾梯次 有可能去美國(一次去三個月) 6.2k 保障月份 14 個月 月薪 看績效 + RSU限制性股票(兩年到三年才有) 一堆補助 英文 健身 等等...(新鮮人最高3000) 10天特休