← Questions

Nearest-center assignment without an N x K x D distance tensor

0
Mistral AICodingLast asked Jul 2026

A coding interview question asked in Mistral AI's coding round, last asked Jul 2026. It tests numpy, k-means and memory.

The assignment step of k-means: given N points and K centers in D dimensions, return for each point the index of its nearest center by Euclidean distance. The obvious NumPy broadcast, ((X[:, None, :] - C[None, :, :]) 2).sum(-1), builds an…

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

  • Mistral AI · Coding · Last asked Jul 202660 min · Live coding in Python · Reportedly fine for boilerplate and lookups; the fundamentals must be your own

What it tests

numpy · k-means · memory

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