Wasn't expecting a pure OOD question in a Bar Raiser for an ML role.
Start by clarifying requirements and scale, then outline the core objects (Advertiser, Campaign, Ad, Metric) and their relationships, and finally discuss how ML models consume these metrics for optimization. Emphasize extensibility, data quality, and real-time processing.
Pro tip: Show awareness of Amazon's scale and the need for near-real-time metrics by mentioning streaming architectures (e.g., Kinesis) and the trade-offs between batch and stream processing. Also, highlight how your design supports ML feedback loops for bid optimization.
Ask about scale (number of advertisers, ads, events per second), latency requirements (real-time vs batch), and key metrics (impressions, clicks, conversions). This ensures the design meets business needs.
Define classes like Advertiser, Campaign, Ad, and Metric, and their associations (e.g., Advertiser has many Campaigns, Campaign has many Ads). Use inheritance for different ad types if needed.
Specify how metrics are collected (e.g., event streams), stored (time-series DB), and aggregated (e.g., daily, hourly). Discuss data partitioning and indexing for fast queries.
Explain how ML models consume metrics for tasks like click-through rate prediction, budget pacing, and anomaly detection. Highlight feedback loops where model outputs influence ad serving.
Discuss horizontal scaling, fault tolerance, and data consistency. Mention trade-offs between consistency and availability (CAP theorem) and how to handle late-arriving data.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.