How do you compute a median or any quantile in SQL, and what are the trade-offs of PERCENTILE functions vs NTILE?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks how to calculate a median or any percentile in SQL and compares PERCENTILE_CONT and PERCENTILE_DISC with bucketing rows using NTILE. Tests interpolation, tie and NULL handling, dialect differences, and a fallback for engines without percentile functions.