Pages

Saturday, March 5, 2011

some iterview questions from Amazon

附电话面试题:

一面:

1. write a function to count zero bits in an integer, read code on the phone

2. use OOD to design an HTML parser, list all the classes and methods
其实就是DOM的简化,当时没反应上来,答得不好

3. what’s the difference between old style Python classes and the new style

4. Unix, how to find the file with the longest path name?

5. Unix, a million webpages, each page may have some phone numbers with two
formats (XXX)XXX-XXXX, XXX-XXX-XXXX, how to find them out and update them

6. A million of ids and more coming, how to tell if an id is duplicated.
what data structure, what’s the complexity

7. what if amazon website is slow?
(follow up). what if app server is idling but database server has high load?
(follow up). how to design cache on the app server?

二面:

1. (老题) find out pairs in an array that sum to a given sum.
write code on paper and read to the interviewer (character by character).

2. (OOD) Design classes for actors and movies, implement at least these two
methods:
actors->getMovies()
movies->getActors()
what to do if initializing actors needs the movies objects while
initializing movies needs the actor objects.
how to search for actors that starred in movies that were on show at a given
time.
discuss different approaches.

3. How to improve the current IMDb website, how to design the mobile version
(iphone/Android)

No comments:

Post a Comment