Amazon Interview Question
Software Engineer / DevelopersGuys, this is not a algorithm question, this is a OOD question.
Don't even try to think which algorithm the elevators use.
You only need to specify classes and their interactions.
rgvsdep , <a href=http://www.cs.virginia.edu/~skadron/wiki/hotspot/index.php?title=User:Buy_viagra&oldid=1388#1>buy generic viagra</a> vcood.%$#@ , <a href=http://www.cs.virginia.edu/~skadron/wiki/hotspot/index.php?title=User:Buy_phentermine&oldid=1390#1>buy phentermine no prescription</a> iygy , <a href=http://www.cs.virginia.edu/~skadron/wiki/hotspot/index.php?title=User:Buy_levitra&oldid=1392#1>buy levitra online</a> qcopp , <a href=http://www.cs.virginia.edu/~skadron/wiki/hotspot/index.php?title=User:Buy_meridia&oldid=1394#1>cheap meridia</a> 68458 , <a href=http://www.cs.virginia.edu/~skadron/wiki/hotspot/index.php?title=User:Buy_prozac&oldid=1396#1>fluoxetine prozac</a> jhg$# , <a href=http://www.cs.virginia.edu/~skadron/wiki/hotspot/index.php?title=User:Buy_soma&oldid=1398#1>buy soma online</a> 55 , <a href=http://www.cs.virginia.edu/~skadron/wiki/hotspot/index.php?title=User:Buy_tramadol&oldid=1400#1>buy tramadol now</a>
Elevator :
Responsibilities - no. of passengers aboard,destination floors,state & direction,current floor
Methods - load/unload passengers, current floor/passengers/dir/state
Attributes - passengers, floor, dir, state, elevator_id
Passenger :
Res - keeps track of the destination floor
Mds - current_destination
Att - destination_floor
Observer :
Res - keeps track of the passengers entering & leaving the elevator
Mda - total_entry/exit_passengers,passenger_enter/exit
Att - total_entry/exit_passengers
We can just model the above info. with the help of OOPs concepts
SOA presents the big picture of what you can do with Web services. Web services specifications define the details needed to implement services and interact with them. However, SOA is an approach to build distributed systems that deliver application functionality as services to end-user applications or to build other services. SOA can be based on Web services, but it may use other technologies instead. In using SOA to design distributed applications, you can expand the use of Web services from simple client-server models to systems of arbitrary complexity.
Thus, individual software assets become the building blocks to develop other applications. You can reduce the complexity of systems by using a common style of interaction that works with both new and legacy code (Lawrence Wilkes, of CBDi, has joked that SOA could stand for “Save Our Assets" ). There is a standard way of representing and interacting with these software assets; now the focus shifts to application assembly based on these building blocks.
While discussing SOA for business applications here, SOA is also being used for other distributed systems such as grid computing and advanced Web services specifications (for example, WS-DistributedManagement, WS-Trust, and UDDI).
I think all elevators follow what is known as elevator algorithm.
- acoader November 23, 2008The elevator goes up until all ups - which include calls from up and requests to up by the people picked up are served. After the highest up is served, the elevator goes in the other direction, until the lowest down is served, and this repeats.