Design Progress Bar Functionality
Problem Statement
Design a Progress Bar System that visually and programmatically tracks and displays the progress of long-running operations (like file uploads, downloads, data processing, or report generation) in real-time.
This problem assesses your ability to design responsive, observable, and scalable system components that handle real-time progress updates across distributed systems or applications.
🧾 Context
Modern applications frequently involve long-running tasks — such as:
Users expect to see real-time progress feedback on these tasks, improving user experience and system observability.
You need to design a Progress Bar Service that:
📋 Functional Requirements
⚙️ Non-Functional Requirements
AttributeDescription
Scalability
Should support thousands of concurrent progress-tracked tasks.
Reliability
Progress updates must not be lost even during transient network failures.
Low Latency
Real-time updates should reflect quickly in the UI (<1s lag).
Extensibility
Easy to add support for new update mechanisms or notification channels.
Persistence
Must persist progress state for recovery after restarts.
🧱 High-Level Architecture Components
🧩 Example Architecture Diagram (Textual)
1
2[Client/UI] <--> [API Gateway]
3 |
4 [Progress Service]
5 |
6 --------------------------------
7 | |
8 [Cache Layer] [Database]
9 |
10 [Task Worker(s)] ---> [Message Queue] ---> [Progress Service Updates]🧠 Data Model Example
FieldTypeDescription
taskId
UUID
Unique identifier for the task
status
Enum(Pending, Running, Completed, Failed)
Task lifecycle state
progress
Float
Percentage completion (0–100)
message
String
Optional message (e.g., “Uploading file 3/10”)
lastUpdated
Timestamp
Last progress update time
errorMessage
String
Optional error message if failed
🔄 Flow of Execution
📡 Example API Design
MethodEndpointDescription
POST
/tasks
Create/register a new task
POST
/tasks/{taskId}/progress
Update progress percentage
GET
/tasks/{taskId}
Retrieve current status/progress
WS
/tasks/{taskId}/subscribe
Subscribe for real-time updates
⚙️ Technology Choices
LayerOptions
Backend
Node.js, Spring Boot, Go
Storage
PostgreSQL, DynamoDB, MongoDB
Cache
Redis
Pub/Sub
Kafka, RabbitMQ, Redis Streams
Real-time updates
WebSocket, SSE, gRPC streams
Frontend
React/Vue/Angular (Progress Bar UI component)
📊 Scalability Considerations
🚀 Future Enhancements
💬 Discussion Points for Interview