← Questions

Sliding-window attention in C++ with a KV cache you design

0
NvidiaCodingLast asked Nov 2026

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

You are dropped into an existing C++ inference codebase and have 30 minutes to add sliding-window attention: a token attends to the latest W positions only, not to everything before it. An AI coding assistant is allowed and the…

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++ · attention · kv cache · ai-assisted coding

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