Filter interviews by
Return a random byte from a stream of bytes with equal probability.
Create a variable to store the count of bytes read
Create a variable to store the current random byte
For each byte read, generate a random number between 0 and the count of bytes read
If the random number is 0, store the current byte as the random byte
Return the random byte
Algorithm to find Nth-to-Last element in a singly linked list of unknown length
Traverse the list and maintain two pointers, one at the beginning and one at Nth node from beginning
Move both pointers simultaneously until the second pointer reaches the end of the list
The first pointer will be pointing to the Nth-to-Last element
If N=0, return the last element
Parse the list only once
Print all possible permutations of an array of integers
Use recursion to swap elements and generate permutations
Start with the first element and swap it with each subsequent element
Repeat the process for the remaining elements
Stop when all elements have been swapped with the first element
Print each permutation as it is generated
Design a stack that prints the minimum element pushed in O(1)
Use two stacks, one for storing elements and another for storing minimums
When pushing an element, compare it with the top of minimum stack and push the smaller one
When popping an element, pop from both stacks
To get the minimum element, just return the top of minimum stack
To find a number in a matrix where all rows and columns are sorted non-decreasingly. Complexity of the solution.
Use binary search to find the number in each row and column
Start from the top-right corner or bottom-left corner to optimize search
Time complexity: O(m log n) or O(n log m) depending on the starting corner
To check if a directed graph is cyclic or not
Use Depth First Search (DFS) algorithm to traverse the graph
Maintain a visited set to keep track of visited nodes
Maintain a recursion stack to keep track of nodes in the current DFS traversal
If a node is visited and is already in the recursion stack, then the graph is cyclic
If DFS traversal completes without finding a cycle, then the graph is acyclic
To find the starting point of a loop in a linked list, use Floyd's cycle-finding algorithm.
Use two pointers, one moving at twice the speed of the other.
When they meet, move one pointer to the head of the list and keep the other at the meeting point.
Move both pointers one step at a time until they meet again, which is the starting point of the loop.
Check if a binary tree is a binary search tree or not.
Traverse the tree in-order and check if the values are in ascending order.
For each node, check if its value is greater than the maximum value of its left subtree and less than the minimum value of its right subtree.
Use recursion to check if all nodes in the tree satisfy the above condition.
I appeared for an interview before Feb 2022.
To check if a directed graph is cyclic or not
Use Depth First Search (DFS) algorithm to traverse the graph
Maintain a visited set to keep track of visited nodes
Maintain a recursion stack to keep track of nodes in the current DFS traversal
If a node is visited and is already in the recursion stack, then the graph is cyclic
If DFS traversal completes without finding a cycle, then the graph is acyclic
Return a random byte from a stream of bytes with equal probability.
Create a variable to store the count of bytes read
Create a variable to store the current random byte
For each byte read, generate a random number between 0 and the count of bytes read
If the random number is 0, store the current byte as the random byte
Return the random byte
Algorithm to find Nth-to-Last element in a singly linked list of unknown length
Traverse the list and maintain two pointers, one at the beginning and one at Nth node from beginning
Move both pointers simultaneously until the second pointer reaches the end of the list
The first pointer will be pointing to the Nth-to-Last element
If N=0, return the last element
Parse the list only once
Print all possible permutations of an array of integers
Use recursion to swap elements and generate permutations
Start with the first element and swap it with each subsequent element
Repeat the process for the remaining elements
Stop when all elements have been swapped with the first element
Print each permutation as it is generated
Design a stack that prints the minimum element pushed in O(1)
Use two stacks, one for storing elements and another for storing minimums
When pushing an element, compare it with the top of minimum stack and push the smaller one
When popping an element, pop from both stacks
To get the minimum element, just return the top of minimum stack
To find the starting point of a loop in a linked list, use Floyd's cycle-finding algorithm.
Use two pointers, one moving at twice the speed of the other.
When they meet, move one pointer to the head of the list and keep the other at the meeting point.
Move both pointers one step at a time until they meet again, which is the starting point of the loop.
To find a number in a matrix where all rows and columns are sorted non-decreasingly. Complexity of the solution.
Use binary search to find the number in each row and column
Start from the top-right corner or bottom-left corner to optimize search
Time complexity: O(m log n) or O(n log m) depending on the starting corner
Top trending discussions
Binary search is an efficient algorithm for finding an item from a sorted array by repeatedly dividing the search interval in half.
1. Binary search requires a sorted array to function correctly.
2. It works by comparing the target value to the middle element of the array.
3. If the target value is less than the middle element, search the left half; if greater, search the right half.
4. Repeat the process until the target ...
I applied via Job Portal and was interviewed in Sep 2024. There were 4 interview rounds.
2 DSA question was asked
40 questions in 20 minutes
Generate all possible permutations of an array of strings
Use recursion to generate permutations
Swap elements to create different permutations
Base case: when array size is 1, return array as permutation
Dynamic programming questions, longg time to complete the 2 questions
Problem solving : a clock with 3 hands, no numbers written, guess what it is
1 hour 3 questions easy to medium leetcode.
I applied via Campus Placement and was interviewed in Apr 2023. There were 3 interview rounds.
Platform - Mettl
3 Questions of medium level difficulty to do in 2 hours, typically contain concepts like DSA, DP etc.
I applied via Referral
Java internals, coding questions 2sum
Open to relocation for the right opportunity
Willing to relocate for the right job opportunity
Flexible with location for the right role
Open to considering different locations for the right position
I appeared for an interview in Apr 2021.
Round duration - 120 Minutes
Round difficulty - Medium
I was MCQ + Coding round, Their were MCQ Based on DSA, Aptitude and 2 easy coding questions.
Ninja is organizing a coding competition where two teams compete at a time. To keep it fair and interesting, both teams must have an equal number of members. Ninja’s ta...
Check if Ninja can create two teams with equal members given an integer N and its divisors.
Iterate through all divisors of N and assign members to the first or second team based on whether the divisor is even or odd.
Keep track of the total members in each team and check if they are equal at the end.
Return true if the total members in both teams are equal, false otherwise.
Bob has just turned 18 and opened a bank account. Being inexperienced with banking, Bob needs your help to validate whether an IFSC code provided by his bank is valid.
...Validate IFSC code based on given rules and return True or False for each test case.
Check if the code is 11 characters long.
Verify the first four characters are uppercase alphabets.
Ensure the fifth character is '0'.
Validate that the last six characters are alphanumeric.
Round duration - 50 Minutes
Round difficulty - Easy
The nature of the interviewer was very kind. The test was proctored, our webcam and mic were on, and shared my screen.
Round duration - 50 minutes
Round difficulty - Easy
The nature of the interviewer was very kind. The test was proctored, our webcam and mic were on, and shared my screen.
Tip 1 : Be strong at your basics.
Tip 2 : Do at least 2 projects and ask to find answers like why are you choosing this tech stack? why did not you choose its alternatives Know your project in and out because they might ask you for a modification in your project?
Tip 1 : Have some projects on your resume.
Tip 2 : Do not put false things on your resume.
Tip 3 : Try to keep a single-page resume.
Some of the top questions asked at the Mentor Graphics Software Developer interview -
based on 1 interview experience
Difficulty level
Duration
based on 2 reviews
Rating in categories
Senior Member of Technical Staff
69
salaries
| ₹14.6 L/yr - ₹22.1 L/yr |
Lead Member Technical Staff
41
salaries
| ₹20.4 L/yr - ₹32 L/yr |
Member Consulting Staff
31
salaries
| ₹34.3 L/yr - ₹56 L/yr |
Member Technical Staff
29
salaries
| ₹13.5 L/yr - ₹22.2 L/yr |
Software Engineer
15
salaries
| ₹12 L/yr - ₹22 L/yr |
Duck Creek Technologies
Mobileum
OnProcess Technology
Yodlee