← Microsoft questions

Store and retrieve numbers in 2D space in optimal time

Filed under Microsoft

Given a fixed 2D grid of size N x M and a collection of numbers, design an efficient storage and retrieval layout to lookup any element with optimal time complexity (e.g., O(log N + log M)).

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.