ME or MEng Master of Engineering Master of Software Engineering 4 — Questions and Answers
Question 1: Which metric measures the number of linearly independent paths through a program's control flow graph?
- Lines of code (LOC)
- Cyclomatic complexity (Correct answer)
- Halstead volume
- Fan-out metric
Correct answer: Cyclomatic complexity
Cyclomatic complexity (V(G) = E − N + 2P) quantifies independent paths, providing a lower bound on the number of test cases needed for full branch coverage.
Question 2: What distinguishes 'eventual consistency' from 'strong consistency' in distributed databases?
- Eventual consistency guarantees reads always reflect the latest write; strong consistency does not
- Strong consistency guarantees all nodes reflect the latest write immediately; eventual consistency allows temporary divergence (Correct answer)
- Eventual consistency requires synchronous replication; strong consistency uses asynchronous replication
- Strong consistency is only achievable in single-node systems
Correct answer: Strong consistency guarantees all nodes reflect the latest write immediately; eventual consistency allows temporary divergence
Strong consistency ensures all nodes see the same data at the same time, while eventual consistency allows replicas to diverge temporarily and converge over time.
Question 3: In the context of software requirement engineering, what is a 'non-functional requirement' (NFR)?
- A requirement that specifies a system behavior triggered by a user action
- A requirement that defines system qualities such as performance, security, or scalability (Correct answer)
- A requirement that is optional and deferred to future releases
- A requirement derived from stakeholder interviews that has not yet been validated
Correct answer: A requirement that defines system qualities such as performance, security, or scalability
NFRs specify system quality attributes — how well it performs, how secure it is, how scalable — rather than what specific behaviors it exhibits.
Question 4: Which Git workflow strategy maintains a single 'main' branch where all developers integrate short-lived feature branches multiple times per day?
- Gitflow
- Trunk-Based Development (Correct answer)
- Forking Workflow
- Release Branching
Correct answer: Trunk-Based Development
Trunk-Based Development keeps all work on one main branch with very short-lived branches, enabling continuous integration and reducing merge conflicts.
Question 5: What is the key difference between 'black-box testing' and 'white-box testing'?
- Black-box testing uses automated tools; white-box testing is performed manually
- Black-box testing tests without knowledge of internal structure; white-box testing uses knowledge of the code (Correct answer)
- Black-box testing focuses on performance; white-box testing focuses on functional correctness
- Black-box testing requires source code access; white-box testing only needs the executable
Correct answer: Black-box testing tests without knowledge of internal structure; white-box testing uses knowledge of the code
Black-box testing derives test cases from specifications alone, while white-box testing designs tests based on internal code structure and logic.
Question 6: Which memory management technique automatically reclaims unreachable objects by tracing references from root objects?
- Reference counting
- Tracing garbage collection (Correct answer)
- Manual memory management with free()
- Memory pooling
Correct answer: Tracing garbage collection
Tracing GC (e.g., mark-and-sweep) traverses all reachable objects from GC roots and reclaims anything not reached, handling cyclic references that reference counting cannot.
Question 7: In RESTful API design, which HTTP method is idempotent but NOT safe?
- GET
- PUT (Correct answer)
- POST
- HEAD
Correct answer: PUT
PUT is idempotent (repeating it produces the same result) but not safe because it modifies server state, unlike GET and HEAD which are both idempotent and safe.
Which metric measures the number of linearly independent paths through a program's control flow graph?