Compute Pro Response-Time Badges From Message Threads
Last updated: November 29, 2026
Quick Overview
Given message events (request id, pro id, sender, timestamp), award a fast-responder badge to each pro whose median first-reply time is at most 60 minutes, whose reply rate is at least 80%, and who has at least 5 customer-initiated threads.
Thumbtack
November 29, 20260
0
0 solved
Given message events (request id, pro id, sender, timestamp), award a fast-responder badge to each pro whose median first-reply time is at most 60 minutes, whose reply rate is at least 80%, and who has at least 5 customer-initiated threads.
Thumbtack surfaces pro responsiveness to customers because a fast reply strongly predicts a hire. This exercise checks grouping event logs into threads, defining the metric precisely and handling threads with no reply.
What the Interviewer Expects
- Groups events by (request, pro) thread and sorts within a thread
- Measures from the first customer message to the first pro message after it
- Counts unreplied threads in the reply-rate denominator
- Applies the minimum-volume rule before awarding
- Explains why median beats mean here
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you compute this incrementally as messages stream in?
- Should replies sent at 3am count the same as business hours?
- How would you stop pros gaming the metric with auto-replies?
- How would you handle threads that are still open and unanswered for only 5 minutes?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input events are tuples (request_id, pro_id, sender, ts) in minutes, unsorted. A thread is one (request, pro) pair. Only threads that a customer starts count. Response time is first pro message at o...
High-Level Design
One pass to bucket events into threads, one pass over threads to accumulate per-pro stats (thread count, replied count, list of response times), and a final pass to evaluate the badge rule. Pros with ...