For Automotive team:
Telephone:
Form a function to find max/min of 2 integers without using comparison operator.
What is a static function in C?
What is the significance of volatile keyword in C?
What are the different types of scheduling? What type is used by a linux OS.
What are the different stages of a process? How a scheduler is linked to these stages?
What is priority inversion?
Explain JPEG format?
Let’s say there is a system with only 1 timer. And you want to write a multi-threaded program. Each thread wants to use a function called “sleep(input)“ to sleep for the given input time. Now every thread may call this function. How do you make sure that every thread sleeps the same amount of time it is intended to with a single available timer in the system. [Hint: can you imagine a data structure and logic to hold this requirement.]
Round 2:
Let’s say I give you any number of queues. Also I give you two functions enqueue and dequeue to do the respective task of enqueuing and dequeuing. Can you design a stack with queues. Come up with 2 designs. Make push operation costly in one design and pop operation costly in another design.
Can you define the node structure of a singly linked list?
Can you make the node a heterogenous one, i.e. the data in the node can be of any type char, int, float, double, structure, structure of structures etc.,?
What is a semaphore, binary semaphore?
What is a mutex? Difference between mutex and binary semaphore?
Let’s say I have a linked list. There is one writer who can delete any node in the list. And there are n readers who read the content from the list. How do you design a synchronization scheme to achieve this?
Can you describe round robin (RR) scheduling in detail. Let’s say a process P1 is in the ready queue at time t=0ms. There is another process P2 which enters the ready queue at time t=2ms. Let’s say process P1 takes 2ms to complete. Explain the scenarios when the time slice is 1ms, 2ms, 3ms for the RR scheduler.
What are the different segments of memory in the controller?
Where is dynamic memory allocated? If I am interested to allocate a 32KB of memory dynamically, is it continuous in memory? If yes, why? If no, why?
What is virtual memory? Explain with a detailed diagram.