PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Google

Implement matrix transforms and discuss eigenvalues

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of matrix manipulation and numerical linear algebra, including in-place matrix transforms and rotations, sparse matrix representations, eigenvalue computation, and their extensions to higher-order tensors.

  • medium
  • Google
  • Software Engineering Fundamentals
  • Software Engineer

Implement matrix transforms and discuss eigenvalues

Company: Google

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

You are given a square matrix `A` (size `n × n`). 1. **Diagonal symmetry (transpose):** Transform `A` into its transpose (mirror across the main diagonal). Prefer an **in-place** algorithm when possible. 2. **Rotate 90 degrees:** Rotate the matrix by **90° clockwise** (again, ideally in-place). 3. **Eigenvalues:** Explain how you would compute the **eigenvalues** of `A`. ### Follow-ups - If `A` is a **sparse** matrix (most entries are zero), how would your representation and approach change for the above operations (especially eigenvalue computation)? - If the data is **3D** (a tensor / 3D array), how do “transpose/diagonal symmetry” and “rotation” generalize, and what does an eigenvalue-like concept become? Assume typical interview constraints such as `n` up to a few thousand for dense operations (memory permitting), and much larger for sparse matrices.

Quick Answer: This question evaluates understanding of matrix manipulation and numerical linear algebra, including in-place matrix transforms and rotations, sparse matrix representations, eigenvalue computation, and their extensions to higher-order tensors.

Related Interview Questions

  • Process Sharded Login Logs - Google (medium)
  • Design an ads retrieval service using a heap - Google (easy)
  • Design a waitlist manager - Google (easy)
  • Design an editable sequence with marker - Google (medium)
  • Design a waitlist system with top/bottom K - Google (medium)
Google logo
Google
Feb 7, 2026, 12:00 AM
Software Engineer
Onsite
Software Engineering Fundamentals
2
0
Loading...

You are given a square matrix A (size n × n).

  1. Diagonal symmetry (transpose): Transform A into its transpose (mirror across the main diagonal). Prefer an in-place algorithm when possible.
  2. Rotate 90 degrees: Rotate the matrix by 90° clockwise (again, ideally in-place).
  3. Eigenvalues: Explain how you would compute the eigenvalues of A .

Follow-ups

  • If A is a sparse matrix (most entries are zero), how would your representation and approach change for the above operations (especially eigenvalue computation)?
  • If the data is 3D (a tensor / 3D array), how do “transpose/diagonal symmetry” and “rotation” generalize, and what does an eigenvalue-like concept become?

Assume typical interview constraints such as n up to a few thousand for dense operations (memory permitting), and much larger for sparse matrices.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Google•More Software Engineer•Google Software Engineer•Google Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 8,000+ 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.