i
Tejas Networks
Filter interviews by
Tejas Networks interview questions for popular designations
Code for producer-consumer problem using mutex
Create a shared buffer between producer and consumer
Use mutex to lock the buffer while accessing it
Producer adds data to buffer and signals consumer
Consumer waits for signal and consumes data from buffer
Repeat until all data is produced and consumed
Mutex is used for mutual exclusion while Semaphore is used for signaling and synchronization.
Mutex is used to protect a shared resource from simultaneous access by multiple threads.
Semaphore is used to signal between threads or to limit the number of threads accessing a shared resource.
Mutex can only be locked and unlocked by the thread that locked it.
Semaphore can be signaled and waited on by different threads.
Mutex i...
Mutex and Semaphores serve different purposes in managing concurrent access to shared resources.
Mutex is used to provide exclusive access to a shared resource, while Semaphores can be used to control access to a shared resource by multiple threads.
Mutex is binary in nature, meaning it can only be in two states - locked or unlocked, while Semaphores can have multiple states.
Mutex is typically used for protecting critica...
Deadlock is a situation where two or more processes are unable to proceed because they are waiting for each other to release resources.
Occurs in multi-threaded or multi-process environments
Can lead to system freeze or crash
Prevention techniques include resource ordering and timeouts
Example: Process A holds resource X and waits for resource Y, while Process B holds resource Y and waits for resource X
Deadlock can be prevented by using techniques like resource allocation, avoidance, and detection.
Use a resource allocation algorithm to ensure resources are allocated in a safe manner.
Avoidance can be achieved by ensuring that resources are only requested when they are available.
Detection involves periodically checking for deadlock and taking action to resolve it if it is detected.
Implementing timeouts can also help pr...
Virtual addressing is a memory management technique that allows a program to use more memory than physically available.
Virtual addresses are mapped to physical addresses by the operating system.
Virtual addresses are allocated to a program during its execution.
Virtual addressing allows for efficient use of memory resources.
Virtual addressing enables the use of shared memory and memory protection.
Examples of virtual addr
Linker links object files and libraries to create an executable file. Loader loads the executable file into memory and executes it.
Linker resolves external references and generates an executable file
Loader loads the executable file into memory and performs relocation
Linker and loader are part of the toolchain used to build and run programs
Example: gcc uses linker and loader to compile and run C programs
Test_and_Set program is used to ensure mutual exclusion in concurrent systems.
Test_and_Set is a hardware instruction that sets a memory location to a value and returns its old value.
The program uses a loop to repeatedly execute the Test_and_Set instruction until it returns 0.
The program then enters the critical section and sets the memory location back to 0 when done.
Example code: while(Test_and_Set(&lock)); //critica
Program to merge two sorted linked lists in sorted order
Create a new linked list to store the merged result
Compare the first nodes of both lists and add the smaller one to the result list
Move the pointer of the list with the smaller node to the next node
Repeat until one of the lists is empty, then add the remaining nodes of the other list to the result
Return the merged list
Program to find the duplicate in an array using binary tree or hash table
Create a binary tree or hash table
Iterate through the array and insert each element into the tree or table
If an element already exists, it is a duplicate
Virtual memory is still necessary even with large physical memory. Paging helps manage memory usage.
Virtual memory allows for efficient use of physical memory by swapping data between RAM and storage devices.
Paging helps manage memory usage by dividing memory into smaller chunks called pages, which can be swapped in and out of physical memory as needed.
Even with large physical memory, virtual memory can still be useful...
Time complexity of building a heap using linked list and arrays
Building a heap using a linked list takes O(nlogn) time complexity
Building a heap using an array takes O(n) time complexity
Linked list implementation is slower than array implementation
Arrays are better for random access while linked lists are better for insertion and deletion
To find the middle of a linked list, use two pointers - one moving at twice the speed of the other.
Initialize two pointers - slow and fast
Move the slow pointer one step at a time and the fast pointer two steps at a time
When the fast pointer reaches the end of the list, the slow pointer will be at the middle
If the list has even number of nodes, there will be two middle nodes. In that case, return the second middle node
Get interview-ready with Top Tejas Networks Interview Questions
Top trending discussions
Some of the top questions asked at the Tejas Networks interview -
The duration of Tejas Networks interview process can vary, but typically it takes about less than 2 weeks to complete.
based on 82 interviews
Interview experience
based on 414 reviews
Rating in categories
7-15 Yrs
Not Disclosed
15-20 Yrs
Not Disclosed
R&D Engineer
268
salaries
| ₹0 L/yr - ₹0 L/yr |
Network Engineer
161
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Engineer
154
salaries
| ₹0 L/yr - ₹0 L/yr |
Engineer
121
salaries
| ₹0 L/yr - ₹0 L/yr |
Software Engineer
92
salaries
| ₹0 L/yr - ₹0 L/yr |
Sterlite Technologies
HFCL Limited
Vihaan Networks
Bharti Airtel