## Recent Interview Questions

- 0of 0 votes
Simplify 586645 * 9999

a) 5865863355

b) 5665863355

c) 4865863355

d) 4665863355

- 1of 1 vote
/* Intersection of two sorted interval lists, A=[(1,2), (5,7)..]

B=[(2,6)...] return [(5,6)..] */`import java.util.*; class Interval{ int start; int end; public Interval(int start, int end){ this.start = start; this.end = end; } } class Solution { public List<Interval> Intersection(Interval[] i1, Interval[] i2) {}`

- 2of 2 votes
Find the indices of all anagrams of a given word in a another word.

For example: Find the indices of all the anagrams of AB in ABCDBACDAB (Answer: 0, 4, 8)

- 2of 2 votes
Amazon OA2

Implement a round robin scheduler.

Each process has an arrival time Atime[i], execute time Etime[i].

Q is the maximum time that a process gets executed in its turn. If the process isn't finished after q, it waits till the next round.

Output average wait time for the processes.

- 0of 0 votes
write a program that take l and r as input and display the number of prime numbers that lie between l and r(l and r inclusive) and can be represented as sum of two consecutive prime numbers +1

- 0of 0 votes
All jumbled numbers of n digits in max (worst case) O(n) and min (avg case) O(log n) time.

A number is a jumbled number if the _absolute_ difference between adjacent digits is <=1.

For an input n=3

output should be

100

101

110

111

121

122

...

and so on.

The problem is similar to the one listed here https://www.careercup.com/question?id=5729332770111488

But this problem also has a O(n or log n) limitation and the solutions listed in the above mentioned problem at the time of posting this question, do not satisfy the criteria

PS: 001 is not a 3 digit number.

210 is absolutely fine as the absolute difference between adjacent digits is <=1.

- 0of 0 votes
Design a data structure that supports 3 below operations

1. GetNextId() : It returns the auto incremental next id. i.e 1 then 2 then 3 then 4

2. Acknolwdge(int i) : receives the acknowledgement of the id that was sent by GetNextId

3. GetIdLevel() : It returns the minimum id that has not been acknowledged

- 0of 0 votes
There is a primary machine and a secondary(backup machine). Write a program to sync files from primary to backup machine

- 1of 1 vote
Given 2 words, return true if second word has a substring that is also an anagram of word 1.

LGE , GOOGLE- True

GEO, GOOGLE - False

- 0of 0 votes
Design a system which helps to calculate average Skype call duration per day. In which events are tracked from mobile app. Need to take care of all edge cases like events can be logged to server in any sequence & there can be some events missing on server side also.

- 0of 0 votes
Given two list of unsorted intervals V1 and V2 write 2 functions 'OR ' and 'And' to return a new list

OR Function (union of list ): Input V1 = (2,4) (6,8) (1,3) V2 = (7,9) (2,5)

output = (1,5) (6,9)

And function : This will be intersection function and will return intersection of the lists

- 0of 0 votes
MS FTE Question:

Find the gap from 1,2,5,6,10

Answer : 3,4,7,8,9

- -6of 6 votes
Folders and Cows Hackerrank Dropbox Question.

I haven't opened the link, so I don't know the prompt and I have only have 75mins to complete it starting when I begin the challenge.

- 0of 0 votes
* Given a string on length N. You can swap only the adjacent elements

and each element can be swapped atmost once.

Find the no of permutations of the string that can be generated after

performing the swaps as mentioned.

Ex –

string – “12345”

Ans = 8

Explanations- (All the permutations)

12345

21345

13245

12435

12354

21435

13254

21354

- 0of 0 votes
Given an array of n positive integers, find the number of subarrays

such that product of the elements of those subarrays are less than k.

For eg. Arr= {2, 3, 6} k=10

No of such subarrays= 4

- 1of 1 vote
Print the levels of a binary tree in reverse order using stack and recursion

`Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree 3 / \ 9 20 / \ 15 7 return its bottom-up level order traversal as: [ [15,7], [9,20], [3] ]`

public List<List<Integer>> levelOrderBottom(TreeNode root) {

}

- 0of 0 votes
given an array, find whether there exists 3 elements a,b,c in it such that a+b=c using efficient method.

- 0of 0 votes
You are provided a BST, which is corrupted. One of the nodes in it has 2 parents.

Let’s say those are parent 1 and parent 2. It is ensured that none

of these parents will be the ancestor of the other. Identify the node,

and remove the link of the wrong parent.

- 1of 1 vote
given an array of strings and characters, make the largest string possible.

The resultant string should be a combination of the strings given in the array.

The given array

of characters may contain repeated elements.

Example – Given char array – {a,a,b,c,d,d,e,c} and given strings

– {abba, aabc, de, cde} the

ans is aabccde

- 1of 1 vote
Given an adjacency matrix of a directed graph, find the number of cycles in the graph

- 0of 0 votes
How to Design Netflix.(System Design)

- 0of 0 votes
How to Design App-Store like google play.(System Design)

- 0of 0 votes
Given an array of strings, find out in how many cases is any of the anagrams of the string at location i, a substring of the string at location i+1.

Test Case I: ["ab", "ab", "abc", "bca"]

Answer: 3

Test Case II: ["ab","aqb"]

Answer: 0

- 0of 0 votes
Given K sorted (ascending) arrays. Write an iterator class that iterate over the arrays and returns the next element. Duplicate are allowed. What is the complexity to iterate the entire arrays? what is the complexity for each iteration?

Example:`arr1 = {1,2,3,4,7,9} arr2 = {3,5,6,8,10}`

The iterator should return:

`1,2,3,3,4,5,6,7,8,9,10`

Extension:

Don't return duplicates, so the above iterator should return:`1,2,3,4,5,6,7,8,9,10`

- 0of 0 votes
Check if two DOM Trees have the same text.

e.g. <html><p>hello</p></html>, <html><p><b>h</b>ello</p></html> should be the same text

DOMNode class definition (string tag, string text, bool isText, vector<DOMNode*> children)

- 0of 0 votes
Given a target sum, populate all subsets, whose sum is equal to the target sum, from an int array.

For example:

Target sum is 15.

An int array is { 1, 3, 4, 5, 6, 15 }.

Then all satisfied subsets whose sum is 15 are as follows:

15 = 1+3+5+6

15 = 4+5+6

15 = 15

- 0of 0 votes
Genarate and validate a magic matrix.A magic matrix is one in which the sum of every row,column,and every diagonal is same.One such matrix will be when every element in the matrix is same.generate and validate a magic matrix where every element is not the same

- 0of 0 votes
Coin change problem with finite number of coins available

denominations of coins = {1,2,3}

count of coins = ={1,1,3}

find the number of ways for getting change for S=6

- 1of 3 votes
A message containing letters from A-Z is being encoded to numbers using the following mapping:

'A' -> 1

'B' -> 2

...

'Z' -> 26

Given an encoded message containing digits, determine the total number of ways to decode it.

For example,

Given encoded message "12", it could be decoded as "AB" (1 2) or "L" (12).

- 0of 0 votes
Given two sorted integer arrays, find the median element. Note that for an even sized collection, median element is to be defined as the average of the central two elements.