Design a Ride Sharing App (focus on Monolithic APK-based design, not distributed systems)

Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2024-11-19

Problem Statement

Design a ride-sharing mobile application (similar to Uber/Ola) where the focus is on a single monolithic APK design rather than distributed microservices. The app should allow users to book rides, track drivers, and make payments, while drivers should be able to accept/reject rides and view navigation details.


Key Requirements:


1.User Features (Riders)
•Sign-up/login and profile management.
•Search for nearby drivers and request a ride.
•Real-time ride tracking (driver location on the map).
•Fare estimation before booking.
•In-app payments (wallet, card, cash option).
•Ride history (past bookings).
2.Driver Features
•Sign-up/login and vehicle registration.
•Accept/reject incoming ride requests.
•Live ride navigation (integrated map).
•Daily earnings summary.
3.System Components (inside monolithic APK)
•Authentication & User Management: Shared login system for riders & drivers.
•Ride Matching Engine: Simple nearest-driver allocation logic running on the client (since monolithic).
•Maps & Location Service: GPS-based tracking, route calculation (using third-party SDKs).
•Payments Module: Integrated within app (supports wallet + external gateway APIs).
•Notification System: In-app and push notifications for ride updates.
•Database Layer (local + remote sync):
•Store users, rides, payments, driver availability.
•SQLite for offline caching; sync with central backend when online.
4.Constraints & Considerations
•Since monolithic APK, all core services (ride matching, tracking, payments) are bundled into a single application.
•Offline support for pending rides (sync later).
•Performance optimizations: low-latency map updates, battery optimization for GPS.
•Scalability not through microservices, but efficient in-app modularization.
5.Non-Functional Requirements
•Secure authentication & payments (basic encryption).
•Smooth UI/UX with minimal lag.
•Reliability in flaky network conditions.
•Code maintainability via modular packages within APK.


Solution

Comments