57Median of Two Sorted Arrays in O(log(m+n)).▼hardGoogleMetaAmazon2 replies◆ premiumThis notoriously hard problem demands better than the O(m+n) merge: an O(log) binary search on the partition. Interviewers look for binary-searching the split point so the left halves stay below the right halves. The answer follows.Open full answer →
19How do you compute percentiles, medians, and quantile buckets in SQL?▼mediumMetaAmazonSnowflake2 replies○ sign inMeans mislead on skewed data like latency and spend, and SQL ships dedicated functions for the truth. The signal is PERCENTILE_CONT/DISC for exact quantiles, NTILE for bucketing, and why p50/p99 beat the average.Open full answer →