top-k Interview Questions
32 interview questions in our bank cover top-k, most of them Coding & Leetcode-style Questions. They average 3.0/5 difficulty — medium — and each one was reported by a candidate after a real interview. Companies known to ask about top-k: Apple, Uber, Meta, Oracle, Snowflake, and 15 more.
Practice these on the problems board →Companies that ask about top-k
Question mix
- Coding & Leetcode-style Questions24
- System Design for ML7
- ML Fundamentals & Algorithms1
Difficulty
- 2/5 — easy3
- 3/5 — medium26
- 4/5 — hard3
Questions tagged top-k
Twitter Spaces — Aggregate Active Hours
3/5This xAI interview challenge requires processing chronological event logs of user sessions to compute total active participation durations within specific virtual spaces. Candidates must efficiently aggregate interval data while preparing for streaming follow-up queries that track top concurrent participants in real time. The problem tests proficiency in interval manipulation, hash-based lookups, and streaming data structures. Unlock the comprehensive problem statement, optimal algorithmic approach, and reference code with a paid subscription.
Coding & Leetcode-style QuestionsxAIImplement top-k sampling using NumPy
3/5This Cohere interview question tests your proficiency in numerical computing and probabilistic sampling techniques commonly used in modern language models. You are asked to implement a token selection mechanism that restricts generation choices to the highest-scoring candidates using pure array operations without heavy machine learning frameworks. The task evaluates your mastery of vector manipulation, probability normalization, and efficient indexing strategies. To access the complete problem statement, performance considerations, and clean model implementation, a subscription is needed.
ML Fundamentals & AlgorithmsCohereTop-K Largest Elements (Retain / Rank Stores)
2/5This popular phone-screen warm-up, frequently reported during interviews at Microsoft, evaluates your ability to filter and rank elements from a collection under specific ordering constraints. Candidates must design an efficient approach to isolate top-tier items while preserving sequence integrity or applying complex business rules. The full problem statement, test cases, and model solution require a subscription.
Coding & Leetcode-style QuestionsMicrosoftRecent Like Count and Top Posts in a Sliding Window
3/5This system design challenge, frequently encountered in ByteDance interviews, centers on building a high-throughput backend capable of processing millions of engagement events per second. Candidates must architect a dual-path framework that simultaneously handles precise single-item point queries and real-time sliding-window aggregations for global and regional trending content. The evaluation focuses on stream processing, caching strategies, and managing heavy write loads efficiently. Access to the comprehensive architectural blueprint and recommended solution strategy requires a subscription.
System Design for MLByteDanceTop K Frequent IP Addresses
3/5This coding exercise, reported as an interview question at NewsBreak, challenges candidates to efficiently parse large-scale log data and determine the most frequently occurring network addresses. The task tests proficiency in hash-based counting algorithms and priority queues to handle substantial volumes of entries within strict performance limits. Solving this problem requires careful management of memory and time complexity to process millions of records swiftly. Access to the complete problem description, optimal algorithmic approach, and thoroughly tested model solution requires a subscription.
Coding & Leetcode-style QuestionsNewsBreakAI Coding — Friend Recommendation
3/5This Meta technical assessment centers on debugging and expanding a social network suggestion feature. You will fix filtering flaws in an existing codebase, build a randomized candidate selector, and implement a mutual connection scoring algorithm to retrieve top recommendations. It tests your practical software engineering skills and proficiency in handling collections. Get the comprehensive prompt and verified reference solution with a paid subscription.
Coding & Leetcode-style QuestionsMetaMerge K Sorted (Key, Value) Lists with Later Override
3/5Reported as an Oracle OCI screening question, this challenge requires combining multiple ordered sequences of key-value pairs while correctly applying precedence rules when duplicate keys occur across different collections. It assesses your ability to adapt multi-way merging algorithms, such as those driven by min-heaps, to incorporate custom conflict-resolution logic based on source indices. You will practice maintaining sorted order while overriding older data with newer updates. Access to the complete solution and detailed explanation requires a subscription.
Coding & Leetcode-style QuestionsOracleK Top-Selling Books Tracker
3/5Design a robust tracking system that continuously aggregates cumulative metrics and efficiently retrieves top-ranking entries after every update. This algorithmic exercise has been reported in recruitment assessments at Snowflake to test proficiency with custom sorting logic, tie-breaking rules, and data structure selection. You will learn how to maintain performance under frequent write and read operations. Unlocking the complete problem specification and verified solution demands a subscription.
Coding & Leetcode-style QuestionsSnowflakeTop-K Search Terms (Per-User Deduped)
3/5Encountered in interview rounds at Snowflake, this data processing challenge asks you to determine the top search terms from an event stream based on unique user engagement rather than total raw frequency, complete with deterministic tie-breaking. It tests your proficiency in hash-based aggregation, frequency counting, and custom sorting strategies over large datasets. Access the full problem details and a robust implementation guide by subscribing.
Coding & Leetcode-style QuestionsSnowflakeKth Largest Element in an Array
3/5Mastering this common Apple interview challenge requires identifying a specific numerical rank within a collection of numbers without the overhead of complete sorting. Candidates are tested on their ability to apply efficient partitioning algorithms or heap-based strategies to optimize runtime performance. Reviewing this problem helps build intuition for linear-time selection techniques frequently encountered in technical evaluations. Access to the comprehensive problem breakdown and step-by-step model solution requires an active subscription.
Coding & Leetcode-style QuestionsAppleDesign a Trending-Hashtags Detection System
4/5Encountered in Meta engineering interviews, this architecture challenge requires building a distributed platform to surface emerging topics in near real time. You must balance multiple competing signals, including temporal freshness, baseline novelty, and overall volume, while preventing localized spam or stale evergreen subjects from dominating the rankings. The problem tests your mastery of stream processing, sliding windows, and low-latency serving patterns. The comprehensive system architecture guide and detailed implementation blueprint require a subscription.
System Design for MLMetaTop K Errors in Request Responses Within a Time Window
3/5In this practical data processing problem from Notion, you are tasked with filtering and aggregating log records to identify the most prevalent system errors within a specific timeframe. The exercise measures your proficiency in date-time parsing, frequency counting, and ranking data streams. To view the complete problem instructions and the optimal solution, please subscribe.
Coding & Leetcode-style QuestionsNotionK-th Largest Stock Price in Continuous Stream
3/5This CME Group interview question challenges you to efficiently track and query a specific rank within an incoming sequence of numeric values. You will need to design an algorithm capable of handling real-time data feeds while constantly evaluating ordered subsets to retrieve targeted percentile metrics. This task tests your proficiency with priority queues, data streaming concepts, and maintaining sorted structures under dynamic updates. Access to the complete problem description, optimization strategies, and the verified model solution requires a subscription.
Coding & Leetcode-style QuestionsCME GroupTop K Frequent Elements
2/5Featured frequently in technical assessments at Uber, this algorithmic challenge tests your proficiency with hash maps and frequency counting techniques. Candidates must analyze a collection of numeric values to isolate the most commonly occurring entries up to a specified threshold. Developing an efficient strategy demands a strong grasp of data structures and sorting optimization. The comprehensive problem statement and verified model solution require a subscription.
Coding & Leetcode-style QuestionsUberActive Communication Top Users
3/5This engaging Google interview challenge evaluates your ability to handle continuous data feeds and track dynamic statistics in real time. You will build a system that ingests interaction pairs, maintains frequency tallies, and efficiently surfaces the most active participants based on custom ordering criteria. This problem tests data structure design, state management, and algorithmic optimization under high-frequency updates. To explore the complete problem statement, edge-case handling, and an optimal model solution, unlock full access with a subscription.
Coding & Leetcode-style QuestionsGoogleTrending System / Top-K Hot Files
3/5This Figma system design interview question focuses on engineering a real-time analytics pipeline capable of ingesting massive view event streams to maintain a continuously updated global popularity ranking. Candidates must address challenges such as event deduplication, sliding window aggregations, space-efficient approximate counting algorithms, and resilient retrieval architectures that remain highly responsive under heavy read loads. Unlocking the complete design blueprint, architecture diagrams, and expert evaluation criteria requires an active platform subscription.
System Design for MLFigmaTop K Highest CTR Campaigns
2/5This data processing challenge, commonly reported during Samsung interviews, asks you to identify the highest performing advertising campaigns based on engagement metrics. Given raw impression and interaction logs, you must compute performance ratios and efficiently extract the top performers using sorting or heap-based selection strategies. It tests your capability to handle tabular data streams and implement efficient ranking algorithms. Unlock the complete problem prompt, sample data sets, and optimal solution code with a paid subscription.
Coding & Leetcode-style QuestionsSamsungTop 3 Trending Hashtags in a Time Window
3/5Tackle a practical data stream analysis problem frequently encountered in interviews with F5 Networks. Given a collection of messages and associated timestamps, your goal is to extract and rank the most frequently occurring hashtags within a designated sliding time window. This challenge assesses your proficiency in string parsing, temporal filtering, and efficient frequency counting. Reviewing the complete problem context and optimal algorithmic solution requires a subscription.
Coding & Leetcode-style QuestionsF5 NetworksMetrics and Monitoring Platform
4/5Design scalable data telemetry systems in this advanced architecture challenge inspired by technical evaluations at LinkedIn. You will architect a high-throughput monitoring platform capable of ingesting massive event streams, executing complex multidimensional aggregations, and serving low-latency range queries. The task focuses on optimizing hot-path storage, partitioning strategies, and handling heavy read-write concurrency. Unlock the full architectural breakdown and expert solution by purchasing a subscription.
System Design for MLLinkedInFetch Wikipedia via API, then Filter and Aggregate Results
3/5This reported Cresta interview question evaluates your ability to interact with external web services by fetching data from the Wikipedia API and processing the payload. Candidates must correctly handle network headers, parse structured responses, and apply custom filtering and aggregation logic to the retrieved content. This exercise tests practical API integration skills combined with data manipulation techniques in a real-world scenario. Access to the complete problem description and an optimized model solution requires a subscription.
Coding & Leetcode-style QuestionsCrestaSystem Design — Event Ingestion + Top-K Aggregation
3/5Scaling a single-server architecture to handle massive request volumes while simultaneously tracking frequent occurrences is a common system design challenge frequently discussed in Oracle interviews. This scenario requires you to transition a basic event-reporting endpoint into a distributed, high-throughput pipeline capable of computing top-K aggregations efficiently in real-time. The evaluation focuses on your ability to address bottlenecks, design data streaming pipelines, and choose appropriate distributed data structures. Gain complete access to the comprehensive problem guide and expert architectural solutions by subscribing.
System Design for MLOracleSecond Most Frequent GIF Tag
3/5As featured in a SoFi technical screening, this problem asks you to parse a flattened sequence of structured records, tally occurrences of specific categorical labels, and isolate the runner-up under various tie-breaking conditions. The assessment focuses on linear-time scanning and effective hash map management. Unlock the complete problem description and expert solution by getting a subscription.
Coding & Leetcode-style QuestionsSoFiArticle Voting Tracker with Top-K and Recent Flips
3/5As highlighted in software engineering interviews at Rippling, designing high-throughput data tracking systems requires robust in-memory data structures. This challenge tests your ability to manage dynamic user interactions, such as positive and negative ratings, while simultaneously tracking recent preference changes and identifying top-performing items efficiently. You will need to carefully balance time complexity for lookups, updates, and ranking retrievals under heavy concurrent loads. To explore the optimal algorithmic implementation and access detailed model code, unlock your subscription today.
Coding & Leetcode-style QuestionsRipplingOrder Processing System
3/5In this Da Vinci Trading interview scenario, you are tasked with engineering a high-performance order processing system capable of ingesting financial exchange data feeds in real time. The goal is to efficiently maintain and query daily statistics, including total transaction volume, the top three largest purchase orders ranked by monetary value, and the optimal selling price at any given timestamp. Developing this solution requires balancing fast data retrieval with continuous stream updates. Unlock the complete challenge breakdown and expert implementation details with a subscription.
Coding & Leetcode-style QuestionsDa Vinci TradingTop-K Ads from Log + Sliding-Window Ingest
3/5Master real-time data processing and ranking algorithms in this Pinterest interview scenario. You will learn to extract frequent identifiers from historical datasets before transitioning to a sliding window streaming architecture that maintains rolling top metrics efficiently. This task examines proficiency with heap data structures and time-based stream processing. Get full access to the complete problem and verified solution with a subscription.
Coding & Leetcode-style QuestionsPinterestCustomer Revenue and Referral Tracking
3/5Tackling a financial tracking challenge frequently encountered in Uber technical interviews, this problem asks you to build a system that monitors client earnings and referral bonuses while supporting efficient queries to retrieve users meeting specific financial thresholds. You will need to optimize data structures for fast insertion and conditional sorting. Unlock the comprehensive breakdown and verified implementation details by securing our full subscription.
Coding & Leetcode-style QuestionsUberFind K Pairs with Smallest Sums
3/5Explore this classic multi-sequence combination puzzle frequently asked during Apple technical screenings. The exercise tests your proficiency with ordered collections, priority management, and efficient searching strategies to extract numerical pairings with minimal totals. Candidates must navigate large search spaces without incurring prohibitive time complexities. Accessing the complete problem statement, underlying algorithmic principles, and verified code implementation requires an active subscription.
Coding & Leetcode-style QuestionsAppleBackpack of Supplies: Prioritize Valuable Items
3/5This Ripple interview puzzle challenges you to manage a fixed-capacity inventory stream, ensuring that only the most valuable items are retained as new objects arrive. You must design an efficient streaming algorithm that constantly tracks top elements without violating capacity limits. The scenario assesses your priority queue management and real-time decision-making logic. Secure access to the full problem text and clean reference implementation with a paid subscription.
Coding & Leetcode-style QuestionsRippleDesign State-Wide Temperature Sensor Ingestion
3/5This Walmart Labs machine learning system design question challenges candidates to architect a scalable pipeline capable of ingesting high-frequency temperature telemetry across a vast geographic area. The exercise evaluates your ability to handle massive data streams while simultaneously servicing real-time analytical queries, such as locating extreme values and rendering spatial heat maps efficiently. Access the complete problem description and expert model architecture with a subscription.
System Design for MLWalmart LabsBoundary Search + Sliding-Window Top K
3/5Reported from a quantitative engineering discussion round at Citadel, this technical interview covers two distinct algorithmic challenges focused on efficient data retrieval. The first task involves locating boundary indices for a specific target value within a sorted structure, while the second requires tracking top-k elements dynamically across a moving window of data. Both components evaluate your proficiency with advanced search strategies and ordered data structures. The full problem details and expert solutions are available exclusively to subscribers.
Coding & Leetcode-style QuestionsCitadelTop-K Popular Items Over a Rolling Window
4/5Design a high-throughput recommendation ranking engine in this Uber reported interview question tailored for machine learning system design rounds. You will tackle real-time data ingestion, sliding-window aggregations, and scalable top-K retrieval architectures to serve massive volumes of user interaction events globally. This scenario tests your ability to balance latency, consistency, and storage trade-offs in distributed systems. Gain access to the full architectural blueprint and expert solution by subscribing today.
System Design for MLUberTop K Frequent Elements
3/5Identifying frequently occurring elements in a collection is a foundational algorithmic task frequently encountered in software engineering interviews at Apple. This problem requires developers to analyze a sequence of numbers and isolate the specified quantity of items that appear with the highest frequency. It tests your proficiency with hash map aggregations, frequency bucket sorting, and heap-based selection strategies for optimal performance. Access to the complete problem statement and efficient model solutions requires a subscription.
Coding & Leetcode-style QuestionsApple
Studied alongside
top-k interview FAQ
- How many top-k interview questions are there?
- 32 reported questions, mostly Coding & Leetcode-style Questions.
- Which companies ask top-k questions?
- Apple (3), Uber (3), Meta (2), Oracle (2), Snowflake (2), xAI (1), Cohere (1), Microsoft (1).
- How hard are top-k questions?
- They average 3.0 out of 5: 3 at 2/5, 26 at 3/5, 3 at 4/5.