英伟达嵌入式软件工程师笔试 9-26

《嵌入式软件开发笔试与面试手册》https://blog.nowcoder.net/zhuanlan/jvN8gj

《软件开发笔试汇总》https://blog.nowcoder.net/zhuanlan/0oDWVm

题型:全英文,选择题+编程题(核心代码模式)

1.Permutation Operations

Given a permutation P=[3,7,1,10,9.2,6,5,4,8],one permutation operation is defined as: for each index i (1 <= i <= 10), new_arr[i] = arr[P[i]] and then arr = new_arr.

For a sorted array of 10 distinct integers, how many times must this operation execute to reach the sorted array again?

Note: 1-based index is used.

Pick ONE option

15

30

70

10

2.Inversion Count - 2

Given an array A=[7,9,4,5,6,3,10,7,100]. Find the inversion count of the array. if(i<j).and(A[i] >A[j]), then pair(i ,j ) is called an inversion of an array A. How many inversions are in the array?

Pick ONE option

13

12

14

11

3.Linux Process Tree

The top and ps commands are used in Linux to observe the process information.What are the major points of difference between the two commands?

Pick ONE OR MORE options

The top command is dynamic while ps is static.

The top command is preferred in scripts as it gives a real-time view of the system.

The ps command shows only running processes while the top command shows both running and sleeping processes.

The top command is preferred when you want a repetitive update of the processes while ps is used when you need a snapshot of current processes.

4.Job Scheduling

ln a Linux environment, an adminstrator needs to the schedule a complex job that involves executing a series of commands every Sunday at 2:00 AM. The job has dependencies, requires elevated privileges for certain commands, and the output must be captured in a log file.

Which option is the most suitable approach?

Pick ONE option

1.Create a systemd timer unit.

2.Configure the timer unit to run every Sunday at 2:00 AM.

3. Write a custom script containing the necessary commands and dependencies.

4.Ensure the custom script has appropriate permissions.

5. Direct the output of the custom script to a designated log file.

1.Create a custom script that includes the required commands and their dependencies.

2.Set appropriate permission settings for the custom script.

3.Configure the script to redirect the output to a designated log file.

4.Utilize the at command to schedule the execution of the custom script.

5.Schedule the script to run every Sunday at 2:00 AM using the at command.

1.Create a custom script that includes the required commands and their dependencies.

2.Adjust the permissions within the custom script to ensure proper execution.

3.Set up a crontab entry for the root user.

4.Configure the crontab entry to run every Sunday at 2:00 AM.

5.Modify the custom script to redirect the output to a designated log file.

1.Create a custom systemd target unit.

2.Define the target unit to encompass the job's dependencies and commands.

3.Configure the target unit to trigger every Sunday at 2:00 AM.

4.Ensure appropriate permissions are set within the target unit.

5.lmplement log file handling within the target unit to capture the output.

5. Skip Lists

A skip list is a probabilistic data structure. It is used to stored a sorted list of elements in a linked list. It allows the elements to be processed efficiently. In one single step , it may skip several elements of the entire list, which is why it is known as a skip list.

The skip list is an extended version of the linked list. It allows the user to search, remove, and insert the element very quickly. It consists of a base list that includes a set of elements that maintains the link hierarchy of the subsequent elements.

What is the ratio of time complexity improvement of skip lists from linked lists in insertion and deletion?

Pick ONE option

O(n) to O(log n) where n is the number of elements

O(n) to O(1) where n is the number of elements

No Change

O(n) to O(n^2) where n is the number of elements

6.SQL Statements

Which of the following statement(s) are NOT correct:

Pick ONE OR MORE options

The PRIMARY KEY must be unique and not null for each table.

The DROP command is used to remove the table definition and its contents whereas the TRUNCATE command is used to delete all the rows from the table.

DELETE command is a DDL command whereas DROP is a DML command.

ACID properties in databases refer to Atomicity, Complexity, Isolation, and Duplicacy.

7.Advanced List Comprehensions

Consider the following two lists.

fruits = [ 'apple', 'orange', ' banana ' , 'grape', 'strawberry', 'blueberry' , 'mango']

prices = [1.25,0.75,0.50,2.00,3.50,4.00,1.75]

Use list comprehensions to perform these tasks:

 Create a new list called fruit_prices that contains tuples with the name of the fruit and its price.

 Filter the fruit_ prices list to include only fruits whose prices are between 1 and 3 dollars (inclusive).

 Sort the filtered list in descending order by price.

Which of the following code snippets achieves this?

Pick ONE OR MORE options

fruit_prices = [(fruit,price)for fruit,price in zip(fruits,prices)]

filtered_fruit_prices = [fp for fp in fruit_prices if 1 <= fp[1] <= 3]

sorted_fruit_prices = sorted(filtered_fruit_prices,key=lambda x: x[1], reverse=True)

filtered_fruit_prices =[(fruit, price) for fruit, price in zip(fruits,prices)if 1<= price<= 3]

fruit_prices = sorted(filtered_fruit_prices, key=lambda x: x[1],reverse=True)

fruit_prices = [(fruit, price) for fruit, price in zip(fruits,prices) if 1= price <= 3]

filtered_fruit_prices = sorted(fruit_prices, key=lambda x: x[1],reverse=True)

fruit_prices =[(fruit,price) for fruit,price in zip(fruits,prices)]

filtered_fruit_prices =[fp for fp in fruit_prices if 1 <= fp[1]<= 3]

sorted_fruit_prices = sorted(filtered_fruit_prices,key=lambda x: x[1],reverse=False)

8. The Huffman Decoder

Huffman codes compress text by assigning the characters that occur at the highest frequency the shortest possible codes. In this encoding scheme, no code can be a prefix of another. For example, if the code for a is O1, then the code for b cannot be 011.

Given an array of Huffman code mappings and a Huffman-encoded string, find the decoded string. Each mapping will be a string consisting of a tab-separated ('t') character and its encoded value: 'c encoded value' where the whitespace is a tab character. The newline character is represented as the character [newline] in the codes list, but should translate to \n when decoded.

For example, given codes =('a 100100', 'b 100101'; '[newline] 111111')and the string encoded =100100111111100101 we do the following.

Break encoded into its constituent encodings.

100100

111111

100101

Now map them to their characters and return the string: 'a\nb'. This will print as:

a

b

Note: While all code mappings in the example are 6 digits long, mappings can be different lengths.The algorithm creates the shortest length mapping for the most frequent character encode

剩余60%内容,订阅专栏后可继续查看/也可单篇购买

本专栏主要发布嵌入式软件开发相关岗位的笔试真题(嵌入式软件开发、通用软件开发、C/C++软件开发、算法工程师、数据开发、测试开发等)主要是算法编程题,其中一些岗位笔试含有对应的选择题、填空题、简单题。

全部评论

相关推荐

点赞 评论 收藏
转发
整个行业从业者资历呈现倒金字塔结构,30-40岁年龄段众多,应届生一个office&nbsp;2-3个,我知道的几家原厂都出现年龄断层,还是因为缺芯几年生意好,开始招应届生,可想而知,对新人并不友好,优质客户基本被“占坑”,拓新并没有那么容易,所以初期分配的客户资源基本盘很重要 #恩智浦#&nbsp;&nbsp;#华为海思工作体验#&nbsp;第二,IC销售一旦入行难以跨行,好奇心重,喜欢跳槽,追风口的人不适合,这行知名公司对销售技术知识要求高,产品线众多也有较高的学习成本,但这些在其他行业复用性几乎为,比如卖IT服务器的去卖云服务大模型,但从看到的大几百份履历来看,IC非常少人能跨出去,从业3年再跨基本不可能,除非向下兼容,可能存在从卖被动件传感器跳到主动件的小跨,从代理商跳到原厂的情况。更多的是换公司,但一直在服务特定行业的客户,推特定的产品,比如你在北京ADI卖医疗模拟IC比较多,继续跳去TI卖模拟。半导体即使在同一个行业,细分领域众多,隔行如隔山,社招跳槽的可选择性进一步收窄。知名公司销售稳定性好,基本不会有HC。不过凡事都有好坏,这行职业寿命长,越老越吃香,今年有家汽车做的好的原厂裁员先裁应届生资历浅的,和赚短平快钱的互联网逻辑不一样。社招也是5-10年经验起步。当你在这个行业人才pool以后,跳槽和你竞争的也是这个pool,其他难以跨行进来。一般销售市场占公司总人数5%左右,越知名的公司越不需要销售,比例越低。估算一下,TI,NXP,Infineon,ST,Renseas,Microchip,MPS,Marvell全国销售各小一百人,稍小众些的AMD,Intel&nbsp;FPGA品牌,做消费类或者客户集中的Broadcom,Qorvo,Skyworks,Macom,Sitime,Credo,Astera&nbsp;labs,Maxlinear,Cirrus&nbsp;logic,Wolfspeed,Allergo&nbsp;人更少&nbsp;#销售#&nbsp;&nbsp;#德州仪器#
投递ADI亚德诺等公司7个岗位 华为海思工作体验
点赞 评论 收藏
转发
2 20 评论
分享
牛客网
牛客企业服务