Attribute Google Maps Navigation Starts to Prior Searches in Pandas

Last updated: November 29, 2026

Quick Overview

Given Google Maps search events and navigation start events, attribute each navigation to the same user's most recent search within ten minutes, then compute the share of searches that led to navigation and the median search-to-navigation latency.

Google
Data Manipulation (SQL/Python)
Data Scientist
Google
November 29, 2026
Data Scientist
Onsite
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Given Google Maps search events and navigation start events, attribute each navigation to the same user's most recent search within ten minutes, then compute the share of searches that led to navigation and the median search-to-navigation latency.

A Maps product analytics question in the style of a Google onsite pandas round. The interviewer wants to see merge_asof with a by key and a tolerance instead of a cross join, and a clear rule when one search leads to several navigation starts.

What the Interviewer Expects
  • Use merge_asof with by user, direction backward and a tolerance
  • Sort both frames by timestamp first
  • Handle several navigations per search by keeping the first
  • Compute conversion over all searches, including unmatched ones
  • Explain why a cross join plus filter does not scale
Key Topics to Cover
merge_asof
event attribution
pandas
latency metrics
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would the answer change if a navigation should be credited to the search whose selected place matches the destination?
  • How would you compute this for 2 billion events a day?
  • What does a falling median latency tell you, and what could fake it?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

searches(search_id, user_id, ts) and navs(nav_id, user_id, ts). A navigation belongs to the latest search by the same user at or before it, as long as the gap is at most ten minutes. Re-routes can...

Approach

merge_asof does exactly this: for each navigation row it finds the latest search row with search_ts <= ts for the same user_id, and the tolerance drops matches older than ten minutes. It needs b...


Submit Your Answer
Markdown supported