Design a low-level audit system for tracking user actions?

System Design
Hard
Microsoft
143.8K views

This LLD question tests your ability to design a modular, extensible system for logging and auditing events.

Why Interviewers Ask This

Audit systems are critical for security and compliance. Interviewers assess your design patterns, error handling, and ability to create scalable logging architectures that don't impact system performance.

How to Answer This Question

Define interfaces for different event types. Use an observer pattern to notify listeners. Design a storage layer that supports high write throughput. Ensure immutability of records and secure access controls.

Key Points to Cover

  • Event interface design
  • Observer pattern usage
  • Write-ahead logging
  • Security and access control

Sample Answer

I would design an AuditSystem with an Event interface for different action types. An EventPublisher would dispatch events to registered Auditors. Storage would use a write-ahead log for durability. I'd implement strict access controls and encryption for sensitive data. The system should support querying by user, timestamp, and action type.

Common Mistakes to Avoid

  • Tight coupling between modules
  • Ignoring performance bottlenecks
  • Lack of data retention policy

Practice This Question with AI

Answer this question orally or via text and get instant AI-powered feedback on your response quality, structure, and delivery.

Start Practicing

Related Interview Questions

Browse all 165 System Design questionsBrowse all 95 Microsoft questions