ranking
Applied AI interview questions tagged ranking, across every topic.
13 questions · 2 unlocked for you
Concepts behind "ranking"
The curriculum that explains the ideas these questions test.
Foundational
Window FunctionsWindow functions compute across a set of rows related to the current row, without collapsing them like GROUP BY does, so you can rank within groups, compute running totals and moving averages, and compare a row to its neighbors (LAG/LEAD), all in one pass. They are the backbone of analytics SQL: top-N-per-group, sessionization, cohort analysis, and period-over-period. Applied-AI interviews probe them because they are the single most-tested SQL skill and the cleanest way to express analytical queries.🗄️ Data & SQL Engineering
Core
Recommendation Systems: Candidate Generation and RankingIndustrial recommenders use a two-stage funnel: cheap candidate generation narrows millions of items to a few hundred, then an expensive ranker scores that shortlist. Candidate generation leans on collaborative filtering, matrix factorization, and two-tower retrieval; ranking adds a heavy feature-rich model optimized for engagement. Applied-AI interviews probe this because it is the canonical ML system design and exposes 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 independently), pairwise (predict which of two items ranks higher), and listwise (optimize the whole ordering against a ranking metric). Pairwise and listwise beat pointwise because they learn relative order, which is what ranking metrics like NDCG actually reward. Applied-AI 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 built 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 handle many items and expensive models handle few. Applied-AI interviews probe this because it is how every large-scale ranking system is actually structured, and because freshness, diversity, and policy constraints have to slot 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 with a window function, then keep the ranks you want. The choice between ROW_NUMBER, RANK, and DENSE_RANK comes down to tie handling, and getting ties wrong is the usual bug. Applied-AI 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
