Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Create a component that rotates a hardcoded 2D matrix by 90 degrees clockwise and displays the result.

Hard

Problem Statement

Create a component that rotates a hardcoded 2D matrix by 90 degrees clockwise and displays the result.

Sample Input

[[1, 2, 3], [4, 5, 6], [7, 8, 9]]

Sample Output

Rotated Matrix: [[7, 4, 1], [8, 5, 2], [9, 6, 3]]

Limits

Time: 2s · Memory: 256 MB

Code Editor

Try your code in this preview. Submit marks it done.

import React from "react";
 
 const RotateMatrix = () => {
  return (
  <div>
  {/* Display the rotated matrix */}
  </div>
  );
 };
 
 export default RotateMatrix;