← Questions

Range sum query 2D (immutable)

0
GoogleCodingLast asked Nov 2026

A coding interview question asked in Google's first round (coding), last asked Nov 2026. It tests prefix sum, matrix and arrays.

An m x n matrix of integers is fixed. Many queries follow; each one names a rectangle by two cells, its upper-left and lower-right corners, and wants the sum of all cells inside, edges included.

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

  • Google · First round: coding · Last asked Nov 202645 min · Coding in a Google Doc, no syntax highlighting or autocomplete · No AI

What it tests

prefix sum · matrix · arrays

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