NVIDIA C++ Interview Question: Transpose a 2D Matrix of floats

In modern C++, given a 2D matrix of ‘float’s, write a C++ function to transpose it.

This tests basic matrix manipulation plus“modern C++”API design: choosing an appropriate container (e.g., std::vector<std::vector<float>> or a flat vector with row/col indexing), handling non-square matrices, and deciding whether to return a new transposed matrix or transpose in-place (only possible for square matrices). Interviewers also look for clear time/space complexity and safe bounds handling.

END
 0