Round 1
Questions: Design a Music Player like Spotify with below methods
int addSong(string songTitle); // add a song to your music player with incremental song ids starting from 1 void playSong(int songId, int userId); // user plays a song that is present in the music player void printMostPlayedSongs(); // print song titles in decreasing order of number of unique users' plays
Follow-up Question
vector<int> getLastThreeSongs(int userId); // get last 3 unique songs played by a given user
There was another follow up as well which the recruiter mentioned post the interview. Couldn't get time for that.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 2
Questions: General Behavioural Questions
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 3
Questions: Design a Key Value Store
string get(string key); void set(string key, string value); void deleteKey(string key);
Follow-up Question
Support transactions - begin, commit and rollback. I immediately asked the interviewer if we needed to support nested transactions. He said yes but for the next followup. He still asked me to first code it for 1 level of transaction for which I took a lot of time.
Follow-up Question
Support nested transactions. No time was left.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 4
Questions: Design an excel sheet
void set(string cell, string value); // cell can be A1, B2. value can be like "10", "1" or even excel formulae like "=9+10" and "=-1+-10+2" void reset(string cell); // reset the cell void print(); // print all the cells along with their raw and computed values
Follow-up Question
Extend solution to support values like "=A1+10" where A1 is a cell name.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 5
Questions: Design Google News
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.