Yahoo Interview Question
Software Engineer / DevelopersOk, lets try to follow the following steps
analysis:
1. problem statement in detail
2. use-cases as per problem statement
design:
3. identifying classes/objects out of use-cases
4. identifying interactions among classes/objects
5. identifying attributes of classes/objects
6. refining with hierarchies of classes/objects
implementation:
7. introducing dynamic modeling
1. problem statement in detail
Chat servers allows users to send message to other users and receives messages from other users.
Each user could have user account on chat server or can chat with guest login. The user account on chat server should allow users to manage his/her contacts.
Allowing to store chat history could be extra feature.
User should be able to login and logout.
User should be able to change his/her online status.
2. use-cases at detail
-User registers for his account
-User logs in with his credentials
-User adds/edits/deletes contacts
-User sends message to his contact
-User receives message from his contact
-User logs out of the server
Server side:
-User account added to account-list
-User credentials verified while logging in and session created if success
-User contacts are managed with three operations addition, deletion, modification
-User message is queued in his contacts message queue
-User is delivered message from his queue if any
-User session is deleted
3. identifying classes/objects by using use-cases
Account
Account-List
Session
Contacts
Message
Message-Queue
Contacts-Operation
2. use-cases at detail
- spiderman December 16, 2012-User registers for his account
-User logs in with his credentials
-User adds/edits/deletes contacts
-User sends message to his contact
-User receives message from his contact
-User logs out of the server
Server side:
-User account added to account-list
-User credentials verified while logging in and session created if success
-User contacts are managed with three operations addition, deletion, modification
-User message is queued in his contacts message queue
-User is delivered message from his queue if any
-User session is deleted