Skip to content

Glossary: System Design Beyond the Basics

heapq.nlargest

Also written: heapq

A function from Python's `heapq` module that returns only the k items with the largest key, biggest first, without sorting everything.

Where the book teaches it

Related terms

Feed cache