HARDVerified Real Interview• Analytics Engineer
Median Google Search Query Frequency
Verified Source:Google Interview Archive
Google's Search Quality team provides a frequency distribution table showing how many searches users conducted per day.
Given a table search_frequency where:
searchesis the number of searches performed by a user.num_usersis the count of users who conducted that exact number of searches.
Write a query to calculate the median number of searches conducted per user, rounded to 1 decimal place.
Table:
search_frequency(searchesINT,num_usersINT)
Execution Sandbox:
Your query executes inside an isolated in-memory PostgreSQL engine (PGlite WebAssembly). You have full access to standard PostgreSQL aggregations, window functions, and CTEs.
Standard SQL (ANSI)|Ln 1, Col 1(7 lines, 116 chars)
Tab Indent⌘↵ Run Query
Ready to execute. Press Run (⌘+Enter)
Write your query and click “Run” or press ⌘+Enter to inspect output.