Design Course Registration System
| Difficulty: Hard | Source: awesome-low-level-design |
Requirements
- Students register for courses, view registered courses
- Course: code, name, instructor, max capacity
- Search by code or name
- Block registration at max capacity
- Handle concurrent registrations
- Data consistency, prevent race conditions
- Extensible
Class Diagram

Classes, Interfaces and Enumerations
| Class/Interface | Description |
|---|---|
| Student | Id, name, email, registered courses list |
| Course | Code, name, instructor, max capacity, enrolled count |
| Registration | Student, course, timestamp |
| CourseRegistrationSystem | Singleton; ConcurrentHashMap + CopyOnWriteArrayList; synchronized registerCourse |
Design Patterns Used
| Pattern | Application |
|---|---|
| Singleton | CourseRegistrationSystem ensures a single point of coordination for all registration operations |
| Observer | Placeholder for future notification support (e.g., notifying students when a seat opens) |
Code Implementations
| Language | Source Code |
|---|---|
| Java | View on GitHub |
| Python | View on GitHub |
| C++ | View on GitHub |
| C# | View on GitHub |
| Go | View on GitHub |