Virtusa Neural Hiring Drive 2026 | Matrix Layer Rotation & Equilibrium Index of an Array

Virtusa · Question · Posted Jun 2026

Problem 1 - Matrix Layer Rotation (The Clockwise Shift) Problem Statement You are given an M × N matrix of integers and an integer R. The matrix consists of multiple concentric layers, where each layer forms a hollow rectangular boundary. Your task is to rotate every layer of the matrix clockwise exactly R times. Return the final rotated matrix. Constraints Constraint 2 ≤ M, N ≤ 100 At least one of M or N is even 1 ≤ R ≤ ...

The full answer & interview discussion are available to premium members.

Log in Create a free account