← Uber Interview Insights

Uber·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorRejected
May 2026

Summary

Uber advertising team interview for a senior software engineer role. The question was a system design problem I'd never seen anywhere in my prep, which was both annoying and kind of refreshing. Solved it, felt decent about the communication, still got rejected.

Questions Asked (1)

Q1

Design a last-click attribution system. There are two event types: a click event (with timestamp, userId, campaignId) and a conversion event (with timestamp, userId). For each conversion, attribute it to the most recent click from the same user where the click falls within a fixed time window before the conversion. Implement recordClick, recordConversion, getCampaignConversions, and getUserAttribution. You also need to write and run your own tests.

System DesignAPI & IntegrationsAlgorithms & Data Structures
Author's notes

None of my prep covered this.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then design the data structures and algorithms for efficient attribution. Implement the methods with careful handling of edge cases like multiple clicks and conversions, and write comprehensive tests to validate correctness and performance.

Pro tip: Discuss trade-offs between different data structures (e.g., hash maps vs. sorted lists) and consider how to handle out-of-order events or late-arriving data, as this demonstrates real-world maturity.

1. Clarify Requirements and Constraints

Ask about the time window duration, expected scale (number of users, clicks, conversions), and whether events can arrive out of order. Confirm the definition of 'most recent click' and how to handle ties.

2. Design Data Structures

Choose data structures to store clicks per user (e.g., a list sorted by timestamp) and conversions per user. Consider using a map from userId to a sorted list of clicks, and a map from userId to a list of conversions. For campaign conversions, maintain a counter per campaign.

3. Implement Core Methods

Implement recordClick and recordConversion to append events. For getCampaignConversions, return the count for a campaign. For getUserAttribution, for each conversion, find the latest click within the window using binary search or linear scan from the end, and attribute accordingly.

4. Handle Edge Cases and Optimizations

Consider cases like no clicks, clicks outside window, multiple conversions, and out-of-order events. Optimize by pruning old clicks or using efficient search. Discuss time/space complexity.

5. Write and Run Tests

Write unit tests covering basic scenarios, edge cases, and performance. Run tests to ensure correctness and discuss any failures or improvements.

Key Points to Mention

  • Time window handling: ensure clicks are within the fixed window before conversion.
  • Data structures: use hash maps for O(1) user lookup and sorted lists for efficient latest click retrieval.
  • Attribution logic: for each conversion, find the most recent click from the same user within the window.
  • Campaign conversion counting: maintain a counter per campaign, increment when a conversion is attributed.
  • Edge cases: no clicks, clicks outside window, multiple clicks, out-of-order events, and late conversions.
  • Testing: cover normal cases, boundary conditions, and performance with large datasets.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.