← Microsoft questions

Identify Geometric Shape in a 2D Matrix

Filed under Microsoft

Given a 2D binary matrix where 0 represents background and 1 represents filled pixels, write an algorithm to identify the regular geometric shape formed by the pixels.

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.