CS FundamentalsVery hardProduct-company placement · GATE CS
A fragment contains `total = 0` immediately followed by `total = compute()`, with no use of total in between, and later `print(rate)` where rate has not yet been assigned. Which data-flow anomalies are these?
- A. du and dk
- B. dd (defined twice without use) and ur (used before defined)
- C. uu and dd
- D. ud and du
Correct answer: B. dd (defined twice without use) and ur (used before defined)
Two definitions with no intervening use (dd) suggest wasted or mistaken code; using a variable on a path where it is undefined (ur) is a real bug. Static data-flow analysis flags both without running the code.
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
- In domain testing for integer inputs, a program accepts points satisfying x + y ≤ 10 (a closed boundary). Which pair of test points is the…
- A task has optimistic 4 days, most likely 6 days and pessimistic 20 days. What are the triangular-distribution mean (a + m + b)/3 and the…
- In IFPUG function-point counting, which of these is an external output (EO) rather than an external inquiry (EQ)?
- A database cluster needs each replica to keep a stable network name (db-0, db-1, db-2) and its own persistent volume across restarts…
- In GitOps, how does a change reach a Kubernetes cluster?
- A team stops patching running servers in place and instead builds a new machine image for every change, replacing old servers entirely…