Flipkart Interview Questions
Longest Increasing Subsequence
Maximum of all subarrays of size k
Input :
arr[] = {1, 2, 3, 1, 4, 5, 2, 3, 6}
k = 3
In Given LinkedList Divide LL in N Sub parts and delete first K nodes of each part
Given LinkedList and K=2, N=41->2->3->4->5->6->7->8->9
so Partitioned LinkedList will be
1->2->3->4->5->6->7->8->9
Now delete first K nodes from each subpart and return
HackeEarth Flipkart’s 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
Given a sorted array and a number x, find the pair in array whose sum is closest to x
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
Common Ancestor in a Binary Tree or Binary Search Tree
[1] / \ [2] [3] / \ / \ [4] [5] [9] [10] / / \ [8] [6] [7]
say
Print all nodes that are at distance k from a leaf node
Given a Binary Tree and a positive integer k, print all nodes that are distance k from a leaf node.
Here the meaning of distance k from a leaf means k levels higher than a
Generate next palindrome number
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
Flipkart SDET Interview Experience
Sharing my Interview experience.
There were Total 5 rounds
Round 1 ) Telephonic Round
I was asked two questions
Q1) Find Pythagoras triplet in array