ranking
AI, ML & GenAI interview questions tagged ranking, across every topic.
15 questions · 3 unlocked for you
Concepts behind "ranking"
The curriculum that explains the ideas these questions test.
Foundational
Window FunctionsWindow functions run calculations over a set of rows tied to the current row, without collapsing them the way GROUP BY does, so you can rank within groups, build running totals and moving averages, and compare a row against its neighbors (LAG/LEAD), all in a single pass. They anchor analytics SQL: top-N-per-group, sessionization, cohort analysis, and period-over-period. AI, ML, and GenAI interviews probe them because they are the single most-tested SQL skill and the clearest way to write analytical queries.🗄️ Data & SQL Engineering
Core
Recommendation Systems: Candidate Generation and RankingIndustrial recommenders run a two-stage funnel: cheap candidate generation trims millions of items to a few hundred, then an expensive ranker scores that shortlist. Candidate generation relies on collaborative filtering, matrix factorization, and two-tower retrieval; ranking layers on a heavy feature-rich model optimized for engagement. AI, ML, and GenAI engineer interviews probe this because it is the canonical ML system design and reveals how you handle cold start, scale, and the recall-versus-precision split.⚙️ System Design for AI in ProductionSign in
Core
Learning to Rank: Pointwise, Pairwise, ListwiseLearning to rank trains a model to order a list rather than predict a single label. The three formulations are pointwise (predict each item's score on its own), pairwise (predict which of two items ranks higher), and listwise (optimize the whole ordering against a ranking metric). Pairwise and listwise outperform pointwise because they learn relative order, which is what ranking metrics like NDCG actually reward. AI, ML, and GenAI engineer interviews probe it because ranking is the precision stage of search, ads, and recommenders.⚙️ System Design for AI in ProductionSign in
Core
Multi-Stage Retrieval and Ranking FunnelsSearch, ads, and feed systems are constructed as a funnel: retrieve a broad candidate set, rank it with a heavier model, re-rank the top with the heaviest model, then filter and blend with business rules. Each stage trades recall for precision and cost, so cheap models process many items and expensive models process few. AI, ML, and GenAI engineer interviews probe this because it is how every large-scale ranking system is actually built, and because freshness, diversity, and policy constraints have to fit into specific stages.⚙️ System Design for AI in ProductionSign in
Core
Ranking and Top-N Per GroupTop-N-per-group is the partition-then-filter idiom: rank rows within each group using a window function, then keep the ranks you want. The choice among ROW_NUMBER, RANK, and DENSE_RANK comes down to tie handling, and getting ties wrong is the usual bug. AI, ML, and GenAI interviews probe it because it is the cleanest replacement for a clumsy self-join or correlated subquery, and the ranking-family distinction is a quick fluency check.🗄️ Data & SQL EngineeringSign in
