← 💻 Coding & Engineering CraftNEXT IN CODING & ENGINEERING CRAFTGraphs: BFS, DFS, and Shortest Paths→
Core
Heaps and Priority Queues
A binary heap keeps a partial order so you can pull the smallest or largest element in O(log n) and peek at it in O(1), without paying to fully sort. This is the right tool for top-k, merging k sorted streams, and a running median, where you need the extreme few, not the whole order. Applied-AI interviews probe it because retrieval, ranking, and streaming pipelines all hinge on cheap partial-order operations.
a free account unlocks the core curriculum tier · no card
COURSES COVERING THIS TOPIC
No lesson covers this one directly yet. These teach the surrounding topic from the beginning.
RELATED CONCEPTS
PRACTICE THIS IN REAL QUESTIONS
LLM & GenAI FundamentalsTemperature, top-k, and top-p sampling in LLMs: which to use when.→Coding & DSAGiven a query vector and N stored vectors, return the top-k most similar by cosine similarity, efficiently.→Coding & DSAReturn the k most frequent elements in a large array (and handle a stream).→Coding & DSAMerge k sorted lists (or streams) efficiently.→RAG & Agent System DesignContext precision versus context recall: which do you optimize, and how do they trade off in RAG?→Coding & DSADijkstra's algorithm: shortest paths from a source in a weighted graph.→
COMPANIES THAT ASSUME THIS
