## Recent Interview Questions

- -1of 1 vote
I am looking for a good resource to learn lossy counting sticky sampling.Can anyone point me towards good resource?I am ready for a one-to-one session too.

- 1of 1 vote
You are given a text file. You have to return the list of starting index of the given word in text file. Design an efficient DS for that.

Example :-

Text file content : “geeks for geeks”

word : “geeks”

List : {0,10}

- 0of 0 votes
In a file, there are two columns, first column has some word (String) and 2nd column has some value (Double).

Example :-

ABC 23.4

ERF 34.89

WERT 122.9

Now user wants some arithmetic operations like

1) ABC + ERF = 23.4 + 34.89 = 58.29

2) ABC – WERT = 23.4 – 122.9 = -99.5

Design an efficient DS for these kind of operations.

- 0of 0 votes
Given a remote having 0-9 digits, plus button (to increase channel), minus (to decrease) and previous channel button (to go to previous channel). We were given 2 numbers stating start and end channel number and an array having various channel numbers. The task was to go to all channel numbers given in array with minimum number of clicks.

- 0of 0 votes
Given MxN binary matrix, find the largest sub-square matrix with all 1’s.

- 0of 0 votes
Design a geographically partitioned multi-player card game, that supports multiple players, multiple games at a time.

Each game will have one contractor like ones we have in a bar, He can play a game or just watch it. Integrate payment systems.

First HLD was required, use cases, flow diagram. then a low level design was required all necessary classes where will you use polymorphism, where inheritance, multithreading, synchronised approach if needed, socket connections

- 1of 1 vote
Design a Netflix type system. Start from HLD to LLD.

Consider requirements like search, video serving, authentication, security, serving multi quality video.

- 0of 0 votes
Given an array of integers. We need to answer two types of queries point update and range sum in minimum time.

- 0of 0 votes
Put the given random pointers in linkedlist to point to next greater node such that if you transverse the list using random pointers, list become sorted. duplicates are allowed.

- 1of 1 vote
Find third highest value in a binary tree

- 0of 0 votes
There are n Thread , n/2 thread are producer and n/2 are consumer, number produced by producer-1 thread must be consumed by consumer-1 thread. Thread must also run in order, producer 1, then consumer 1, again producer 2 and then consumer 2…so on…..

- 0of 0 votes
Implement function which add n days to given date without using inbuilt library.

- 0of 0 votes
Design a text based rpg.

- Player can enter room.

- Room has 4 walls and items

- a wall can have door

- user can enter a different room if they chose a wall which has door.

- There is also a Enemy, which walks around different rooms. If present in the same room, takes away all your items

- A player has an inventory which has list of items

- a item can be food or weapon

User should be able to start a game and be given set options(in text) of what command to execute, like pick up item in current room, walk north, east, south, or west, or undo action to return to previous state.

- 0of 0 votes
You are given a set of N horizontal lines which are connected by equal number of vertical lines to form squares of size 1x1. Now some segments are removed. You need to count the number of squares of all sizes (1x1, 2x2, ..., NxN) with all sides present.

Image : https://he-s3.s3.amazonaws.com/media/uploads/1ce3516.png

In the above example you see four horizontal and vertical lines and few missing segments. Now you need to count the number of squares of all sizes with all sides.

Input :

First line is a positive integer N, number of horizontal and vertical lines.

Second line is positive integer M, number of segments removed.

Then there are m lines, each containing V,i,j or H,i,j where i and j are positive integers. H,i,j indicates a horizontal missing segment in the ith horizontal line between the jth and (j+1)th point on the line. V,i,j represents a gap in ith vertical line between the jth and (j+1)th point on the line.

Output :

Is the total number of squares in the figure with all sides along the remaining lines in the figure.

Sample Input :

4

4

H,2,1

H,3,1

V,2,2

V,2,3

Output :

5

Explanation : Here in this figure we have 4 squares of size 1x1 and 1 square of size 3x3, hence total is 5.

- 0of 0 votes
In a Kafka configuration, the same message is getting replayed to the consumer again n again.This is happening under heavy load otherwise it's fine.What can be possible causes?

- 1of 1 vote
III. Square root of a number?

IV. Expression operators? Add signs (+, -, *, /) to a string to form target

V. Top trending posts in last 5m, 1H, 1Day?

- 0of 0 votes
I. Closest K nodes to a target in BST? (Do it in O(n)?)

II. Nested List sum?

- 2of 2 votes
Generate a random binary tree, with equal probability.

- 0of 0 votes
Given data of millions of people, (name, age, M/F etc.) Develop an API that will have age range as input and yield the count of people under this range as output.

- 1of 1 vote
A T20 match is going on. You’re in Team B. First innings is over, they have scored “teamARuns” runs. Your team has scored “teamBRuns” runs at the end of “balls” balls. A ball can have multiple possibilities like [0, 1, 2, 3, 4, 5, 6, Wicket, No ball, Wide ball]. What is the probability that your team (Team B) will win?

- 0of 0 votes
Given a dictionary of words and a string pattern. Output the count of words that match the string pattern in the dictionary.

Eg. Dictionary: [cat, rat, mat, apple, boy, bat]

String pattern: ?at

Output: 4 (because cat, rat, mat, bat matches the string pattern)

- 0of 0 votes
Given any two nodes in a binary tree, find the path from 1st node to another, and tell if the path is a straight line, or there are turns on the line, find number of turns.

- 0of 0 votes
Find the maximum difference between any combination of child and parent node in a given binary tree. Here child node can be any level below parent node, but should be in the same sub tree starting from parent node.

- 1of 1 vote
Design Truecaller. Both HLD and LLD.

- 0of 0 votes
Given a chessboard, find minimum number of moves for a knight to reach from source to destination.

- 0of 0 votes
Given a fully connected graph with n nodes and corresponding values. One node can interact with other node at a time, to replace/ignore/add its value to other node’s value. Assuming this operation takes 1 unit of time, how much time would it take for all the nodes to have value equal to sum of all the nodes.

Examples : Given a graph with values {1,2,3,4}, find total time it takes, such that all nodes have value as 10.

- 1of 1 vote
Given a Singly Linked list, Update the second half of the list such that n-th element becomes sum(1st + nth) element, (n-1)st element becomes sum(2nd + n-1st) element and so on. Eg: 2->3->4->5->6 => 2->3->(4+4)->(5+3)->(6+2)

- 0of 0 votes
There are some professors, some courses, and some students.

Each professor can teach only a single course.

Each course has a fixed duration(Eg. 10 weeks).

For each professor, you are given time availability schedule(assume week wise).

Each student has a list of courses he wants to learn.

There can be only 1:1 classes, i.e., 1 professor can teach only a single student.

A student can attend only one course at a time.

A professor has to finish teaching a course in a one go.

Your aim is to prepare a schedule so that all courses are taught in the least time.

- 0of 0 votes
Given a stream of numbers which contains n numbers, each number is positioned at max k positions away from its actual position. Sort the array in the most optimized way.

- 0of 0 votes
Implement a queue using only one stack.