57Median of Two Sorted Arrays in O(log(m+n)).▼hardGoogleMetaAmazon2 replies◆ premiumThis famously-hard problem wants better than the O(m+n) merge: an O(log) binary search on the partition. The signal is binary-searching the split point so the left halves stay below the right halves. Here is the answer.Open full answer →
19How do you compute percentiles, medians, and quantile buckets in SQL?▼mediumMetaAmazonSnowflake2 replies○ sign inMeans lie on skewed data like latency and spend, and SQL has 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 →