Object Oriented Design Interview Questions
- 0of 0 votes
AnswersDescribe the Flyweight and Visitor design pattern with example
- mst September 22, 2019 in India| Report Duplicate | Flag | PURGE
Qualcomm Software Engineer / Developer Object Oriented Design - 0of 0 votes
AnswersImplement a comparator class that is capable of sorting by multiple key/order pairs, each pair being a tiebreaker for the previous.
- neer.1304 July 28, 2019 in United States| Report Duplicate | Flag | PURGE
Stripe Software Engineer Object Oriented Design - 0of 0 votes
AnswersWe have a quote file with millions of entries. Design a system to read from the system and return a random quote always with O(1) time. We can read the file once and can keep in memory but should not re read the same. Also when you restart your system, it should preserve and work with O(1) complexity.
- johnsvakel March 26, 2018 in India| Report Duplicate | Flag | PURGE
Adobe Data Scientist Large Scale Computing Math & Computation Object Oriented Design - 0of 0 votes
AnswersBasic sales tax is applicable at a rate of 10% on all goods, except books, food, and medical products that are exempt. Import duty is an additional sales tax applicable on all imported goods at a rate of 5%, with no exemptions.
- GUL MD ERSHAD November 05, 2017 in India
When I purchase items I receive a receipt which lists the name of all the items and their price (including tax), finishing with the total cost of the items, and the total amounts of sales taxes paid. The rounding rules for sales tax are that for a tax rate of n%, a shelf price of p contains (np/100 rounded up to the nearest 0.05) amount of sales tax.
Write an application that prints out the receipt details for these shopping baskets.
Input:
1) 1 book at 12.49
2) 1 music CD at 14.99
3) 1 chocolate bar at 0.85| Report Duplicate | Flag | PURGE
ThoughtWorks Senior Software Development Engineer Object Oriented Design - 1of 1 vote
AnswersDesign a system for a parking lot where drivers can also have memberships (but also support guest drivers). The parking lot has counter screens on each row.
- ahmedthehack June 23, 2017 in UK for Amazon Video| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 3of 3 votes
AnswersDesign backend system for bookMyShow.com like system which supports below use cases:
- Priyanka March 29, 2017 in India
1) When user selects cities, list of cities is displayed.
2) When user selects city, movie list is displayed.
3) When user selects movie, list of theatre is displayed.
4) When user selects theatre, show timing is displayed.
5) When show timing is selected, user is asked for no of seats that he wants to book
6) When user selects no of seats, seats are displayed to choose from.
7) When user selects seats, then total price is displayed.
8) When total price is selected, then user is directed to payment gateway and payment is done and on payment success, ticket is mailed to him.
More questions on how can we scale the system, and handle concurrent users request for same seat etc.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - 0of 0 votes
AnswersDesign Amazon Recommendations Feature. Focus on designing how would you store and make it accessible fast? What would be class design like for the class which would provide list of products which people bought similar to a given product? How would you test that class?
- Anonymous February 07, 2017| Report Duplicate | Flag | PURGE
Amazon SDE-2 Data Structures Database Object Oriented Design - 0of 0 votes
AnswersI had one hour to write a simple object oriented java program of Student registration and de registration to a course . A particular course has some max slots that can be allocated to students . Question was simple enough but due to time constraint could not complete .Godspeed
- Hermione February 01, 2017 in United States| Report Duplicate | Flag | PURGE
Allegient Java Developer Object Oriented Design - 0of 0 votes
AnswersObject Oriented Design Problem
- tushar.1738 January 22, 2017 in India
--------------------------------
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.
Use Case:
1. Customer are given a ticket that they can use to redeem to get their vehicle back
2. Parking spots come in three sizes, small, med, large
3. Thee types of vehicles, small[Two Wheeler], med[Car], large[Bus]
-a small vehicle can park in a small, medium, and large spot
-a medium vehicle can park in a medium and large spot
-a large vehicle can park in a large spot
4. There are multiple entry gate to park vehicle. So Vehicle should asign nearest posible parking spot| Report Duplicate | Flag | PURGE
Coding Java Object Oriented Design - 0of 0 votes
AnswersCreate a RESTful microservice that implements a card shuffling algorithm, as defined below. Should have evidence of test-driven development with unit tests. Use best practices of interfaces and generics for abstraction, preferably implementing a strategy pattern for deploy-time dependency injection of a shuffling algorithm.
- dbs.tkg December 11, 2016 in United States
Requirements:
· Create a microservice that stores and shuffles card decks.
· A card may be represented as a simple string such as “5-heart”, or “K-spade”.
· A deck is an ordered list of 52 standard playing cards.
· Expose a RESTful interface that allows a user to:
· PUT an idempotent request for the creation of a new named deck. New decks are created in some initial sorted order.
· POST a request to shuffle an existing named deck.
· GET a list of the current decks persisted in the service.
· GET a named deck in its current sorted/shuffled order.
· DELETE a named deck.
· Design your own data and API structure(s) for the deck.
· Persist the decks in-memory only, but stub the persistence layer such that it can be later upgraded to a durable datastore.
· Implement a simple shuffling algorithm that simply randomizes the deck in-place.
· Implement a more complex algorithm that simulates hand-shuffling, i.e. splitting the deck in half and interleaving the two halves, repeating the process multiple times.
· Allow switching the algorithms at deploy-time only via configuration.| Report Duplicate | Flag | PURGE
N/A Senior Software Development Engineer Java Object Oriented Design - 2of 2 votes
AnswersDesign OO food delivery app catering to use cases -
- neer.1304 December 06, 2016 in United States
1) User can search different restaurant
2) User can select a restaurant
3) User sees a menu
4) Restaurant can change the menu any time
5) User adds an item from menu
6) User orders the food
7) User can track the order in real time
8) User can cancel the order
9) User pays for the order| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - 0of 0 votes
AnswersDesign food delivery app (OO design). Cater to use cases like search for different restaurants, selecting a restaurant, select an item from menu, menu can be updated in real time by restaurant, order the food, customer keeps track of the order in real time, payment for the order, cancel the order etc.
- neer.1304 December 06, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - 0of 0 votes
AnswersDesign Uber low level OO design. Cater to use cases like search for a ride, different category of rides, select a ride, registration for a user and driver, paying for ride etc.
- neer.1304 December 06, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - 0of 0 votes
AnswersThere 'N' different types of routers and 'J' different types of jobs to be performed on all these routers. Design a system wherein user could easily perform these jobs on these routers.
- rsk November 14, 2016 in India
Ex- Say two types of routers are - DLink , Netgear. If user wants to change the IP address (a job), DLink exposes a public API to do it. NetGear needs the data in form of xml.
Was asked to design Entities involved and their communications, basic algorithm, data-storage logic if any.| Report Duplicate | Flag | PURGE
Amazon Software Development Manager Object Oriented Design - 0of 0 votes
AnswerAs you know, every OS comes up with this tiny application called the calculator. It is good. Now, here is our problem. If we try to implement the function
def calculate( operand, operator, operand ) { /* Do Interviewers bidding here */ }
I have to write if upon if upon if upon if to do for all operators. Moreover, some operators are not even binary! Take example the abs() or say the negate()!
- NoOne October 14, 2016 in India
Bigger problem persists. With the if mode, we can not even add operators as we wish to without changing code!
But that is a sin. So, what do we do? That is question 1.
In question 2, as a software tester, how do you propose to test and automate the above? Writing more if than the developer is not allowed.| Report Duplicate | Flag | PURGE
SDET Algorithm Data Structures Object Oriented Design Programming Skills Software Design - 0of 0 votes
AnswersDesign the classes for a Battleship Game. Write the attack function.
- Ray October 04, 2016| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - 0of 0 votes
AnswersYou are designing the client side of a Survey website. Provide the list of classes and methods you will use to break the problem down. Also, provide the API interaction with server.
- andy.r.nathan September 18, 2016 in United States| Report Duplicate | Flag | PURGE
Linkedin Senior Software Development Engineer Object Oriented Design - 0of 0 votes
AnswersDesign a rules engine. It should run in at least linear time and should efficiently handle repetitive attributes in different rules. E.g.,
- angshu1986 September 18, 2016 in India
Attributes:
1. Digit check
2. Character check
Rule:
1. Rule 1 - input should be digit
2. Rule 2 - input should be digit and = 3
3. Rule 3 - input should be digit and between 2 and 5
4. Rule 4 - input should be character and value should be 'A'
5. Rule 5 - input should be character and value should be 'B'
Design rule matrix and process a stream of inputs. More than one rule may be applicable for a given input.| Report Duplicate | Flag | PURGE
JP Morgan Java Developer Algorithm Object Oriented Design - 0of 0 votes
AnswersDesign a HTTP response service that will allow sync and async download. What classes would you create and the methods used with paramerters and return types.
- MM September 10, 2016 in United States| Report Duplicate | Flag | PURGE
Facebook Software Developer Object Oriented Design - 1of 1 vote
AnswersDesign a deck of cards that can be used for different card game applications.
- gurunathchoukekar August 17, 2016 in United States for AWS
Please code out what you would need for the deck class and a card class.
Implement a deal method.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - 3of 3 votes
AnswersA program stores total order numbers arrived at different time. For example, at 1.15 pm the program got 15 order, at 1.30 pm, the program got 20 order and so on.Now we need to design the data structure so that we can query the total orders we got in a time range efficiently. For this example, we can query as How many orders we have got between 1 and 2 pm? Ans will be 15+ 20 = 35
- gadha July 21, 2016 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Data Structures Java Object Oriented Design - 0of 0 votes
AnswersBuild an in-memory DB that supports many commands and transactions.
- adch123 May 25, 2016 in United States
Similar to redis database (Redis.io)| Report Duplicate | Flag | PURGE
Database Java Object Oriented Design Software Design - 4of 4 votes
AnswersDesign and implement the constructor for the minesweeper game that takes in the dimension of the field and number of mines as input
- JSDUDE September 24, 2015 in United States| Report Duplicate | Flag | PURGE
Tableau Software Engineer / Developer Algorithm Object Oriented Design - 0of 0 votes
AnswersDesign a system java same as relational database.
For example,
You Have employee table as bellow:ID | Name | Manager | Salary
Now you can execute queries like :
select * from Employee where ID= ' something' select * from Employee where Name= ' something' select * from Employee where salary = ' something'
In same way you have a class Emplyee as bellow:
class Employee { String ID; String Name; String Salary; String Manager; }
Now I want to query on this class as same as the sql queries above,
- Ghosh August 17, 2015 in India
How can I do it efficiently?
The code should be optimized on time complexity and space complexity.| Report Duplicate | Flag | PURGE
Oracle Software Architect Algorithm Data Structures Java Object Oriented Design - 2of 2 votes
AnswersModel a restaurant reservation system, where staff can a reservation, pull up, cancel reservations. The reservation system is very simple local to just one terminal at the restaurant not connected to network.
- soumi July 27, 2015 in United States for Echo| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Object Oriented Design - 0of 0 votes
AnswersWrite an OO class system for individual-contributors, managers, directors.
- JSDUDE June 23, 2015 in United States for Customer experience| Report Duplicate | Flag | PURGE
Walmart Labs Software Developer Object Oriented Design - 0of 0 votes
Answerswhat's use of equals and hashcode function?
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Coding Hash Table Java Object Oriented Design - -1of 1 vote
Answervector vs arraylist
- Tom Walker June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Ebay Software Developer Coding Java Object Oriented Design