← Questions

Paged KV cache in C++: implement access, then optimize it

0
NvidiaCodingLast asked Nov 2026

A coding interview question asked in Nvidia's technical phone screen, last asked Nov 2026. It tests c++, kv cache and memory layout.

During generation a transformer saves each processed token's attention keys and values, so they are not recomputed. A paged KV cache stores them in fixed-size pages taken from a shared pool, with a per-sequence page table.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

c++ · kv cache · memory layout · llm inference

Your code and the AI tutor open when you unlock this question.