Quick Revision

GK One-Line Question & Answer

15541+ short questions with short answers, covering every category and sub-category on the site — no long articles to scroll through. Good for a fast recap before an exam, or a few minutes of daily practice.

Software Engineering → Coding Standards 1

Why is 'premature optimisation' considered a coding standard violation and when is optimisation legitimate?
Premature optimisation prioritises performance over correctness and maintainability without profiling data — Knuth's rule applies; optimisation is legitimate after profiling identifies actual hotspots
click to copy

Software Engineering → Introduction to Software Engineering 23

What specific problem does the 'assert' statement solve and why should it NOT be used for input validation?
Asserts document and enforce invariants about program's internal state; should not validate external inputs because assertions are typically disabled in production builds allowing invalid inputs to pass unchecked
click to copy
What is 'cyclomatic complexity', how is it calculated, and what threshold typically indicates need for refactoring?
McCabe's metric counting linearly independent paths: M = E - N + 2P; complexity above 10 indicates code difficult to test and maintain — should be refactored into smaller units
click to copy
What is the key difference between structural (white-box) and behavioural (black-box) testing?
White-box tests based on code structure cannot detect missing functionality; black-box tests cannot ensure structural paths are exercised; both alone are insufficient
click to copy
What does 'mutation testing' evaluate that conventional coverage metrics cannot?
Quality and sensitivity of the test suite by introducing deliberate faults (mutations) and measuring whether tests detect them — a suite with high coverage but weak assertions will fail to kill many mutants
click to copy
What specific condition causes 'pesticide paradox' in a test suite and how is it remedied?
The same set of tests run repeatedly stops finding new defects because surviving code has been adapted to pass those specific tests — remedied by regularly reviewing and augmenting the test suite
click to copy
What does 'boundary value analysis' test that equivalence partitioning may miss?
Values at the edges of equivalence partitions (exact boundary, one below, one above) because defects cluster at boundaries due to common off-by-one errors
click to copy
What is the core principle behind TDD and what design benefit does it provide beyond defect reduction?
TDD's Red-Green-Refactor cycle writes tests before code; beyond defect reduction it forces testable design (high cohesion, low coupling, DI) because untestable code cannot pass tests written before implementation
click to copy
What distinguishes 'alpha testing' from 'beta testing' and in what order do they occur?
Alpha testing is conducted at the developer's site by internal users in a controlled environment before beta; beta testing is then by selected external users in their real-world environments
click to copy
What is a 'memory leak' in a managed language like Java and why is it still possible despite garbage collection?
A logical memory leak occurs when objects are still referenced (preventing GC) but no longer needed — common causes: static collections holding objects, event handlers not unregistered, and caches without eviction policies
click to copy
What is 'symbolic execution' in program analysis and what are its scalability limitations?
Running a program with symbolic rather than concrete inputs, tracking path conditions — enabling automatic test case generation and bug finding; limited by path explosion (exponential path count as branches grow) and constraint solving complexity
click to copy
What is a 'race condition' and what property makes concurrent programs particularly hard to debug?
Correctness depends on relative timing of concurrent operations; non-determinism makes them hard to debug because failure may not occur on every execution, disappears under debugging, and manifests only under specific load patterns
click to copy
What is 'software rejuvenation' and when is it used as a maintenance strategy?
A proactive fault management technique that periodically restarts, cleans, or reinitialises software to prevent accumulation of internal state degradation before failure occurs
click to copy
What makes 'legacy system' maintenance uniquely challenging compared to maintaining modern software?
Multiple compounding challenges: missing documentation, loss of developers' tacit knowledge, obsolete technologies, accumulated technical debt, tightly coupled architecture, and business criticality limiting testing windows
click to copy
What does the 'software aging' phenomenon describe and what are its two primary manifestations?
Software quality degrading over time due to: 1) accumulation of internal failures (memory leaks, resource fragmentation) and 2) structural degradation (accumulated technical debt making future changes harder)
click to copy
What is 'maintenance debt' and how does it differ from 'technical debt'?
Technical debt refers to suboptimal original design decisions; maintenance debt accumulates through deferred maintenance activities — known fixes, updates, improvements postponed and becoming increasingly expensive as dependencies change
click to copy
What is 'program comprehension' in maintenance and why does it consume the majority of maintenance effort?
The cognitive process of understanding existing code well enough to modify it safely; consumes 50-60% of maintenance effort because code was not written to be understood — names are ambiguous, logic implicit, and decision rationale absent
click to copy
What is 'software process capability' and how does CMM level 3 differ from level 2?
At level 2 processes are project-specific and repeatable; at level 3 processes are organisation-wide, standardised, and defined — enabling consistent performance across all projects
click to copy
What is the 'Mythical Man-Month' principle and what does it imply for adding developers to a late project?
Adding manpower to a late software project makes it later — because new developers require training time from existing developers and increase communication overhead
click to copy
What distinguishes 'incremental delivery' from 'iterative development' in software process models?
Incremental delivery adds functionality in planned chunks without revisiting prior increments; iterative development repeatedly refines the entire system through cycles, improving quality with each iteration
click to copy
What is a 'software product line' and what is its primary engineering advantage?
A family of related systems that share a common, managed set of features satisfying specific market needs — enabling systematic reuse of architecture, components, and assets across multiple products
click to copy
In software engineering, what is the fundamental difference between 'reliability' and 'availability'?
Reliability is the probability the system will perform its required function without failure for a specified time period; availability is the proportion of time the system is operational and accessible when needed
click to copy
What is the 'software architecture' of a system and why is it distinct from 'design'?
Architecture describes the high-level structure of a software system — its principal components, their relationships, and the fundamental principles governing their design; design elaborates the internal details of individual components
click to copy
What is 'non-functional testing' and what makes it fundamentally different from functional testing in scope?
Non-functional testing verifies quality attributes like performance, security, and usability rather than specific behaviours; it often requires the entire integrated system under realistic load and cannot be decomposed into unit tests
click to copy

Software Engineering → Software Testing 4

What is the fundamental distinction between 'error', 'fault', and 'failure' in software testing?
An error is a human mistake producing a fault (defect) in code; a fault is the static defect; a failure occurs when the fault is executed and the system behaves incorrectly
click to copy
What is a 'test oracle' and what is the 'oracle problem' in software testing?
A test oracle is the mechanism determining expected output to compare against actual results; the oracle problem is that for many complex systems no reliable oracle exists to determine correct output
click to copy
What is 'equivalence partitioning' and how does it reduce test case count without sacrificing coverage quality?
Divides input data into classes where members are expected to cause identical behaviour — testing one value per class is assumed equivalent to testing all values, reducing redundant tests
click to copy
What is 'regression testing' and what risk does inadequate regression testing introduce into CI/CD pipelines?
Re-executes tests after changes to ensure previously working functionality has not been broken; inadequate regression testing allows regressions to reach production where detection and repair cost is highest
click to copy

Software Engineering → Software Development Models 1

What distinguishes 'debugging' from 'testing' as activities in the software development lifecycle?
Testing finds that a defect exists; debugging locates and understands the defect so it can be fixed — debugging begins where testing ends
click to copy

Software Engineering → Debugging 6

What is the 'Heisenbug' phenomenon in software debugging and what commonly causes it?
A defect that disappears or changes behaviour when you attempt to observe or debug it — commonly caused by timing-dependent race conditions that the debugger's pausing alters
click to copy
What is 'rubber duck debugging' and what cognitive principle does it exploit?
Explaining code step-by-step to an inanimate object; the act of articulating the problem forces explicit processing revealing the solution — exploiting the principle that verbalisation activates different reasoning pathways
click to copy
In multithreaded debugging, what is a 'deadlock' and what four Coffman conditions must simultaneously hold?
Two or more threads permanently blocked waiting for each other; Coffman conditions: mutual exclusion, hold and wait, no preemption, and circular wait — all four must hold simultaneously
click to copy
What is 'binary search debugging' and in what scenario is it most effective?
Systematically halves the search space by inserting diagnostic checks at midpoints to determine which half contains the fault — most effective when fault location is unknown in a large codebase or long sequence of operations
click to copy
What is 'post-mortem debugging' and what types of information does it rely on?
Analyses a program's state after it has crashed or terminated abnormally, relying on core dumps, crash logs, exception stack traces, and memory snapshots captured at the moment of failure
click to copy
What is 'delta debugging' and what problem does it solve in bug reproduction?
Automatically minimises a failure-inducing input to the smallest possible failing case — solving the problem that bug reports contain complex large inputs where only a small portion causes the failure
click to copy

Software Engineering → Software Maintenance 5

What distinguishes corrective, adaptive, and perfective maintenance?
Corrective fixes defects; adaptive modifies for changed environments (new OS, hardware, laws); perfective enhances functionality or performance beyond original requirements
click to copy
What is the 'ripple effect' in software maintenance and what design practices minimise it?
Unintended propagation of changes where modifying one component requires changes in dependent components; minimised by low coupling, information hiding, stable interfaces, and encapsulation
click to copy
What is 'reverse engineering' in software maintenance and in what situation is it unavoidable?
Extracting higher-level abstractions from existing code when documentation is missing — unavoidable when maintaining legacy systems where only source code or compiled binaries survive without specifications
click to copy
In software maintenance, what is 'refactoring' and what distinguishes it from feature development?
Restructures existing code to improve internal quality without changing observable external behaviour — the key constraint is that functionality must remain identical before and after
click to copy
What is the 'Strangler Fig' pattern in software maintenance and what problem does it solve?
Incrementally replaces a legacy system by routing new functionality to a new system while the old system continues running — solving the problem of 'big bang' replacement requiring everything ready before switching
click to copy