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

Programming Exercises

Write a component that computes the transpose of a hardcoded 2D array and displays it.

Hard

Problem Statement

Write a component that computes the transpose of a hardcoded 2D array and displays it.

Sample Input

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

Sample Output

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

Limits

Time: 2s · Memory: 256 MB

Code Editor

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

import React from "react";
 
 const TransposeMatrix = () => {
  return (
  <div>
  {/* Display the transposed array */}
  </div>
  );
 };
 
 export default TransposeMatrix;