Info Edge
Onmood9 Interview Questions and Answers
Q1. 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
Find the magic index in a sorted array where A[i] = i.
Iterate through the array and check if A[i] = i for each index i.
Since the array is sorted, you can optimize the search using binary search.
Return the index if found, else return -1.
Q2. Triplets with Given Sum Problem
Given an array or list ARR
consisting of N
integers, your task is to identify all distinct triplets within the array that sum up to a specified number K
.
Explanation:
A triplet i...read more
The task is to identify all distinct triplets within an array that sum up to a specified number.
Iterate through the array and use nested loops to find all possible triplets.
Check if the sum of the triplet equals the specified number.
Print the valid triplets or return -1 if no such triplet exists.
Q3. Matching Prefix Problem Statement
Given an integer N
representing the number of strings in an array Arr
composed of lowercase English alphabets, determine a string S
of length N
such that it can be used to dele...read more
Given an array of strings, find the lexicographically smallest string that can be used as a prefix to minimize the total cost of deleting prefixes from the strings.
Iterate through the array to find the common prefix among all strings
Choose the lexicographically smallest common prefix
Delete the common prefix from each string in the array to minimize the total cost
Q4. Alien Dictionary Problem Statement
You are provided with a sorted dictionary (by lexical order) in an alien language. Your task is to determine the character order of the alien language from this dictionary. Th...read more
Given a sorted alien dictionary in an array of strings, determine the character order of the alien language.
Iterate through the words in the dictionary to build a graph of character dependencies.
Perform a topological sort on the graph to determine the character order.
Return the character array representing the order of characters in the alien language.
Q5. Jumping Numbers Problem Statement
Given a positive integer N
, your goal is to find all the Jumping Numbers that are smaller than or equal to N
.
A Jumping Number is one where every adjacent digit has an absolute...read more
Find all Jumping Numbers smaller than or equal to a given positive integer N.
Iterate through numbers from 0 to N and check if each number is a Jumping Number.
For each number, check if the absolute difference between adjacent digits is 1.
Include all single-digit numbers as Jumping Numbers.
Output the list of Jumping Numbers that are smaller than or equal to N.
Q6. react lifecycle in functional components
React lifecycle in functional components
useEffect hook replaces lifecycle methods
useEffect runs after every render by default
useEffect can be controlled by dependencies array
useEffect cleanup function can be used to clean up effects
useLayoutEffect hook runs synchronously after DOM mutations
Interview Process at Onmood9
Top Front end Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month