Find Minimum difference pair [ Amazon Interview Question]

Problem: Find the minimum difference between any pair in an unsorted  array.

 

Kadane’s Algorithm [ Macrosoft – Amazon – FlipKart ]

Problem: Given an array containing both negative and positive integers. Find the contiguous sub-array with maximum sum. Link

 

Maximum Product Sub array [ Microsoft – Amazon ]

Problem : Given an array that contains both positive and negative integers, find the product of the maximum product subarray. Link Discussion: It is a Similiar problem to maximum sum sub array problem. Notice,maximum product can also be obtained by minimum (negative) product ending with the last element multiplied by this element. we use mn_end_here(can be

Search in rotational sorted array[ Microsoft – Amazon – FlipKart ]

Problem: Find a value from a rotational sorted array. Solution Hint: binary search. Link

 

Parenthesis Checker [ Snapdel – Amazon ]

Problem: Check the balance of parenthesis sequence, the string contains (),{} and []. Link

 

Find Maximum Distance [ Google-Amazon ]

Problem: An array of integers will be given, find the maximum distance of indexes of  [j – i]  subjected to the constraint of A[i] <= A[j]. A : [4 6 5 3]; Output : 2; For the pair (4, 5). Link

   

Removing duplicate chars[Microsoft]

Problem: Given a string, Remove all the duplicate chars, string may include spaces. Solution Hints:solN; ASCII char valaus range from -128 to 127. Link The following solution did not get AC from OJ. My guess is, there may be a problem with that OJ.

   

Find Largest Number formed from an Array [PayTm , Amazon]

Problem:A list of non negative integers will be provided, arrange the numbers in such a way that they form the largest number possible. Example: From a list : 9 30 31 4 10 ; Largest number formed : 94313010. Link