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?
- A. 8
- B. 5
- C. 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.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A loop can execute between 0 and 10 times (n = 10). Following Beizer's guidelines for simple-loop testing, which set of iteration counts…
- A function is a straight sequence of three independent if-else statements, with no loops. What are (total entry-to-exit paths, cyclomatic…
- How many definition-use (def-use) pairs does variable x have in this fragment (a p-use in a condition counts as a use)? python x =…
- For the function below, the tests (age = 30, member = True) and (age = 10, member = False) already give 100% statement and branch…
- McCabe's V(G) = E - N + 2 for one function comes from the cyclomatic number of a strongly connected graph, E - N + P. Where does the '+2'…
- A loan is approved if (salary ≥ ₹50,000 AND credit history is good) OR a guarantor is provided. Using a limited-entry decision table with…