Design a Resource Management System

Difficulty: EASYCategory: DSAFrequency: 1Asked On 2023-12-15

Problem Statement

Design an object-oriented Resource Management System for an organization. The system should allow managing resources (like meeting rooms, devices, or vehicles), and allow employees to book, release, and view resource availability.


✅ Functional Requirements:

1. User Management

•There are two types of users: Admin and Employee.
•Admin can add or remove resources.
•All users can search for and book resources.

2. Resource Types

•Resources can be of different types: e.g., Meeting Room, Projector, Laptop, Car.
•Each resource has:
•Unique ID
•Type
•Location (for physical resources)
•Availability status

3. Booking System

•Users can:
•View available resources
•Book a resource for a given time window (start time, end time)
•Cancel a booking
•The system should prevent double-booking.

4. Search & Filter

•Users can search resources by type and location.
•Admins can see all current and future bookings.

5. Audit Logs (Optional Stretch)

•Maintain a log of all actions (book, cancel, release) with timestamps.


🧱 Core Classes to Design:

You are expected to design classes such as:

•User (base class), Admin, Employee
•Resource
•Booking
•BookingManager or ResourceManager
•SearchService (optional)
•AuditLog (optional)

⚙️ Constraints:

•No need for UI or database – keep it in memory.
•No concurrency or multi-user sessions for now.
•Booking should handle time ranges accurately.


🧪 Example Use Case:

1plaintext 2CopyEdit 3- Admin adds Meeting Room MR101 and Projector PR202 4- Employee Alice searches for available meeting rooms from 2 PM to 3 PM 5- Alice books MR101 for that slot 6- Bob tries to book MR101 for the same slot — the system rejects the request 7- Alice cancels her booking — MR101 becomes available again

🚫 Out of Scope (for LLD):

•Persistence in databases
•Authentication/authorization
•Integration with calendar/email systems
•Notification systems


Solution

Comments