Synopsys
Modi Motors Agencies Interview Questions and Answers
Q1. What are semaphores, differnce between them, Different OSI layers , deadlock protocols, ACID protocols in dbms
Semaphores, OSI layers, deadlock and ACID protocols in DBMS
Semaphores are used for process synchronization and communication
OSI model has 7 layers: Physical, Data Link, Network, Transport, Session, Presentation, Application
Deadlock protocols prevent processes from entering a deadlock state
ACID protocols ensure database transactions are reliable and consistent
Q2. What is the differnce between linear and non linear data structure?
Linear data structures have a sequential arrangement of elements while non-linear data structures have a hierarchical arrangement.
Linear data structures have a fixed number of elements and are easy to traverse.
Non-linear data structures have an arbitrary number of elements and are difficult to traverse.
Arrays, linked lists, and stacks are examples of linear data structures.
Trees, graphs, and heaps are examples of non-linear data structures.
Q3. What is the differnce between c and c++?
C++ is an extension of C with object-oriented programming features.
C++ supports classes and objects while C does not.
C++ has better support for polymorphism and inheritance.
C++ has a standard template library (STL) for data structures and algorithms.
C++ allows function overloading while C does not.
C++ has exception handling while C does not.
Q4. Steps associated with client server connnection request?
Steps for client server connection request.
Client sends a connection request to the server.
Server receives the request and sends a response.
Client receives the response and establishes a connection.
Connection is maintained until terminated by either party.
Q5. Find the boundary traversal of a binary tree?
Boundary traversal of a binary tree is the process of visiting the nodes on the boundary of the tree.
Start with the root node and traverse the left boundary nodes from top to bottom.
Traverse the leaf nodes from left to right.
Traverse the right boundary nodes from bottom to top.
Exclude the leaf nodes that are already traversed in the second step.
Repeat the above steps for all the subtrees of the binary tree.
Q6. Find the left view of a binary tree?
The left view of a binary tree shows the nodes that are visible when the tree is viewed from the left side.
Traverse the tree recursively from left to right
Print the first node encountered at each level
Example: For tree with root node A, left view is A, B, D, G
Q7. FInd the middle of the linked list?
To find the middle of a linked list, use two pointers - one moving at twice the speed of the other.
Use two pointers - slow and fast
Slow pointer moves one node at a time, fast pointer moves two nodes at a time
When fast pointer reaches the end, slow pointer will be at the middle
Q8. difference between process and threads?
Processes are independent programs while threads are lightweight processes within a program.
Processes have their own memory space while threads share memory space.
Processes communicate through inter-process communication while threads communicate directly.
Processes are slower to create and terminate than threads.
Examples of processes are web browsers, word processors, etc. while examples of threads are spell checkers, print spoolers, etc.
Q9. Producer and consumer problem?
Producer and consumer problem is a synchronization problem in computer science where multiple processes share a common resource.
It occurs when multiple processes try to access a shared resource simultaneously.
The producer produces data and the consumer consumes it.
The problem is to ensure that the producer does not produce data when the buffer is full and the consumer does not consume data when the buffer is empty.
Examples include printing documents, reading and writing files...read more
More about working at Synopsys
Reviews
Interviews
Salaries
Users/Month