Summary of Embedded Engineer Interview Questions (fresh graduate, change career)

Summary of interview questions

1. C foundation

  1. What are the functions of the complete compilation process of the gcc compiler?

    Answer: preprocessing, compilation, assembly, linking. Preprocessing: expansion of header files/replacement of macros/removal of comments/conditional compilation. Compile: Check grammar and generate assembly. Assembly: Assembly code is converted into machine code. Link: Link together to generate an executable file.

  2. What is a callback function?

    Answer: A callback function is an executable code segment, which is passed to other codes as a parameter, and its function is to conveniently call this (callback function) code when needed.

  3. Can the address be printed using %u in the printf function?

    Answer: No.

    Whether it is unsigned or not, the value of the char type stored in the memory is the same, which is 0xFF.

    When printf("%u") outputs, the char type variable will be promoted to int type.

    Because char is a signed number type, it will be expanded by symbols. a Expand from 0xFF to 0xFFFFFFFF (4294967295).
    Unsigned char will be expanded by zero, and b will be expanded from 0xFF to 0x000000FF (255).

  4. The difference between structure and union

    Answer: Structure union, also known as union. It is a type derived from the need to store several different types of variables in the same memory unit during programming. That is to say, only one of the variables can be stored in the union at a time, and this variable will become invalid when a new member is stored in the union variable! ! ! The usage is the same as the structure, but it is mostly used inside the structure.

    note:

    (1) In the struct, each member occupies its own memory space, and they exist at the same time. The total length of a struct variable is equal to the sum of the lengths of all members. In Union, all members cannot occupy its memory space at the same time, and they cannot exist at the same time. The length of the Union variable is equal to the length of the longest member.

    (2) Assigning values ​​to different members of the union will overwrite other members, the original member value does not exist, and the assignment of different members of the struct does not affect each other

  5. What are the functions of static, const, and volatile keywords?

    Answer: static: limit the role, extend the life cycle. const: Prevent variables from being modified. Volatile: To prevent the compiler from over-optimizing, tell the compiler to fetch the value from memory every time. Volatile is mainly used for non-automatic variables accessed by interrupt function subroutines, global variables shared by multiple threads, and registers of parallel devices.

  6. The difference between declaring variables and defining variables

    answer:

  7. What is the difference between assignment and initial value assignment?

  8. Can local variables and global variables be renamed

  9. How to reference an external variable that has been defined

  10. What is the difference between the storage of global variables and local variables?

  11. What are the advantages of const compared to #define?

  12. What is the difference between array and pointer?

  13. Why are arrays and pointers used as function parameters interchangeable?

  14. What is the difference between formal parameters and actual parameters?

  15. What is the relationship between pointers, arrays and addresses?

  16. Is a void pointer a null pointer? What is his role?

  17. What are the important concepts closely related to memory? (Wild pointer, stack (stack), heap (heap), static area)

  18. What is the difference between #include<> and #include””?

  19. x=x+1, x+=1, x++ Which is more efficient?

  20. When assigning a value to an unsigned variable, how should the data type be converted?

  21. How does the cpu execute the program?

    Answer: Open up a 0-4g memory space, open up a process, and load the code into the register...

2. Linux basics

  1. What are the collective names of character devices, block devices, pipes, etc. under Linux?

    Answer: A device in the system that can access fixed-size data slices randomly (not in sequence) is called a block device.

    The main difference between a character device and a block device is: when a read/write request is issued to a character device, the actual hardware I/O generally occurs immediately, while the block device does not. It uses a block of system memory as a buffer. When the process requests the device to meet the user's requirements, it will return the requested data. If it cannot, call the request function to perform the actual I/O operation. Therefore, the block device is mainly designed for slow devices such as disks to avoid excessive consumption. More CPU time to wait

  2. There are several ways to view the type of a file

    : : Ls-l 、 ls-ld 、 file 、 stat

  3. What are the commonly used installation tools under Linux?

    答:apt-get install

  4. Interpret shell commands, shells, and shell scripts separately

  5. Whether printf and scanf operate on the same file

  6. What file system types are commonly used in Linux? How to check the file system type?

  7. Is there a file system under windows? What does the file system do?

  8. In which path are the header files and library files generally located?

  9. How does the system distinguish files with the same name

  10. How does the system distinguish between different processes.

  11. See what commands are in the file

    Answer: find, ls

  12. Such as the permission to modify the file

    Answer: chmod 777 xxx

  13. What is a symbolic link?

3. Data structure

  1. What is the main research of data structure?

    Answer: The data structure is the way a computer stores and organizes data. Data structure refers to a collection of data elements that have one or more specific relationships with each other. Under normal circumstances, a carefully selected data structure can bring higher operational or storage efficiency. Data structure is often related to efficient retrieval algorithms and indexing techniques.

  2. The difference between an array and a linked list (analysis of three aspects: logical structure, memory storage, and access mode)

  3. Quick sort algorithm

  4. Algorithm for hash lookup

  5. Determine whether the singly linked list has a ring

  6. Judge whether a bracket string matches correctly. If there are multiple brackets, what should I do? If (([])) is correct, [[(() is wrong

Four. IO process

  1. What is the difference between standard IO and file IO?
  2. Briefly describe stream pointers?
  3. Briefly describe system calls?
  4. Briefly describe the difference between a static library and a dynamic library?
  5. How to execute the program directly and in the background?
  6. Process status
  7. What is a zombie process?
  8. Briefly describe the copy-on-write technology in creating a child process?
  9. Advantages of multithreading and more processes?
  10. The use of thread pool?
  11. The part of the thread pool?
  12. Synchronization and mutual exclusion mechanism of threads?
  13. Briefly describe the realization principle of mutex lock?
  14. Briefly describe the deadlock scenario?
  15. Briefly describe the principle of semaphore?
  16. Briefly describe the communication mechanism of the process?
  17. The communication principle of the pipeline?
  18. How does the user process respond to the signal?
  19. The principle of shared memory communication?

V. Network Programming

  1. ISO seven-layer network communication structure and TCP/IP four-layer network communication structure
  2. Advantages and disadvantages of tcp communication
  3. Advantages and disadvantages of udp communication
  4. The difference between pool and select
  5. What are the io models
  6. How to implement tcp concurrent server
  7. The nature and implementation of network timeout detection
  8. tcp network programming process
  9. udp network programming process
  10. What aspects should be paid attention to in udp local communication
  11. How to modify the flag bit of the file descriptor
  12. Basic use of sqlite database, including addition, deletion, modification
  13. How to realize mass data sending in udp-based chat rooms
  14. How to query words in online dictionaries
  15. The difference between TCP and UDP
  16. OSI seven-layer network mode, the main function of each layer, the main protocol
  17. OSI's four-layer and five-layer network model
  18. TCP’s three-way handshake and four-time wave of hands work separately
  19. How to implement concurrent servers, how concurrent servers are implemented and what are the similarities and differences

Six. C++

  1. new, delete, malloc, free relationship

  2. The difference between delete and delete []

  3. What are the properties of C++ (object-oriented characteristics)

  4. Should the destructor of the parent class be called when the subclass is destructed?

  5. Polymorphism, virtual function, pure virtual function

  6. Find the return value of the following function (Microsoft)

  7. What is "quotation"? What issues should be paid attention to when affirming and using "quotations"?

  8. What are the characteristics of using "reference" as a function parameter?

  9. When do I need to use "frequently quoted"?

  10. The format, benefits and rules of using "reference" as the return value type of a function?

  11. What is the difference between structure and union?

  12. Try to write the program results:

    int a=4;
    int &f(int x){ 
        a=a+x;
        return a;
    }
    
    int main(void)
    { 
        int t=5;
        cout<<f(t)<<endl; 
        a = 9f(t)=20; 
        a = 20cout<<f(t)<<endl; 
        t = 5,a = 20 a = 25t=f(t); 
        a = 30 t = 30cout<<f(t)<<endl; 
    }
    //t = 60
    
  13. What is the difference between overload and overried (some books are also called "cover")?

  14. In what kinds of situations can you only use the initialization list but not the assignment?

  15. Is C++ type safe?

  16. What code will be executed before the main function is executed?

  17. Describe memory allocation methods and their differences?

  18. Write out the comparison statement of BOOL, int, float, pointer type variable a and "zero" respectively.

  19. Please tell me what are the advantages of const compared to #define?

  20. Briefly describe the difference between arrays and pointers?

  21. What does int (*s[10])(int) mean?

  22. Stack memory and literal constant area

  23. Jump the program to the specified memory address

  24. int id[sizeof(unsigned long)]; Is this correct? why?

  25. What is the difference between references and pointers?

  26. Compared with #define, what are the advantages of const?

  27. How many memory allocation methods are there?

  28. The destructor of the base class is not a virtual function, what problems will it bring?

  29. What is the difference between global variables and local variables? How is it achieved? How do the operating system and compiler know?

7. ARM Architecture Programming

  1. Briefly describe the characteristics of the ARM processor, at least say more than 5 characteristics.
  2. How many working modes does the ARM core have? Please write down the English abbreviations of these working modes. There are several abnormal modes and several privileged modes. The cortex_a series has several privileged modes and several working modes.
  3. How many registers does the ARM core have, briefly describe
  4. Among ARM general registers, there are 3 registers with special functions and functions. Please write their names and functions.
  5. Please describe the situation and function of the relevant Bit in the CPSR register.
  6. What is immediate data? What is the nature of immediate data
  7. What content is saved in the LR register when the BL instruction jumps? And please briefly describe the reason
  8. Please describe what is the processor site and how to save the site?
  9. What stack does ATPCS use by default?
  10. What is a full stack and an empty stack, and what is an increase or decrease?
  11. Please write a complete ARM software interrupt instruction and briefly describe its function.
  12. Please describe the concept of the exception vector table in the ARM system.
  13. Please write down what is included in the bin file image generated by an ARM program?
  14. Please give an example to illustrate the difference between an interrupt handling and an interrupt exception handling on an ARM processor.
  15. Please briefly describe how the initialization steps are completed when abnormal interrupt processing occurs, and what are the specific initialization steps?
  16. The main function of uboot
  17. How does uboot boot the kernel?
  18. What is the importance of the boot process of uboot
  19. The role of bootcmd and bootargs two uboot environment variables
  20. The boot process of the linux kernel
  21. The difference between uImage, zImage, vmlinux
  22. The relationship between Kconfig, .config and Makefile

8. System migration

  1. Linux kernel startup process
  2. What is a bootloader? What is the role of bootloader in embedded system?
  3. Why is assembly language dependent on the hardware platform while C language can be independent of the hardware platform?
  4. What is cross-compilation?
  5. What is the format of the executable file under the Linux platform?
  6. What is disassembly?
  7. Briefly describe the concept and function of nfs service?
  8. Briefly describe the startup process of a development board with linux kernel?
  9. What are the main functions of uboot?
  10. How does uboot set environment variables?
  11. Briefly describe the role of bootcmd environment variables in uboot?
  12. Briefly describe the role of bootargs environment variable in uboot?
  13. Briefly describe what is platform-related code and what is platform-independent code?
  14. How to understand that linux/uboot supports various hardware platforms?
  15. How to configure uboot to suit a specific development board platform?
  16. How to compile uboot to generate binary files?
  17. Briefly describe the boot process of uboot?
  18. What are the functions of the operating system?
  19. How to configure the linux source code to suit a specific processor?
  20. In the make menuconfig interface, some drivers can be selected into three states, namely "Y", "N", and "M". What do these three states mean?
  21. How to compile the driver module selected as the "M" option?
  22. Briefly describe the role of the device tree?
  23. What is the main basis for writing a device tree file?
  24. Briefly describe how to compile an existing driver in the kernel source code into the kernel?
  25. Briefly describe how to compile a driver written by yourself into the kernel?
  26. In the process of kernel startup, if the console has been initialized, what method do we generally use to debug the kernel?
  27. What happens when the Linux kernel encounters a system crash report Oops during startup?
  28. When the linux kernel encounters certain problems during startup, it will print the system crash report Oops. What are the main contents printed in the report?
  29. Briefly describe what is a file system? What is the root file system?
  30. Why is there no need to install static libraries in development boards?

9. Drive development

  1. What is a module?

  2. There are several drive types

  3. Character device driver framework programming process?

  4. What is concurrency and what are the reasons for race conditions in the driver?

  5. What are the ways to resolve race conditions? What are the characteristics of each?

  6. How many IO models are in the driver?

  7. The main function of designing linux device model?

  8. Does the character device driver framework contradict the Linux device model?

  9. What are the parts of the platform architecture? What do they match

  10. Is there a contradiction between the device tree and the platform architecture?

  11. Why is the interrupt divided into upper and lower halves? What are the mechanisms of the upper and lower halves?

  12. The difference between work queue and tasklet?

  13. What are the memory allocation functions in the kernel? What are the characteristics of each?

  14. Kernel debugging

  15. Character device driver framework

  16. The difference between character devices and block devices and network devices

  17. The concepts of concurrency and race conditions, those situations where race conditions will occur, the methods to solve them, and the differences and usage scenarios.

    Answer: Concurrency:

  18. The difference between spin lock and semaphore

    Answer: When a process acquires a spin lock while accessing a resource, another process also wants to access the resource, and it will constantly spin to ask whether it can access the resource and continuously consume cpu resources. When a process acquires a semaphore when accessing a resource, another process also wants to access the resource. At this time, it will be waiting. After the first process has finished accessing, it will notify the second process to let it proceed. access.

  19. Talk about your understanding of interrupt context and process context

  20. What is the main interruption of the lower half

  21. Platfprm platform bus driver model

  22. IIC subsystem driver framework

  23. Input subsystem driver framework

  24. For example: If the master does not know the 7-bit address of the slave, how can you find the slave?

    Answer: When the master does not know the address of the slave, the master will traverse all the slave addresses. When a slave responds, this slave is the slave we are looking for.

10. IOT warehousing

  1. What are you responsible for in the project?
  2. What difficulties did your team encounter during the project, how did you solve it, and how did you solve the most difficult problem you encountered?
  3. What do you think can be optimized for this project
  4. A53 main program development process
  5. How the client and server communicate
  6. How to set self-starting parameters when porting uboot
  7. How is the environmental information displayed on the client in real time in the project
  8. How to achieve synchronization and mutual exclusion between threads in the project?
  9. How the server communicates with M0
  10. What is the form of the data sent on M0?
  11. How the data receiving thread reads data
  12. Briefly describe the working principle of video streaming server
  13. Why can the client access the data on the server
  14. What steps need to be performed to build an embedded development environment
  15. What should I do if I encounter a segfault in the project?
  16. Why use threads? What are the advantages compared to the process?
  17. How to make the system start running automatically after power on?
  18. What is the difference between zImage and uImage when compiling the kernel?
  19. What is the role of message queue in the system?
  20. Where does the message queue and shared memory open up space?
  21. If the speed of server-side data analysis cannot keep up with the speed of data reception, what problems will occur, and what should be done?
  22. When calling sqlite_get_table() to query data, what is the result returned in result?
  23. Please briefly describe the networking principle of ZigBee
  24. Talk about your knowledge of the zstack protocol stack
  25. What needs to be done to realize data transparent transmission of two zigbee modules?
  26. The role of Boa server
  27. What is the default port number used by Boa server? What are the important configurations described in the boa.conf file

11. Baidu speech recognition

  1. If I have a development board that has been a good Linux system, what should I do to realize the interface of calling Baidu AI speech recognition (the role of libcurl, openssl, alsa and the porting method)

  2. How to realize that the development board can ping the external network and Baidu

  3. What problems did you encounter in the implementation process? How did it happen? How to solve it?

  4. How to check your current system version

Not very comprehensive, please forgive me...

Guess you like

Origin blog.csdn.net/weixin_48430195/article/details/108737916