Object Oriented Design Interview Questions
- 0of 0 votes
AnswersYou have more than 3 million entries of phone numbers. You have to create a phone book just like the one we have on the new phones these days. You type the name, and the numbers that match the letters you typed shows up on your phone.
- Tom July 17, 2009
For e.g: When you type 'K' all numbers under K appear,then you say "i"...all numbers under "Ki" appear..so on and so forth.
How will you design/architecture this type of search? Discuss data structures you would use whats the worst case for your design?| Report Duplicate | Flag | PURGE
Delve Networks Software Engineer / Developer Data Structures Ideas Object Oriented Design - 0of 0 votes
AnswersWhen is using an interface necessary?
- Jackie June 23, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Object Oriented Design - 0of 0 votes
Answerswhat's the difference between abstract class and interface?
- Jackie June 19, 2009| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Object Oriented Design - 0of 0 votes
AnswersWrite a basic web application, following the Model-View-Controller/Modular design pattern. The following URLs should be functional:
- Silvimass May 27, 2009
• http://www.server.com/index.php?page=showTime - Displays the current system time.
• http://www.server.com/index.php?page=showDate - Displays the current system date.
• http://www.server.com/index.php?page=showVersion - Displays the current PHP / Java version.
Each page should be represented by an individual class. Any of the following languages can be used: PHP| Report Duplicate | Flag | PURGE
Amazon Web Developer PHP Object Oriented Design - 0of 0 votes
AnswersUtilizing two common Object-Oriented design patterns, write a set of classes, which can be used to log a given message. The message should be logged to either a MySQL database or a file, depending on a configuration setting. There should be only one connection opened to the database (or the log file should only be opened once) throughout the use of the application. ). Any of the following languages can be used: PHP
- Silvimass May 27, 2009
My Answer:
create a buffer to generate a log and then copy entire buffer to your designated file
but downsize of this method is .... you will loose all data if system fail to commite or fail to log...//power shutdown| Report Duplicate | Flag | PURGE
Amazon Web Developer PHP Object Oriented Design - 0of 0 votes
AnswersWhen would you use an interface vs. abstract class?
- ThatDude April 20, 2009| Report Duplicate | Flag | PURGE
Goldman Sachs Software Engineer / Developer Object Oriented Design - 0of 0 votes
Answers1. Do you know what a singleton is? Explain.
- Bloomberg Interview February 20, 2009
2. How do you make it thread-safe?| Report Duplicate | Flag | PURGE
Bloomberg LP Financial Software Developer Object Oriented Design - 0of 0 votes
AnswersWhat are abstract data types?
- Asha February 12, 2009| Report Duplicate | Flag | PURGE
Bloomberg LP Software Engineer / Developer Object Oriented Design - 1of 0 votes
AnswersYou are creating a calculator for a second grader kids.
- Daniel Johnson February 07, 2009
Write a function:
int Calculate(char *in)
where char *in is a string that contains an expression like: "1+2" or "-234334-345345" and you return the results accordingly. It is given that there would be two operands and an operator between them.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test C++ Object Oriented Design - 0of 0 votes
AnswersDesign a deck of cards.
- Meghna December 05, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersDesign a car renting system, including reserving a car, checking in and checking out. consider all the cases: reserve a car, then check out successfully; reserve a car, but the car is sold out before you check out...
- Anonymous November 29, 2008
Add the test cases.| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test Object Oriented Design - 1of 0 votes
AnswersHow do you represent the following expression in "class design": (5*3)+(4/2) ? How would an algorithm that computes the value of this expression work?
- Zefram Cochrane November 22, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersHow do you model an elevator in OOP? Extremely vague question on purpose. He wanted me to talk about the algorithm of elevator selecting which floors to go to based on the buttons pushed inside and outside elevator. Kept on asking followup questions. Prepare by thinking about how the algorithm for elevator works.
- Zefram Cochrane November 22, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 0of 0 votes
Answers1) Suppse you have ClassA and ClassB
- Anonymous November 13, 2008
One way to create an instance of ClassB in ClassA is
Class A
{
ClassB b = new ClassB();
}
What are the other ways to do it?| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersExplain how polymorphism works.
- Anonymous November 11, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - -3of 0 votes
AnswersDesign a stack of elevators.
- Anonymous November 03, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersDesign software for a restaurant
- Amazonview October 30, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersDesign a chess game.
- offerfromMS October 21, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswerThe interviewer explained me the real world scenario of the blockbuster..
- offerfromMS October 21, 2008
A location receives hundreds of copies of each film. They can be of multiple formats ( DVD,CD,Blu ray). We need to store the following information regarding the film: director, actress, rating. There are different genres possible. Action, drama etc. All the copies of a movie are placed under its shelf marked with its corresponding genre. All the movies of same genre are of the same cost. But the first time the movie arrives it stays as a different genre called "New RElease" and it is placed in a different location and priced differently. It stays that way for x number of days and after that it goes back to its corresponding genre.Each customer can take out any number of movies at a time. We need to store the due date for all those movies.
Design a software with class diagrams for this. This was asked in the first round telephonic interview.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersWhy do we need abstract classes?
- Raady October 18, 2008| Report Duplicate | Flag | PURGE
Aricent Software Engineer in Test Object Oriented Design - 0of 0 votes
AnswersDesign a File system for windows or linux machine. Use OO concepts.
- Anonymous October 07, 2008| Report Duplicate | Flag | PURGE
Object Oriented Design - 0of 0 votes
AnswerDesign the datastructures for an online book reader system.
- tilo1583 September 25, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 1of 0 votes
AnswersOOP Concept - He wanted me to design a player playing a card game.
- Metallicatony September 10, 2008
My Ans: I explained how a card class can be created with its properties like - Value of a card, Sign of card
Then i explained a class for a player.
He asked - how i will represent a player holding a set of cards.
My Ans: I told that player is a different class and card is a different type of class as explained. And a card's properties can be inherited to a player's class and can be used to represent "a player holding a set of cards.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersBasic OO Concepts.
- Xenith September 06, 2008
- what is OO ?
- Features ?
- Polymorphism
- How it is resolved?
- static methods/ variables in class
- overriding & how is it resolved ? (Virtual methods )
- operator overloading ?
- inheritance ?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design Terminology & Trivia - 0of 0 votes
AnswerWhat is a singleton?
- Anonymous August 30, 2008| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design Terminology & Trivia - 2of 0 votes
AnswersDesign for card game where you have a deck, cards, players. This was straight from Career Cup.
- hipy16 July 22, 2008
I had given a simpler design first with no factory pattern. He extended the problem to have functionality for creating some different kinds of decks also. So I introduced Factory pattern in my design.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersWhat are the different features of OO programming? Explain encapsulation, polymorphism, inheritance.
- himanshu July 17, 2008
What is multiple inheritance? Is it possible in Java? What is the work around for this in Java? How is it implemented?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design Terminology & Trivia - 5of 5 votes
AnswersHad my first and second phone interview with Amazon. I was dropped. This site has been a great help towards my preparation and most questions are based on what you find here.
- S July 01, 2008
Posting my Questions is a small way of saying Thanks!
Interview 1:
1. What is polymorphism.
2. Design an OO parking lot. What classes and functions will it have. It should say, full, empty and also be able to find spot for Valet parking. The lot has 3 different types of parking: regular, handicapped and compact.
3. Coding: I have an integer array where every number appears even number of times and only one appears odd times. Find the number.
(I said hashtable and he asked me to write code with Hashtable)
4. What data structure would you use to look up phone numbers for customer names.
(I said Hashtable. Asked why hashtable, why not a tree. I said HT has O(1). Asked is order always 1, when more than O(1) in HT.
Second Interview:
1. Starter: Describe your college projects.
2. OO Design: Design a deck of cards. What classes, data structures will you use? How will you shuffle the cards? How will you divide (deck) among players. What class/function do you need to denote players and where will you add them? What class/function do you need to deck? What if I need to add 2 jokers to the deck of 52 cards.
3. Data Structures: How will you use a hashtable to find data in a tree. (Then he rephrased) suppose I have a hashtable, I want to store the data in a tree instead of a bucket. How will I do it. What complexity to find an element.
4. Bits & Bytes: Find if a binary representation of a number is palindrome. The function should work irrespective of number of bytes for an integer. Suppose if our machine is 4 bytes for an int, how will you use the program for 8 byte machine.
5. Unix: Suppose I have 100's of html files in many directories. I want to find the files having phone numbers.
b) Suppose I have 2 files having phone numbers, find the repeating phone numbers. (I said sort and grep). Then he asked what if the lines cannot be sorted.
All the best guys. I think the second interview was challenging since the interviewer was prodding until he heard a leave me alone. So it means that though they are based on questions in cc, be prepared for extensions. I think this site is all you need to prepare for Amazon interview.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java Data Structures Object Oriented Design Coding