Preguntas de entrevista de Ingeniero de linux


Preguntas de entrevista para Ingeniero De Linux compartidas por los candidatos

Principales preguntas de entrevista

Ordenar: Relevancia|Popular|Fecha
A un Linux Kernel Software Engineer le preguntaron...2 de junio de 2020

Print last n nodes of a linked list you only have pointer to Head

3 respuestas

I suggest to create additional pointer which is the tail. Set a gap of the n nodes between the head and tail, move both, and once the tail points to null it’s the end of the list. Then, move only the head and print the node until it reaches the tail Menos

Actually, that could work but it's too expensive. I suggest you to reverse the list which take O(n) time complexity afterward print first m element and reverse the list back which in total cost you O(n) time complexity and O(1) extra space Menos

Use a queue. Traverse the list and add each element to the queue. Always check if the size of the queue is n, if so then remove the first element before adding a new one. When you finish traversing the list your queue will have exactly the last n elements of the list, just print them in order. Menos

Intel Corporation

Write a code which gets an array of size N with Natural numbers in it. The code needs to give every time a differet permutation of itself.

2 respuestas

I used a rand() twice to get 2 indexes randomly every time, and put modulo (%N) on the value to be in the range of the indexes. Menos

What mean every time a differet permutation? As I know set of permutations is finite. Menos


how do you find out the memory on X amount of Linux systems.

1 respuestas

computer suddenly powers off what do you do.


The questions were about data structures,threads,networking, algorithms.If you're well prepared I think it won't be a problem to pass.

1 respuestas

I think the hardest part for me was on the algorithmic ones.


Explain what happens when an interrupt occurs.

1 respuestas

- The current contents of registers are placed on the stack. - The current program address is placed on the stack. - The Interrupt Vector Table is checked to determine the source of the interrupt, and which Interrupt Service Routine it should go to. - At the end of the ISR, the interrupt flag must be cleared for normal operation to continue. Menos


Compare and contrast an array and a linked list. Which operates faster in a loop? Why?

1 respuestas

I talked about random access property of array vs sequential for SLL. Also talked about how SLL is better for dynamic data as a dynamic array requires resize/copying. Lastly, I said an array is better in loops because the dereferencing of an SLL would have more overhead. He also wanted me to say something about an array being contiguous in memory, but I didn't get that... Menos


How do you check if 2 buffers overlap?

1 respuestas

if(a + sizeof(a)) > B) && ((B+sizeof(B)) > A)

Cirrus Logic

Only one developer asked coding question related to strings, to detect palindrome. Test lead asked questions on syntax, semantics of C-code, git-squash, static code analysis and run-time analysis.

1 respuestas

coding question was easy with 45 mins to spare, could take care of all debug aspects. Theory questions were all easy as well, except code analysis. Menos


difference among Sequences container: vector, deque, list difference among associate container: set, map, hash difference among smart pointer: std::unique_ptr, std::shared_ptr, std::weak_ptr difference between struct and class read C++ code and give result: related to virtual function and template Shell and Python questions: awk print column, Python dictionary Use C++ to realize a class: understand map, pair, struct, operator overload, class

1 respuestas

Another C++ question is about template metaprogramming.


CONTINUED HERE AS 5000 CHARACTERS LIMIT SIZE IN THE ABOVE COLUMN -------------------------TECHNICAL ROUND I -------------------------- (2 hours 45 min -very lengthy round i have ever had) Q1) Introduce yourself technically. Q2) Asked about my projects. Q3) Asked about my educational background. Q4) How will you proceed if the kernel source code that you downloaded does not support your board? What are the steps you will take? Q5) Write all the directories in linux that will be visible to you on your system and the directories of your kernel source code that you have downloaded. Differentiate between both. (Here he asked me whether I am sure of my answers that I wrote wherein I was too confused ) Q6) What is procfs ? What is the importance of procfs? Why it has got that name? Q7) What is sysfs ? Q8) What does /dev contain? Q9) How do you create node for a block device? Q10)How do you automatically get major number without using udev ? (He asked bcoz I answered udev will automatically update. He wants me to answer by not using udev functions) Q11)Can the same number be used for creating nodes for both char and block devices? Q12)Draw the block diagram for a char device driver implementation? (I explained about char device driver by writing all steps. He then asked me further questions ) Q13)Where file_operations have been used in registration? ( I answered cdev_init(my_cdev,&my_fops) and wrote all steps) Q14)What happens if you pass major number as 0 in register_chrdev_region()? Q15)Can you make your low-level driver directly interact with application without using core layer ? Is core layer mandatory? ( He asked me this question because I drew the block diagram for keyboard low-level driver with core layer and HLD) Q16)You have registered your file_operations with VFS layer. What about ISR routine and how will you register ? Q17)How your driver initialization will take place? What is the entry point for a driver? (I answered abt init and exit routines and drivers, modules and kernel service routines do not have pids. So they are invoked in process contexts. He then asked again questions) Q18)What is a PCB? Q19)What is a Stack section? Q20)How will be variables allocated in memory? How will you access heap? Q21)How many types of interrupts are there? (I answered software and hardware. I also said abt Bottom halves) Q22)What is the difference betw. various BHs and where do you apply? Q23)Is there any precaution for softirqs running simultaneously? Why and how do you solve? (I answered: applying synchronization techniques for shared access) Q24)Difference betw. various synchronization techinques and when do you need? Q25)Why semaphores are not used for ISRs? Q26)How do you implement threads? Q27)What is the basic difference betw. multiple processes and multiple child processes? Q28)Did you write any applications? ( I said no.) Q29)Write a small application to read 4 bytes and write 4 bytes for my device /dev/ttyS0. (As it was very simple. I wrote it and he then stopped as if he were satisied by my answers. A Very long interview!) -------------------------TECHNICAL ROUND II -------------------------- (30 min) Q1) Introduce about yourself and about your work so far. Q2) Questions on all my projects. Q3) Few questions about my background. Q4) How would you allocate memory in kernel? Q5) Write a data structure with integer and character as its elements. Q6) What is the size of this data structure? (I answered about structure padding as he was expecting the same answer from me) Q7) Allocate memory in heap by using the above data structure. How will you allocate then in stack? Q8) Initialize the above data structure. Implement a function by using which print the values of the data structure elements. Q9) Asked me to correct some logic about deleting a given node in linked list. Q10)Asked some personal questions and some discussion went on package ****** END OF INTERVIEW AT 4.24PM****** MOST DIFFICULT QUESTION: Comparison of the source code with the current kernel running on my system

1 respuestas

Develop knowledge on every directory of Source code as well as on running kernel on your system Menos

Viendo 1-10 de 113 preguntas de entrevista