Design the Aarogya Setu app

Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2021-03-24

Problem Statement

Design a contact tracing and health monitoring application (like Aarogya Setu) that helps users track COVID-19 exposure risk, get health updates, and provide notifications about nearby infections. The system should handle privacy, location tracking, health data collection, and risk scoring at scale.


Functional Requirements (FR)


1.User Management
•Register users via phone number or email.
•Maintain user profiles including age, health status, and location preferences.
2.Location & Proximity Tracking
•Track user proximity using Bluetooth and GPS.
•Store anonymized contact logs.
•Identify close contacts with infected individuals.
3.Health Status Management
•Users can self-report symptoms or COVID-19 test results.
•Update health status to authorities in anonymized form.
4.Risk Scoring & Notifications
•Calculate user risk score based on proximity to infected individuals, travel history, and health reports.
•Notify users if they were near a high-risk individual.
•Provide guidelines or recommendations based on risk score.
5.Exposure Alerts
•Send alerts for potential exposure while maintaining privacy.
•Enable quarantine and testing recommendations.
6.Government & Health Authority Integration
•Provide anonymized statistics and heatmaps.
•Share aggregated data for public health monitoring.
7.Data Privacy & Security
•Ensure personal data is encrypted and anonymized.
•Comply with local privacy regulations.


Non-Functional Requirements (NFR)


•Scalability – Support millions of users simultaneously.
•Availability – App should function 24/7 with low latency for alerts.
•Security & Privacy – End-to-end encryption, anonymization, and secure storage.
•Accuracy – Accurate risk scoring and proximity detection.
•Extensibility – Ability to integrate new health guidelines or update algorithms.


Core Components


1.Mobile Client App
•Location & Bluetooth tracking.
•User interface for health reporting, notifications, and alerts.
2.Backend Services
•User Service: Stores user profiles and preferences.
•Contact Tracing Service: Calculates exposure risk using proximity data.
•Health Status Service: Collects symptom reports and test results.
•Notification Service: Sends alerts and recommendations.
3.Database & Storage
•Store anonymized contact logs, health reports, and risk scores.
•Support fast retrieval for risk calculation and notifications.
4.Analytics & Dashboard
•Provide aggregated statistics, heatmaps, and reports to authorities.
5.Security & Privacy Layer
•Data encryption at rest and in transit.
•Anonymization and tokenization of user identities.


Data Flow


1.User app collects location/Bluetooth proximity → sends anonymized logs to backend.
2.Health status updates submitted → backend updates risk scores.
3.Contact tracing service processes logs → calculates exposure risk.
4.Notification service sends alerts to affected users.
5.Aggregated anonymized data → analytics dashboard for authorities.


Design Considerations


1.Privacy
•Use anonymized IDs instead of personal information for contact logs.
•Encrypt sensitive data in transit and at rest.
2.Scalability
•Partition users and contact logs by region.
•Use distributed databases or message queues for high throughput.
3.Accuracy & Efficiency
•Minimize false positives/negatives in risk scoring.
•Optimize proximity detection using Bluetooth RSSI and GPS filtering.
4.Trade-offs
•Privacy vs detailed contact tracing.
•Accuracy vs battery consumption on mobile devices.
•Real-time updates vs network/data usage constraints.


✅ This HLD problem tests:


•Designing large-scale mobile and backend systems
•Handling sensitive data securely and privately
•Integration of analytics, notifications, and real-time processing
•Scalability and reliability for nationwide apps


Solution

Comments