Cadence Design Systems
Emkay Global Financial Services Interview Questions and Answers
Q1. check substring palindrome or not
Check if a substring in an array of strings is a palindrome or not.
Iterate through each string in the array
For each string, check if any of its substrings are palindromes
Return true if a palindrome substring is found, false otherwise
Q2. Reverse linked list recursively
Reverse a linked list recursively
Create a recursive function to reverse the linked list
Pass the current node and its next node as parameters
Update the next pointer of the current node to point to the previous node
Q3. Check if two stacks are equal
Check if two stacks are equal by comparing each element in the stacks
Pop elements from both stacks and compare them one by one
If the sizes of the stacks are different, they are not equal
If any element in the stacks is different, they are not equal
Q4. find shortest path in graph
Use Dijkstra's algorithm to find the shortest path in a graph
Implement Dijkstra's algorithm to find the shortest path between two nodes in a graph
Maintain a priority queue to keep track of the shortest distance to each node
Update the shortest distance to each node as you traverse the graph
Track the path by storing the previous node for each node visited
Q5. Add two linked list
To add two linked lists, iterate through both lists simultaneously and add corresponding nodes, considering carry from previous addition.
Create a dummy node to hold the result.
Initialize current node to dummy node.
Iterate through both lists, adding values and carry from previous addition.
Move to next nodes in both lists.
Handle cases where one list is longer than the other.
Handle final carry if present.
Q6. check tree is BST
Check if a binary tree is a Binary Search Tree (BST)
Perform an in-order traversal of the tree and check if the resulting array is sorted
Keep track of the previous node value during traversal to compare with the current node value
Ensure that each node's value is greater than the previous node's value in the in-order traversal
Top Senior Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month