Open In App

Flipkart Interview Experience for SDE-1 (On-Campus 2019)

Improve
Improve
Like Article
Like
Save
Share
Report

Round 1: Online Round – 

3 Questions on hackerrank. 
 

  1. Finding all triplets in an array where a[i]<a[j]<a[k] and i<j<k. n=1e4.
  2. Given an array and a vector of pair of indexes, print the lexicographically maximum array after swapping some elements from the set of index pairs.You can swap any number of times provided the two indexes used for a swap are present in the given pair vector. n=1e5, number of pairs = 1e5
  3. (This was the hardest question) Consider a graph with n<=1e5 nodes and an integer k>=0. There is an edge in a graph between two nodes i and j if gcd(i, j)>k. Now given q<=1e5 queries. For each query there are two nodes, print the length of the shortest path between two nodes or -1 if no path exists.

Students solving almost 2 questions qualified for next round. 

Round 2: Problem solving (pen/paper) round 

2 questions – 
 

  1. Given n nodes, and some edges between any 2 nodes. Find a way to assign the nodes to any 2 boxes so that no box contains any pair of edge. (Check if possible or not). (Boils down to checking for bipartite graph)
  2. Given an array of numbers and K. Divide the array into K continuous subarrays so that sum of each subarray is odd. (Simple greedy)

Round 3: Problem solving (pen/paper) round 

3 questions – 
 

  1. Given a tree with each node assigned a value. Maximize the sum on the whole tree with the given condition that if a node is chosen, the nodes adjacent to it cannot be chosen. (Tree dp problem)
  2. Given a string of { and } characters, find min. no of elements that are required to be deleted so that it is a correct bracket sequence. Also print all the strings which will give a correct bracket sequence on removal of minimum number of characters. (Dp with path function)
  3. Given n coins of some value. Any coin can be picked up any number of times. Find number of ways to take some coins so that their sum is S. (Standard dp problem)

Round 4: Manager/HR round- 

General interaction with a senior manager at the company. Some basic HR questions. 

  

I got the offer.
 


Last Updated : 07 Oct, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads