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
Coding & Algorithms
Software Engineer
Thumbtack
November 29, 2026
Software Engineer
Online Assessment
Coding & Algorithms
Easy

0

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
Hash map grouping
Event logs
Median
Metric definition
Edge handling
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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 ...


Submit Your Answer
Markdown supported

Related Questions