Flipkart Interview Question for SDE-3s


Country: India
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
1
of 1 vote

Trie is the best example for this scenario but careful and smart implementation of trie is required here !!

- Coder.. July 06, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

As per my knowledge trie store from the first character to last character in different level of trie, now please tell how "my" keyword will be find when it will come in as substring not from front.

please reply!!!

- vishgupta92 August 17, 2015 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

1.) Given a song name , split the words from song name.
2.) Insert word in Trie if it doesn't exist, Trie as a data structure should have at each node , a list of songs.
3.)So when you insert Every and Everything
Each node till y in Every should point to list of two songs and after y should point to one song only.

- smarthbehl July 07, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Trie is a good example for this scenario but this requires smart implementation of trie

- Coder July 06, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<iostream>
#include<string>
using namespace std;

void dictionary(string niti,string in)
{
size_t found= niti.find(in);

if(found!=string::npos)
cout<<niti<<endl;
}


int main()
{
string in="night in";

string str[]={"Every night in my dreams","Listen to my heart","show me the meaning","night in london","night changes"};

int n= sizeof(str)/sizeof(str[0]);

for(int i=0;i<n;i++)
dictionary(str[i],in);
return 0;
}

- arnima0294 July 07, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It is a mixture of trie search. Store songs in vector and then in trie search, on each node, where word has been formed, save the indexes of songs in list. So in case if song "Every night in my dreams", it can go to E, N, I , M and D word and insert the index in list for nodes - Every, night, in , my, dreams. Now if user has type m, find all word by using trie search and caluclate the list of songs available on nodes by removing duplicates. return that.

- phoenix September 09, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

use a suffix trie to solve it

- shubham shandilya July 03, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

jhj

- Anonymous September 29, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

knnnnnnnnnnnnnnnnnnnnnnnnnnnnnn

- jkjjjjjjjjjj September 29, 2016 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More