(i.e. we have 2n+2 numbers and n numbers are occurring twice and remaining two have occurred once).

Find those two numbers in the

Interview Questions asked in Google, Microsoft, Amazon

by Dhaval Dave

Given an array in which all numbers except two are repeated once.

(i.e. we have 2n+2 numbers and n numbers are occurring twice and remaining two have occurred once).

Find those two numbers in the

… Read More (i.e. we have 2n+2 numbers and n numbers are occurring twice and remaining two have occurred once).

Find those two numbers in the

by Dhaval Dave

HackeEarth Flipkart’s Drone : After listening to the news of testing of Delivery Drone

But this was only possible if two of the shipping addresses had “V1-type” road connecting them(V1-type roads are the fastest in

… Read More But this was only possible if two of the shipping addresses had “V1-type” road connecting them(V1-type roads are the fastest in

by Dhaval Dave

The list is a most versatile datatype available in Python which can be written as a list of comma-separated values (items) between square brackets. Good thing about a list is that items in a list

by Dhaval Dave

When working with data, we need ways to store it in variables so we can manipulate it.

… Read More three of the most common data types used in programming: numbers, strings and booleans. We assigned those data

by Dhaval Dave

Given a sorted array and a number x, find a pair in array whose sum is closest to x.

Examples:

Input: arr[] = {10, 22, 28, 29, 32, 40}, x = 54

Output: 22 and

by Dhaval Dave

Given array of 0’s and 1’s. All 0’s are coming first followed by 1’s. find the position of first 1

Example : 00001111

Output : 4Method 1 : in O(n) we can do it .

… Read More Output : 4Method 1 : in O(n) we can do it .

by Dhaval Dave

Several Companies like MS, Amazon and Flipkart has started asking this question to Generate next palindrome number.

Say K is given, Generate N such that N is palindrome and N > K.

Logic 1) Create

by Dhaval Dave

This question was asked first in FACEBOOK On Campus for Internship.

There are N trees in a circle. Each tree has a fruit value associated with it.

A bird can sit on a tree for

by Dhaval Dave

Generally Interviewer can ask you simply to implement LRU cache, first explain which data structure you will use and why.

Its well known coding question being asked by all Tech giants like Amazon , Flipkart,

by Dhaval Dave

Sort an array according to the order defined by another array

Given two arrays A1[] and A2[], sort A1 in such a way that the relative order among the elements will be same as those

Given two arrays A1[] and A2[], sort A1 in such a way that the relative order among the elements will be same as those