Aarav Sharma
Debugging & Algorithmic Challenge Assessment ReadyResume Skill Evidence Analysis
Extracted from Aarav Sharma's parsed resume and benchmarked against Senior Python & AI Developer
Debug & Optimize: API Deduplication & Rate Limiting (Artificial Intelligence)
You are onboarding as a Senior Python & AI Developer at Talentora. Our public API gateway processes bursty transaction streams. A junior developer implemented an event deduplication and rate limiter, but production reports reveal two critical bugs: 1. Events with duplicate IDs within the same batch are not deduplicated. 2. Records with a missing or `None` amount crash with an unhandled exception instead of defaulting to 0.0.
Deliverable Requirements:
- Inspect the `process_and_deduplicate_events(events, max_limit)` function.
- Fix Bug 1: Ensure each unique `event_id` is processed only once. Skip duplicates without raising errors.
- Fix Bug 2: Gracefully handle records where `amount` is `None`, missing, or negative (default amount to 0.0).
- Ensure total processed events per client does not exceed `max_limit`.
- Return a structured result dict: `{'processed_count': int, 'unique_clients': list, 'total_amount': float, 'duplicate_count': int}`.
Measurable Evaluation Criteria & Weights
Architectural Follow-up Questions
Answer the questions below to evaluate design trade-offs, edge-case mitigation, and scalability.