Challenge - 5 Problems
Library System Design Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Identify the correct relationship between classes
In a library system, which relationship best describes how the Loan class relates to the Book and Member classes?
Attempts:
2 left
💡 Hint
Think about whether Loan should control the existence of Book or Member objects.
✗ Incorrect
Loan represents a borrowing event and references existing Book and Member objects without owning them. Hence, it has an association relationship.
❓ Architecture
intermediate1:30remaining
Choose the best class to handle book availability status
In the library system, which class should be responsible for tracking whether a book is currently available for loan?
Attempts:
2 left
💡 Hint
Consider which class naturally owns the state of the book itself.
✗ Incorrect
The Book class represents the physical or digital book and should maintain its own availability status.
❓ scaling
advanced2:00remaining
Design consideration for handling thousands of loans
If the library system must handle thousands of simultaneous loans, which design choice improves scalability and performance?
Attempts:
2 left
💡 Hint
Think about memory usage and data retrieval efficiency for large data.
✗ Incorrect
Using a database allows efficient storage and querying of large numbers of loans without overloading memory.
❓ tradeoff
advanced1:30remaining
Tradeoff in making Member class responsible for loan history
What is a potential downside of storing all loan history inside each Member object?
Attempts:
2 left
💡 Hint
Consider what happens when a member has a very long loan history.
✗ Incorrect
Storing all loan history in memory per member can consume a lot of memory and reduce scalability.
❓ component
expert2:00remaining
Identify the correct sequence of actions when a book is loaned
What is the correct order of actions when a member borrows a book from the library?
Attempts:
2 left
💡 Hint
Think about the logical order to ensure the book can be loaned before creating records.
✗ Incorrect
First check availability, then create loan, update status, and finally notify member.
