Add office photos
Employer?
Claim Account for FREE

PayPal

3.9
based on 891 Reviews
Filter interviews by

100+ Megha Engineering & Infrastructures Interview Questions and Answers

Updated 18 Dec 2024
Popular Designations

Q1. Painting Fences Problem Statement

You are given ‘N’ fences. Your task is to compute the total number of ways to paint these fences using only 2 colors, such that no more than 2 adjacent fences have the same col...read more

Add your answer

Q2. Cycle Detection in a Singly Linked List

Determine if a given singly linked list of integers forms a cycle or not.

A cycle in a linked list occurs when a node's next points back to a previous node in the list. T...read more

Add your answer

Q3. Integer to Roman Conversion

Given an integer N, convert it to its corresponding Roman numeral representation. Roman numerals comprise seven symbols: I, V, X, L, C, D, and M.

Example:

Input:
N = 2
Output:
II
Exp...read more
Add your answer

Q4. Reverse Linked List Problem Statement

Given a singly linked list of integers, return the head of the reversed linked list.

Example:

Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Add your answer
Discover Megha Engineering & Infrastructures interview dos and don'ts from real experiences

Q5. Cycle Detection in Undirected Graph Problem Statement

You are provided with an undirected graph containing 'N' vertices and 'M' edges. The vertices are numbered from 1 to 'N'. Your objective is to determine whe...read more

Add your answer

Q6. Longest Repeating Subsequence Problem Statement

Given a string st, your task is to determine the length of the longest repeating subsequence such that no two subsequences have the same character at the same pos...read more

Add your answer
Are these interview questions helpful?

Q7. Painter's Partition Problem

You are given an array/list of length 'N'. Each element of the array/list represents the length of a board. There are 'K' painters available to paint these boards. Each unit of a boa...read more

Add your answer

Q8. Maximum Path Sum in a Matrix

Given an N*M matrix filled with integer numbers, determine the maximum sum that can be obtained from a path starting from any cell in the first row to any cell in the last row.

You ...read more

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

Q9. Find Magic Index in Sorted Array

Given a sorted array A consisting of N integers, your task is to find the magic index in the given array, where the magic index is defined as an index i such that A[i] = i.

Exam...read more

Add your answer

Q10. Merge Sort Problem Statement

You are given a sequence of numbers, ARR. Your task is to return a sorted sequence of ARR in non-descending order using the Merge Sort algorithm.

Explanation:

The Merge Sort algorit...read more

Add your answer

Q11. Palindrome Partitioning II Problem Statement

Given a string ‘str’, find the minimum number of partitions needed such that every segment of the string is a palindrome.

The task is to make cuts in the string to p...read more

Add your answer

Q12. Sum Queries in a Sorted Array

Given two arrays arr and queries, your task is to determine the sum of all elements in arr that are less than or equal to each element in queries. The array arr is provided in sort...read more

Add your answer

Q13. Friends Pairing Problem

The task is to determine the total number of ways to pair up 'N' friends or leave some of them single, following these rules:

  1. Each friend can either pair with one other friend or stay s...read more
Add your answer

Q14. Cycle Detection in a Directed Graph

Determine if a given directed graph contains a cycle. Return true if at least one cycle is found, otherwise return false.

Input:

T
The first line consists of the integer T, re...read more
Add your answer

Q15. Design a Constant Time Data Structure

Create a data structure that maintains mappings between keys and values, supporting the following operations in constant time:

1. INSERT(key, value): Add or update the inte...read more
Add your answer

Q16. Minimum Character Deletion Problem Statement

You have been provided a string STR. Your task is to find and return the minimum number of characters that need to be deleted from STR so that each character's frequ...read more

Add your answer

Q17. Count Ways To Reach The N-th Stair Problem Statement

You are given a number of stairs, N. Starting at the 0th stair, you need to reach the Nth stair. Each time you can either climb one step or two steps. You ha...read more

Add your answer

Q18. K Largest Elements Problem Statement

Given an unsorted array containing 'N' integers, you are required to find 'K' largest elements from the array and return them in non-decreasing order.

Input:

The first line ...read more
Add your answer

Q19. Reverse the String Problem Statement

You are given a string STR which contains alphabets, numbers, and special characters. Your task is to reverse the string.

Example:

Input:
STR = "abcde"
Output:
"edcba"

Input...read more

Add your answer

Q20. Total Area of Overlapping Rectangles Problem Statement

Determine the total area covered by two given rectangles on a 2-D coordinate plane, which may have an overlapping area.

Input:

The first line contains an i...read more
Add your answer

Q21. Maximum Difference Problem Statement

Given an array ARR of N elements, your task is to find the maximum difference between any two elements in ARR.

If the maximum difference is even, print EVEN; if it is odd, p...read more

Add your answer

Q22. Sort Linked List Based on Actual Values

Given a Singly Linked List of integers that are sorted based on their absolute values, the task is to sort the linked list based on the actual values.

The absolute value ...read more

Add your answer

Q23. Rearrange String Problem Statement

Given a string ‘S’, your task is to rearrange its characters so that no two adjacent characters are the same. If it's possible, return any such arrangement, otherwise return “...read more

Add your answer

Q24. DFS Traversal Problem Statement

Given an undirected and disconnected graph G(V, E), where V is the number of vertices and E is the number of edges, the connections between vertices are provided in the 'GRAPH' m...read more

Add your answer

Q25. One Away Transformation Problem

Given two strings, A and B, determine whether A can be transformed into B by performing at most one of the following operations (including zero operations):

1. Delete a character...read more
Add your answer

Q26. Subset Sum Equal To K Problem Statement

Given an array/list of positive integers and an integer K, determine if there exists a subset whose sum equals K.

Provide true if such a subset exists, otherwise return f...read more

Add your answer

Q27. Find The Sum Of The Left Leaves Problem Statement

Given a binary tree with ‘root’, your task is to find and return the sum of all the left leaf nodes.

Example:

Input:
1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1
Outpu...read more
Add your answer

Q28. Median of Two Sorted Arrays

Given two sorted arrays A and B of sizes N and M, find the median of the merged array formed by combining arrays A and B. If the total number of elements, N + M, is even, the median ...read more

Add your answer

Q29. Delete a Node from a Linked List

You are provided with a linked list of integers. Your task is to implement a function that deletes a node located at a specified position 'POS'.

Input:

The first line contains a...read more
Add your answer

Q30. Find K Closest Elements

Given a sorted array 'A' of length 'N', and two integers 'K' and 'X', your task is to find 'K' integers from the array closest to 'X'. If two integers are at the same distance, prefer th...read more

Add your answer

Q31. Problem: Sort an Array of 0s, 1s, and 2s

Given an array/list ARR consisting of integers where each element is either 0, 1, or 2, your task is to sort this array in increasing order.

Input:

The input starts with...read more
Add your answer

Q32. N Queens Problem

Given an integer N, find all possible placements of N queens on an N x N chessboard such that no two queens threaten each other.

Explanation:

A queen can attack another queen if they are in the...read more

Add your answer

Q33. Kth Largest Element Problem

Given an array containing N distinct positive integers and a number K, determine the Kth largest element in the array.

Example:

Input:
N = 6, K = 3, array = [2, 1, 5, 6, 3, 8]
Output...read more
Add your answer

Q34. BFS Traversal in a Graph

Given an undirected and disconnected graph G(V, E) where V vertices are numbered from 0 to V-1, and E represents edges, your task is to output the BFS traversal starting from the 0th ve...read more

Add your answer

Q35. Minimum Cost Path Problem Statement

Given an N x M matrix filled with integers, determine the minimum sum obtainable from a path that starts at a specified cell (x, y) and ends at the top left corner of the mat...read more

Add your answer

Q36. Counting Sort Problem Statement

Ninja is learning about sorting algorithms, specifically those that do not rely on comparisons. Can you help Ninja implement the counting sort algorithm?

Example:

Input:
ARR = {-...read more
Add your answer

Q37. Reverse Only Letters Problem Statement

You are given a string S. The task is to reverse the letters of the string while keeping non-alphabet characters in their original position.

Example:

Input:
S = "a-bcd"
Ou...read more
Add your answer

Q38. Next Greater Element Problem Statement

You are given an array arr of length N. For each element in the array, find the next greater element (NGE) that appears to the right. If there is no such greater element, ...read more

Add your answer

Q39. Left View of a Binary Tree

Given a binary tree, your task is to print the left view of the tree. The left view of a binary tree contains the nodes visible when the tree is viewed from the left side.

Input:

The ...read more
Add your answer

Q40. Valid Parentheses Problem Statement

Given a string 'STR' consisting solely of the characters “{”, “}”, “(”, “)”, “[” and “]”, determine if the parentheses are balanced.

Input:

The first line contains an integer...read more
Add your answer

Q41. Find All Pairs Adding Up to Target

Given an array of integers ARR of length N and an integer Target, your task is to return all pairs of elements such that they add up to the Target.

Input:

The first line conta...read more
Add your answer

Q42. Remove Duplicates from String Problem Statement

You are provided a string STR of length N, consisting solely of lowercase English letters.

Your task is to remove all duplicate occurrences of characters in the s...read more

Add your answer

Q43. Group Anagrams Together

Given an array/list of strings STR_LIST, group the anagrams together and return each group as a list of strings. Each group must contain strings that are anagrams of each other.

Example:...read more

Add your answer

Q44. Balanced Parentheses Combinations

Given an integer N representing the number of pairs of parentheses, find all the possible combinations of balanced parentheses using the given number of pairs.

Explanation:

Con...read more

Add your answer

Q45. Input a file. Select first 3 lines of the file. Select the longest line and count the number of words in that line. It was easy. I used Java methods to solve the problem. I explained the logic and he accepted i...

read more
Ans.

The program reads a file and selects the first 3 lines. It then identifies the longest line and counts the number of words in that line.

  • Read the file using appropriate file handling methods

  • Store the first 3 lines in an array of strings

  • Iterate through the array to find the longest line

  • Count the number of words in the longest line using string manipulation methods

Add your answer

Q46. Palindrome Checker Problem Statement

Given an alphabetical string S, determine whether it is a palindrome or not. A palindrome is a string that reads the same backward as forward.

Input:

The first line of the i...read more
Add your answer

Q47. Divide Two Integers Problem Statement

You are given two integers dividend and divisor. Your task is to divide the integers without using multiplication, division, and modular operators. Return the quotient afte...read more

Add your answer

Q48. Character Counting Challenge

Create a program that counts and prints the total number of specific character types from user input. Specifically, you need to count lowercase English alphabets, numeric digits (0-...read more

Add your answer

Q49. But amazon can do the search in O(n). Why it has to go for O(nk)? For data structures like Hash tables and for large data, n will be large. So O(nk) is better than O(n) (former n is smaller than latter n).

Ans.

O(nk) is better than O(n) for large data and hash tables.

  • O(nk) is better because it takes into account the size of the data and the number of keys.

  • For large data and hash tables, the size of n will be large, making O(nk) more efficient.

  • O(n) assumes a constant number of keys, which may not be the case in practice.

  • Amazon may have chosen O(nk) for better scalability and performance.

Add your answer

Q50. Replace Spaces in a String

Given a string STR consisting of words separated by spaces, your task is to replace all spaces between words with the characters "@40".

Input:

The first line contains an integer ‘T’ d...read more
Add your answer

Q51. When you search for a particular product in amazon, it displays some of the search results. But, only few particular products which are available in amazon are displayed, not all. How does this happen? I told M...

read more
Ans.

Amazon displays only a subset of search results based on various factors like relevance, popularity, and user preferences.

  • Amazon uses algorithms to determine which products to display in search results.

  • Factors considered include product relevance, customer reviews, sales rank, and availability.

  • Machine learning techniques may be used to personalize search results based on user behavior and preferences.

  • Amazon also considers factors like seller reputation and fulfillment options...read more

Add your answer

Q52. There exists a 3x3 matrix, start from the first element reach the last element of the matrix, between each edges there exists a weight. Reach the destination such that the sum of weights should be small. It was...

read more
Ans.

The question is about finding the shortest path in a 3x3 matrix with weighted edges.

  • This is a graph traversal problem.

  • Use a graph algorithm like Dijkstra's algorithm or A* search to find the shortest path.

  • Assign weights to the edges and calculate the sum of weights for each possible path.

  • Choose the path with the smallest sum of weights as the shortest path.

Add your answer

Q53. Vertical Order Traversal Problem Statement

You are given a binary tree, and the task is to perform a vertical order traversal of the values of the nodes in the tree.

For a node at position ('X', 'Y'), the posit...read more

Add your answer

Q54. Dijkstra's Shortest Path Problem

Given an undirected graph with ‘V’ vertices (labeled 0, 1, ... , V-1) and ‘E’ edges, where each edge has a weight representing the distance between two connected nodes (X, Y).

Y...read more

Add your answer
Q55. What is hashing and how can it be implemented?
Add your answer
Q56. You are presented with a puzzle where there are n balloons, and your task is to burst the maximum number of balloons using an arrow. How would you approach solving this puzzle?
Add your answer

Q57. Similar String Groups Problem Statement

Two strings S1 and S2 are considered similar if either S1 equals S2 or we can swap two letters of S1 at different positions so that it equals S2.

Input:

The first line of...read more
Add your answer

Q58. How would I explain the concept of prime number to an illiterate?

Ans.

A prime number is a number that is divisible only by 1 and itself.

  • A prime number has exactly two factors: 1 and itself.

  • Prime numbers cannot be divided evenly by any other number.

  • Examples of prime numbers include 2, 3, 5, 7, 11, 13, 17, etc.

Add your answer

Q59. What will be the key and what will be the values? The product will be the key. The brands will be the values.

Ans.

The product will be the key and the brands will be the values.

  • The key in this case refers to the unique identifier for each product.

  • The values are the different brands associated with each product.

  • For example, if the product is a smartphone, the key could be the model number and the values could be the different brands that manufacture that model.

Add your answer

Q60. What js E cheque ? And what is the time for its clearance

Ans.

An e-cheque is an electronic version of a paper cheque that is used for making payments online.

  • E-cheques are created and signed digitally, eliminating the need for physical paper.

  • They are typically used for online transactions and can be deposited into a bank account electronically.

  • The clearance time for e-cheques varies depending on the bank and the specific transaction.

  • It can take anywhere from a few hours to several business days for an e-cheque to clear.

  • During the clearan...read more

View 3 more answers
Q61. You will be given certain conditions for which you need to design a system. Can you explain your approach to low-level system design?
Add your answer
Q62. How do you handle critical situations in a workplace?
Add your answer
Q63. How can you check whether you have an internet connection on your system?
Add your answer

Q64. Five advantages of spring boot Which java version you currently use? Features of the java version you use Output from the code Difference between this and super In order to update the string, which will be bett...

read more
Ans.

Spring Boot offers advantages like rapid development, easy configuration, embedded servers, production-ready features, and more.

  • Rapid development: Spring Boot simplifies the setup and configuration of Spring applications, allowing developers to focus on writing business logic.

  • Easy configuration: Spring Boot provides auto-configuration, reducing the need for manual setup and boilerplate code.

  • Embedded servers: Spring Boot comes with embedded servers like Tomcat, Jetty, and Unde...read more

Add your answer

Q65. Do you know Radix Sort? Where it is used? Radix sort can be applied in amazon.

Ans.

Radix sort is a sorting algorithm that sorts integers by processing individual digits from least significant to most significant.

  • Radix sort is a non-comparative sorting algorithm.

  • It sorts numbers by grouping them based on each digit's value.

  • It is commonly used for sorting strings in lexicographic order.

  • Radix sort has linear time complexity, making it efficient for large datasets.

View 1 answer
Q66. In how many attempts can you find a defective ball among 10 given balls using a two-pan balance scale?
Add your answer

Q67. Suggest as many methods as possible for finding the nth largest element in an unsorted linked list

Ans.

Methods to find nth largest element in an unsorted linked list

  • Traverse the linked list and store elements in an array, sort the array and return the nth largest element

  • Use quickselect algorithm to find the nth largest element in O(n) time complexity

  • Implement a max heap and extract the nth largest element

  • Divide the linked list into smaller sublists and recursively find the nth largest element

  • Use merge sort to sort the linked list and return the nth largest element

Add your answer

Q68. What data structure do they use? Hash tables.

Ans.

Hash tables are a data structure that uses a hash function to map keys to values, providing efficient lookup, insertion, and deletion.

  • Hash tables use a hash function to convert keys into array indices.

  • They provide constant-time average case complexity for search, insert, and delete operations.

  • Collisions can occur when different keys map to the same index, which can be resolved using techniques like chaining or open addressing.

  • Examples of hash table implementations include Pyt...read more

Add your answer
Q69. What happens when you type a URL in a web browser?
Add your answer

Q70. what is hashing and how will you implement?

Ans.

Hashing is a process of converting data into a fixed-size numerical value called a hash code.

  • Hashing is used to quickly retrieve data from large datasets.

  • It is commonly used in data structures like hash tables and hash maps.

  • Hash functions should be fast, deterministic, and produce unique hash codes for different inputs.

  • Examples of hash functions include MD5, SHA-1, and SHA-256.

Add your answer

Q71. Application of Fibonacci series in day-to-day life.

Ans.

The Fibonacci series can be applied in day-to-day life for various purposes.

  • Financial planning: Fibonacci numbers can be used to calculate investment growth and determine optimal investment strategies.

  • Architecture and design: Fibonacci ratios can be used to create aesthetically pleasing designs and layouts.

  • Nature and biology: Fibonacci patterns can be observed in the growth of plants, arrangement of leaves, and formation of shells.

  • Music and art: Fibonacci sequences can be use...read more

Add your answer
Q72. How would you design a rate limiter?
Add your answer

Q73. Explain the concepts of Object Oriented Programming

Ans.

Object Oriented Programming is a programming paradigm that uses objects to represent real-world entities.

  • Encapsulation: bundling data and methods that operate on that data within one unit

  • Inheritance: creating new classes from existing ones, inheriting their properties and methods

  • Polymorphism: ability of objects to take on multiple forms or behaviors

  • Abstraction: hiding complex implementation details and providing a simplified interface

  • Example: A car object can have properties ...read more

View 1 answer

Q74. Design classes for educational institutions in a city

Ans.

Design classes for educational institutions in a city

  • Identify the main entities: schools, students, teachers, courses

  • Create a School class with attributes like name, address, and a list of students and teachers

  • Create a Student class with attributes like name, age, and a list of courses

  • Create a Teacher class with attributes like name, specialization, and a list of courses

  • Create a Course class with attributes like name, duration, and a list of students and teachers

  • Establish rel...read more

Add your answer

Q75. no of pairs between 1 and N satisfy relation pow(a,3)+pow(b,3)=pow(c,3)+pow(d,3).a,b,c,d<=N

Ans.

The question asks for the number of pairs between 1 and N that satisfy a specific mathematical relation.

  • The relation is pow(a,3) + pow(b,3) = pow(c,3) + pow(d,3)

  • The values of a, b, c, and d should be less than or equal to N

  • Count the number of pairs that satisfy the relation

Add your answer

Q76. find the and return if the given file path existing in the given file hierarcy(file system).

Ans.

Check if a given file path exists in the file system hierarchy and return the result.

  • Use file system APIs to check if the given file path exists in the hierarchy.

  • Traverse the file system hierarchy starting from the root directory to find the given file path.

  • Return true if the file path exists, false otherwise.

Add your answer

Q77. Show the abstraction and write code for function overriding

Ans.

Abstraction is hiding the implementation details, function overriding is providing a new implementation for a method in a subclass.

  • Abstraction involves hiding the complex implementation details and showing only the necessary features to the user.

  • Function overriding occurs in inheritance when a subclass provides a specific implementation for a method that is already defined in its superclass.

  • Example: Parent class 'Animal' has a method 'makeSound()', subclass 'Dog' overrides th...read more

Add your answer

Q78. Give a few test cases for a bank transaction

Ans.

Test cases for a bank transaction

  • Transaction amount within account balance limit

  • Transaction amount exceeds account balance limit

  • Transaction to a valid account number

  • Transaction to an invalid account number

  • Transaction with correct transaction code

  • Transaction with incorrect transaction code

  • Transaction during bank working hours

  • Transaction outside bank working hours

Add your answer

Q79. Given an array of numbers find the subset of numbers that give zero sum.

Ans.

Find subset of numbers in array that sum up to zero.

  • Use a nested loop to iterate through all possible subsets.

  • Calculate the sum of each subset and check if it equals zero.

  • Store the subset if the sum is zero.

  • Optimize the solution by using a hash set to store the cumulative sum of elements.

Add your answer
Q80. What are the applications of the Fibonacci series in real life?
Add your answer

Q81. Optimal path cost and path in a matrix . Dynamic programming

Ans.

Finding optimal path cost and path in a matrix using dynamic programming.

  • Dynamic programming is a technique to solve problems by breaking them down into smaller subproblems and solving them recursively.

  • In this case, we can use dynamic programming to find the optimal path cost and path in a matrix.

  • We can start by defining a 2D array to store the minimum cost of reaching each cell in the matrix.

  • Then, we can use a recursive function to calculate the minimum cost of reaching the ...read more

Add your answer

Q82. What you do if the customer is not happy for genivan cause?

Ans.

Listen to their concerns, apologize, offer a solution, and follow up to ensure satisfaction.

  • Listen actively to their concerns and empathize with their situation.

  • Apologize for any inconvenience caused and take responsibility for the issue.

  • Offer a solution that addresses their concerns and meets their needs.

  • Follow up with the customer to ensure their satisfaction and address any further concerns.

  • Document the issue and the steps taken to resolve it for future reference.

Add your answer

Q83. Common puzzle- There are three boxes,one box of blue balls, one green and one mixed ,all labelled incorrectly. In how many trials will i label them correctly...

read more
Ans.

The boxes are labelled incorrectly with blue, green, and mixed balls. How many trials are needed to correctly label them?

  • Start by picking a ball from the box labelled 'mixed'. Since all labels are incorrect, this ball must be either blue or green.

  • Now, you can correctly label the box with the remaining two labels based on the color of the ball picked from the 'mixed' box.

  • This can be done in just one trial by picking a ball from the 'mixed' box.

Add your answer

Q84. A recursive program to print numbers in ascending order

Ans.

A recursive program to print numbers in ascending order

  • Use a recursive function that takes a starting number and an ending number as parameters

  • Print the starting number and recursively call the function with starting number + 1 and the same ending number

  • Base case: stop recursion when starting number is greater than ending number

Add your answer

Q85. Program to implement Dijkstra’s algorithm

Ans.

Dijkstra's algorithm finds the shortest path between nodes in a graph.

  • Create a graph with nodes and edges

  • Assign a tentative distance to each node

  • Set the initial node as current and mark it visited

  • For each neighbor of the current node, calculate the tentative distance

  • If the tentative distance is less than the current distance, update the distance

  • Mark the current node as visited and select the unvisited node with the smallest tentative distance

  • Repeat until the destination node ...read more

Add your answer

Q86. Running time of Radix sort? O(nk)

Ans.

Radix sort has a running time of O(nk), where n is the number of elements and k is the length of the longest element.

  • Radix sort is a non-comparative sorting algorithm that sorts elements by their individual digits or characters.

  • It works by distributing the elements into 10 buckets based on the value of the least significant digit, then repeatedly redistributing them based on the next significant digit.

  • The process continues until all digits have been considered, resulting in a...read more

Add your answer

Q87. There are 10 weights of which two weigh less than the others. Using a balance how will i identify the defective ones...

read more
Add your answer

Q88. How many A4 sheets are sold in India per day?

Ans.

It is impossible to accurately determine the number of A4 sheets sold in India per day.

  • There is no centralized data on the sales of A4 sheets in India.

  • The number of A4 sheets sold can vary greatly depending on the region and industry.

  • Factors such as digitalization and environmental concerns may also impact sales.

  • Estimates or projections may be available from specific companies or industries.

  • Market research firms may have data on the overall paper market in India.

Add your answer

Q89. Program to reverse a singly linked list

Ans.

A program to reverse a singly linked list

  • Create a new empty linked list

  • Traverse the original linked list and insert each node at the beginning of the new list

  • Return the new list

Add your answer

Q90. Give examples of abstraction and polymorphism

Ans.

Abstraction is hiding implementation details while polymorphism is using a single interface for multiple types.

  • Abstraction: Encapsulation, Interfaces, Abstract classes

  • Polymorphism: Method Overloading, Method Overriding, Interfaces

  • Abstraction Example: Car - we don't need to know how the engine works to drive it

  • Polymorphism Example: Animal - different animals have different sounds but they all have a 'makeSound' method

Add your answer

Q91. how to find cycle in graph

Ans.

To find a cycle in a graph, use depth-first search (DFS) and keep track of visited nodes.

  • Implement DFS algorithm to traverse the graph

  • Maintain a visited array to keep track of visited nodes

  • If a visited node is encountered again during DFS, a cycle exists

Add your answer

Q92. What is shortest path problem ,and write a code for it

Ans.

Shortest path problem is finding the shortest path between two nodes in a graph.

  • It is a common problem in graph theory and computer science.

  • Dijkstra's algorithm and Bellman-Ford algorithm are commonly used to solve it.

  • The problem can be solved using dynamic programming and graph traversal techniques.

  • Examples include finding the shortest route between two cities on a map or the shortest path for a robot to navigate a maze.

Add your answer
Q93. Write a query to find the nth highest salary from a database.
Add your answer

Q94. How will you track payment failure count and make it fail safe

Ans.

Track payment failure count and ensure fail safe measures

  • Implement a system to track payment failure count in real-time

  • Set up alerts for payment failures exceeding a certain threshold

  • Automate retries for failed payments with back-off strategies

  • Implement logging and monitoring to track payment failure trends

  • Integrate with payment gateway APIs to handle failures gracefully

Add your answer
Q95. What are virtual functions?
Add your answer

Q96. What are OOPS concepts like inheritance,polymorphism etc

Add your answer

Q97. What was my work and explain how did I work with data

Ans.

I worked as a data analyst, collecting, cleaning, and analyzing data to identify trends and make recommendations.

  • Collected data from various sources such as databases, spreadsheets, and APIs

  • Cleaned and organized data to ensure accuracy and consistency

  • Performed statistical analysis to identify patterns and trends

  • Created visualizations and reports to communicate findings to stakeholders

Add your answer

Q98. What are the metrics that you are working on

Ans.

I am currently working on metrics such as first call resolution, average handling time, and customer satisfaction.

  • First call resolution - ensuring that customer issues are resolved on the first call

  • Average handling time - tracking the time it takes to resolve customer issues

  • Customer satisfaction - measuring how satisfied customers are with the service provided

Add your answer
Q99. Write an SQL query to find the nth highest salary.
Add your answer
Q100. Design a Cinema Ticket Reservation System.
Add your answer
1
2
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Megha Engineering & Infrastructures

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

Top Interview Questions from Similar Companies

3.5
 • 2.1k Interview Questions
3.4
 • 644 Interview Questions
3.8
 • 364 Interview Questions
3.6
 • 345 Interview Questions
3.8
 • 135 Interview Questions
4.0
 • 133 Interview Questions
View all
Top PayPal 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