ADP Interview Question for SDE-2s

Country: India
Interview Type: Written Test

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

Even better suggestion mechanism would be to,
1. tag each movie with multiple attributes such as Genre, Actor, Actress, Director, Release Year, Language and anything that you can think of.
2. Maintain a nested map data structure where we can push the number of movies watched by the user for the given key, here key will be these attributes. This map will have one more nested map.
3. Based on the top entries search for the movie database for similar movies.

So for ex. If a person has a Map Profile that looks something like

Actor -> Leo -> 5
              Tom ->4

Genre-> Action->5

Actress-> Monica ->4
                Scarlett-> 4
                 Eva ->1

Then filter movies based on Actor IN ('Leo', 'Tom') Actresses IN ('Scarlett', 'Monica') AND Genere IN ('Action') and so on.
And suggest movie based on the result.

Result can even be more optimized by applying another set of filters on top of this result where a record satisfying more than one entries will be at the top.

Going a step ahead, maintain a user graph with each edge having some weight value. two user with larger intersection between their profile graph can have higher edge weight.
Fetch the movie seen by such adjacent user, filter the movies seen by the neighbor user but not by the current one and add it to our suggestion list.

- Antriksh March 25, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
of 0 vote

Generate a list of movies which the users who have watched X have also most frequently watched.

This list can be maintained per-movie, and updated periodically.

During update, the system can search for users who have watched X, and iterate through the other movies they have seen, updating the count in a hash table.

- tjcbs2 March 27, 2017 | Flag Reply

Add a Comment

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


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


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