Google Interview Question for Applications Developers


Country: India




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

Each movie is a object of a movie class with attributes like genre, name, review stars, length, list of review comments, etc..

Now store these movie objects into memory or secondary storage disk.
Create hashmaps with the key as the attribute(genre, length, etc..) and value as arraylist of the object references. So there is one genres hashmap, one movie length hashmap, multipe lead actors hashmaps, etc..

The hashmaps can be maintained in memory.

Whenever a new movie object is created update the hashmaps.

For answering the queries have the corresponding hashmap look up.

- Subhajit June 15, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In memory representation, is it a good idea ?

Maintain a DB with good data modelling like key words mapping and other attributes mapping which can give fast data access.
NB: I would prefer auto ranking (number of hits by users), typically popularity

If user types keywords like romantic, latest, fight movie with specific time of comedy/action/romance or may be some other attributes.
Then we need to translate into SQL syntax
say for examples,
romantic movies->search by keyword romantic
latest movies->release date < sysdate order by release date (limit N)
action more than 10 minutes->typically romantic movie
so on ...

If any search criteria missing then system has to update missing search criteria intelligently

- Debasis Jana June 15, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Sorry, it would be action less than 10 minutes ;)

- Debasis Jana June 15, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

how can the system update the search criteria on it own intelligently?
Are you saying that the DBMS will create new indices based on query stats?

- Subhajit June 15, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Also I mentioned in -memory considering that we can maintain the maps in memory for faster retrieval.
Also database queries are slower than an in-memory look up, isn't it?

- Subhajit June 15, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I hope, we can use B Trees. Each node will have more than 2 children. All node will represent keys. Depending on the key , it will fetch the movie.

- prashanthreddy.mtech June 15, 2013 | 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