Design a user activity tracking system for user on mobile.
MediumImagine you're building a user activity tracking system for a mobile application. The goal is to capture various user activities within the app (e.g., screen views, button clicks, purchases, search queries) and persist them for later analysis. This tracking system should be robust, efficient, and easy to extend with new activity types without requiring major code changes. We want to avoid sending redundant data and minimize battery drain while capturing useful user behavior.
This problem focuses on the core in-app tracking mechanism and its storage, not the backend infrastructure for receiving and processing the data. We assume a simplified persistence layer (e.g., in-memory, local file storage) for demonstration purposes.
Requirements
Think like an Architect
Before revealing the requirements, imagine you're in the interview right now."How would you clarify the scope with your interviewer?"