PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Meta

Check diagonal equality in a matrix

Last updated: Mar 29, 2026

Quick Overview

This question evaluates skill in matrix manipulation and algorithmic reasoning, specifically understanding diagonal traversal, equality checks, and handling boundary conditions such as empty matrices, single-row or single-column inputs, and negative values.

  • Medium
  • Meta
  • Coding & Algorithms
  • Machine Learning Engineer

Check diagonal equality in a matrix

Company: Meta

Role: Machine Learning Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Given an m x n integer matrix, determine whether every top-left to bottom-right diagonal contains identical values (all elements along each such diagonal are equal). Provide an O(mn) solution, discuss space trade-offs, and cover edge cases such as empty matrices, single row/column, and negative values.

Quick Answer: This question evaluates skill in matrix manipulation and algorithmic reasoning, specifically understanding diagonal traversal, equality checks, and handling boundary conditions such as empty matrices, single-row or single-column inputs, and negative values.

Related Interview Questions

  • Solve Two Backtracking Array Problems - Meta (hard)
  • Solve Array, Matrix, and Recommendation Problems - Meta (medium)
  • Find a String Containing Another - Meta (medium)
  • Solve Subarray Sum and Local Minimum - Meta (hard)
  • Validate abbreviations and brackets - Meta (medium)
Meta logo
Meta
Jul 31, 2025, 12:00 AM
Machine Learning Engineer
Technical Screen
Coding & Algorithms
4
0

Given an m x n integer matrix, determine whether every top-left to bottom-right diagonal contains identical values (all elements along each such diagonal are equal). Provide an O(mn) solution, discuss space trade-offs, and cover edge cases such as empty matrices, single row/column, and negative values.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Meta•More Machine Learning Engineer•Meta Machine Learning Engineer•Meta Coding & Algorithms•Machine Learning Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.