MediaTek India Technology
Sri Srinivasa Multispeciality Hospital Interview Questions and Answers
Q1. Write code to insert a node to the middle of linked list
Insert a node to the middle of a linked list
Find the middle node using slow and fast pointers
Create a new node with the data to be inserted
Adjust the pointers to insert the new node in the middle
Q2. What is volatile and extern keywords in C ? What are local and external linkages ? What are SW and HW interrupts ? What are the different scheduling algorithms ?
Volatile and extern are keywords in C for memory management. Local and external linkages determine scope. SW and HW interrupts handle events. Different scheduling algorithms manage task priorities.
Volatile keyword is used to indicate that a variable may be changed unexpectedly, typically by hardware. Example: volatile int x;
Extern keyword is used to declare a variable that is defined in another file. Example: extern int y;
Local linkage restricts the scope of a variable to the...read more
Q3. C Coding Question addition deletion of link list
Addition and deletion operations in a linked list using C coding
Use a struct to define the linked list node
For addition, allocate memory for new node, update pointers accordingly
For deletion, update pointers to skip the node to be deleted
Q4. Delete duplicate elements in a sorted singly linked list
Use two pointers to iterate through the list and remove duplicates by updating next pointers
Initialize two pointers, current and next, to iterate through the list
Compare current and next node values, if equal, update next pointer to skip duplicate node
Repeat until end of list is reached
Q5. Diff between malloc and calloc
malloc is used to allocate memory without initializing it, while calloc is used to allocate memory and initialize it to zero.
malloc allocates a block of memory of specified size, while calloc allocates a block of memory for an array of elements and initializes them to zero
malloc does not initialize the allocated memory, while calloc initializes the allocated memory to zero
malloc returns a pointer to the allocated memory block, while calloc returns a pointer to the allocated a...read more
Q6. Delete a node in a single linked list
To delete a node in a single linked list, update the previous node's next pointer to skip over the node to be deleted.
Traverse the linked list to find the node to be deleted
Update the previous node's next pointer to skip over the node to be deleted
Free the memory allocated to the node to be deleted
Top HR Questions asked in Sri Srinivasa Multispeciality Hospital
Interview Process at Sri Srinivasa Multispeciality Hospital
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month