Data Structures & AlgorithmsModerateTCS NQT · GATE CS

Problem: What is the determinant of the matrix [[2, 1], [1, 3]]?

  1. A. 6
  2. B. 4
  3. C. 5
  4. D. 7

Correct answer: C. 5

For [[a, b], [c, d]] the determinant is ad − bc = 2·3 − 1·1 = 5. Adding the products (ad + bc) gives 7, and the trace a + d also gives 5 here only by coincidence.

More Coding Interview Problems questions

Exams that ask this topic