CS FundamentalsVery hardProduct-company placement · Avionics/MC-DC interview

With short-circuit evaluation, how many distinct evaluation patterns (which conditions are evaluated and their values) can the decision (A && B) || C produce?

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

Correct answer: B. 5

A false → C decides (2 patterns); A true and B true → true, C skipped (1); A true and B false → C decides (2). That is 5 patterns, not the 2^3 = 8 combinations of a non-short-circuit truth table.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic