Wednesday, May 21, 2008

Interview questions coding design and analysis - part II (Web programming)

1. Jeff Bezos has decided that he doesn’t like his website anymore, and he has tasked you with identifying a suitable platform for his online bookstore application. He wants you to build the new website from scratch. Let’s assume that he wants you to design a system that keeps track of 100 million books, allows 10 million users to browse through the selection or quickly search for the book they want via the Internet, keep track of users’ preferences, and permit secure online purchases. What technology or set of technologies would you use to accomplish this task? Please defend your choice against other possible alternatives.

2. Considering the lifecycle of software development, and keeping in mind that Jeff doesn’t want to change the chosen web technology/technologies for at least 3 years, but that he does want to have the flexibility to make significant changes to the application if need be, are you still confident that your choice is the best? Why?

3. What are some of the things you would do to increase the availability of your database, as in “make it mission-critical”? Assume you have infinite resources.

4. Bob Millionaire just purchased some apartment buildings and would like you to design a database system that will enable him to properly oversee and manage his new investment. He will be hiring several building managers to help him handle the day-to-day problems and issues that will arise for his tenants. While some of these managers will be placed in charge of only one building, others could manage several. Bob would like to be able to use the system to see what buildings his managers are in charge of, and would also like to keep track of each manager’s name, phone number, address, and weekly wage.

Bob would also like to keep track of his tenants. He would like to be able to look up any given tenant’s name, phone number, apartment number, rent rate, and lease expiration date. It is also very important that Bob is able see in which building each tenant is currently residing.

From time to time, tenants will register complaints that Bob’s building managers will need to address. For each complaint, Bob would like to store the description of the complaint, the resolution of the complaint, the manager who resolved the issue, the date the complaint was registered, the date the complaint was resolved, and the tenant or tenants who registered the complaint. If two or more tenants register the same complaint, Bob would like the complaint to be entered into the system only once, but would still like to keep track of all of the tenants that registered the complaint.

a) Using the scenario above, describe how you would design the database. List all of the tables you would create along with the fields you would create in each table. Clearly mark your primary and foreign keys. If you make any assumptions, please state them.

b) Using the database you have just designed, write a SQL query that lists the name of each tenant and the total number of complaints they have ever registered.

5. Use the rules below to construct a class diagram. You may use UML or some other technique capable of communicating what classes would be created, what attributes would be created in each class, and the relationships that would exist between the classes. For each class, do not worry about methods, just the attributes and relationships that might exist. Indicate attributes only when necessary (you will not need to fill in attributes for all of the classes). If you make any assumptions, please state them.

a) There exists a company in which there are several software development teams.
b) Each software development team has a number of developers.
c) Within each team there are two types of developers--Senior Developers and Junior Developers.
d) All developers have names, phone numbers, and addresses, but only Senior Developers are issued a company car and only Junior Developers are issued a laptop computer.
e) Company cars have a make, model, year, and color.
f) Laptop computers have a make and model.
g) All developers are involved in one or more projects.
h) Projects have a name and an estimated date of completion.

6. Many banks have a telephony service that allows their customers to call in and verify their personal account balance via the telephone. Most of the banks are happy with the default number utterance; however, Bank One believes that it could gain an edge over the competition by personalizing the number utterance. They hired a speech professional to record the following utterances:

Number Spoken Output File Name
0 Zero 0.wav
1 One 1.wav
2 Two 2.wav
3 Three 3.wav
4 Four 4.wav
5 Five 5.wav
6 Six 6.wav
7 Seven 7.wav
8 Eight 8.wav
9 Nine 9.wav
10 Ten 10.wav
11 Eleven 11.wav
12 Twelve 12.wav
13 Thirteen 13.wav
14 Fourteen 14.wav
15 Fifteen 15.wav
16 Sixteen 16.wav
17 Seventeen 17.wav
18 Eighteen 18.wav
19 Nineteen 19.wav
20 Twenty 20.wav
30 Thirty 30.wav
40 Forty 40.wav
50 Fifty 50.wav
60 Sixty 60.wav
70 Seventy 70.wav
80 Eighty 80.wav
90 Ninety 90.wav
- Hundred Hundered.wav
- Thousand Thousand.wav
.01 Cent Cent.wav
- And And.wav
- Cents Cents.wav
- Dollars Dollars.wav

Using C#, please create the algorithm that will output to the screen the names of the .wav files in the proper sequence for any number between 0.00 and 999,999.99. Assume and.wav will be used to join only dollars and cents. For example:
1,234.59 = 1.wav + Thousand.wav + 2.wav + Hundred.wav + 30.wav + 4.wav + Dollars.wav + And.wav + 50.wav + 9.wav + Cents.wav
103.01 = 1.wav + Hundred.wav + 3.wav + Dollars.wav + And.wav + 1.wav + Cent.wav

7. What is one application you created (either individually or as part of a team) that you are proud of? Please describe it in broad terms, focusing especially on your choice of technology, and any algorithms you might have used. How long did it take you to develop it?

8. Is there any database-driven website on the Internet that you created, either individually, or as part of a team?


Anonymous said...

Can you post the analysis for this posting

Anonymous said...

Can any one provide solution for the above questions

Global Handler said...

I can definitely help on the solutions, but on specific questions that you are interested in. And it will be good to know your identity, so that even you can contact me via email.

Anonymous said...

Does anyone have the solution for the problem regarding converting: 103.01 = 1.wav + Hundred.wav ... etc? If so can you please email me at