Add office photos
Employer?
Claim Account for FREE

Mentor Graphics

4.0
based on 55 Reviews
Filter interviews by

10+ Eureka Forbes Interview Questions and Answers

Updated 2 Aug 2024

Q1. You have a stream of bytes from which you can read one byte at a time. You only have enough space to store one byte. After processing those bytes, you have to return a random byte. Note: The probability of pick...

read more
Ans.

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

Add your answer

Q2. find the average speed for a particular ditance is the average speed while going is x.find out the speed of whole trip...(something like that)

Ans.

To find the average speed for the whole trip, we need to know the distance and the time taken for the trip.

  • Average speed = Total distance / Total time

  • If the distance and time for the trip are known, the average speed can be calculated.

  • If only the average speed while going is known, we cannot determine the speed of the whole trip without additional information.

Add your answer

Q3. Find a number a matrix mat[m][n] where all the rows and columns are sorted non-decreasingly. What will be the complexity of the solution

Ans.

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

Add your answer

Q4. Devise an algorithm to determine the Nth-to-Last element in a singly linked list of unknown length. If N = 0, then your algorithm must return the last element. You should parse the list only once

Ans.

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

Add your answer
Discover Eureka Forbes interview dos and don'ts from real experiences

Q5. Given a linked list with loop, how would you find the starting point of the loop ?

Ans.

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.

Add your answer

Q6. difference between spi & i2c,difference between latch & ff

Ans.

SPI and I2C are communication protocols used for connecting devices, while latch and FF are different types of sequential logic elements.

  • SPI (Serial Peripheral Interface) and I2C (Inter-Integrated Circuit) are both serial communication protocols used for connecting devices in embedded systems.

  • SPI uses separate lines for data input and output, while I2C uses a shared bus for both input and output.

  • SPI supports higher data transfer rates compared to I2C.

  • I2C allows multiple devic...read more

Add your answer
Are these interview questions helpful?

Q7. Design a Stack DS that also prints in O(1) the minimum element you pushed in the stack

Ans.

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

Add your answer

Q8. Given an array of integers, print all possible permutations. Also explain your approach

Ans.

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

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. probability of getting heads maximum two times

Ans.

The probability of getting heads maximum two times in a series of coin flips.

  • To calculate the probability, divide the number of favorable outcomes by the total number of possible outcomes.

  • In this case, the favorable outcomes are 0, 1, or 2 heads, and the total possible outcomes are 2^n, where n is the number of coin flips.

  • For example, if we flip a coin 3 times, the favorable outcomes are HHT, HTH, THH, HHH, TTH, THT, and TTT, which is 7 out of 8 possible outcomes.

  • So, the prob...read more

Add your answer

Q10. Find if a given directed graph is cyclic or not

Ans.

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

Add your answer

Q11. Find if a given Binary Tree is BST or not

Ans.

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.

Add your answer

Q12. Verilog coding of various flip flops and fsm

Ans.

Verilog coding of flip flops and FSM involves designing sequential circuits using Verilog HDL.

  • Understand the functionality of different flip flops like D flip flop, JK flip flop, etc.

  • Implement flip flops using Verilog syntax, specifying input and output ports.

  • Design Finite State Machines (FSM) using Verilog, defining states, transitions, and outputs.

  • Use Verilog constructs like always blocks, case statements, and state registers for FSM implementation.

Add your answer

Q13. How to use this data entry?

Ans.

Data entry can be used to input information into a system or database.

  • Identify the specific system or database where the data needs to be entered.

  • Ensure that the data being entered is accurate and complete.

  • Follow any specific guidelines or protocols for data entry.

  • Regularly review and update the entered data as needed.

  • Examples: entering customer information into a CRM system, inputting financial data into an accounting software.

Add your answer

Q14. Implement flip flop using mux

Ans.

Flip flop can be implemented using a multiplexer by selecting the input based on the control signal.

  • Use a 2:1 multiplexer to select between the current state and the next state

  • Connect the output of the multiplexer to the input of the flip flop

  • Control signal determines which input is passed through the multiplexer

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Eureka Forbes

based on 6 interviews
Interview experience
4.5
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

3.9
 • 340 Interview Questions
4.1
 • 206 Interview Questions
4.2
 • 173 Interview Questions
4.0
 • 170 Interview Questions
3.9
 • 154 Interview Questions
3.3
 • 145 Interview Questions
View all
Top Mentor Graphics Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter