Practice Code Maintenance in CS Thinking
Use these practice problems to test your method after reviewing the concept explanation and worked examples.
Quick Recap
The ongoing process of updating, fixing, and improving software after its initial release to correct bugs, adapt to new requirements, improve performance, and keep dependencies current. Maintenance includes four types: corrective (fixing bugs), adaptive (adapting to new environments), perfective (improving functionality), and preventive (reducing future problems).
Software is never 'done.' Like a garden, it needs constant tending โ fixing bugs, updating dependencies, and adapting to changing needs.
Showing a random 20 of 50 problems.
Example 1
easyClassify: a user reports a crash when uploading a 5 GB file. The fix that handles it is ____ maintenance.
Example 2
easyWhy are meaningful variable names a maintenance practice?
Example 3
mediumA function getCustomerById is renamed. List one risk and one mitigation.
Example 4
mediumWhy is writing maintainable code from the START economically smart, given the 60-80% rule?
Example 5
hardA legacy module has no tests and produces correct output. Outline the safe order of work to add a new feature inside it.
Example 6
easyBefore changing unfamiliar code, what should you do first to avoid introducing bugs?
Example 7
mediumWhy are small, frequent commits easier to maintain than one huge end-of-week commit?
Example 8
easyFixing a reported bug in released software is which type of maintenance?
Example 9
easyRoughly what share of software's total lifetime cost does maintenance typically consume?
Example 10
easyRoughly what fraction of total software cost is maintenance?
Example 11
challengeMaintenance backlog has: (1) a data-loss bug, (2) a nice-to-have feature, (3) an unpatched critical CVE. Order by priority and justify the top item.
Example 12
mediumA test that fails sometimes and passes other times without code changes is called ____.
Example 13
mediumA library you depend on has a critical security patch released. Which maintenance type and action?
Example 14
hardExplain the term 'technical debt' and give two examples of how it accumulates. How does it affect long-term code maintenance?
Example 15
easyWhat is a 'magic number' and why is it a maintenance risk?
Example 16
easyName the four types of software maintenance.
Example 17
easyWhy update dependencies regularly? (best reason)
Example 18
hardTwo engineers fix the same bug by editing the same lines on separate branches. What is the standard term for the conflict, and what is the resolution discipline?
Example 19
challengeA team is asked: 'rewrite or refactor this 10-year-old monolith?'. State the principle that biases the answer.
Example 20
mediumA team faces a messy module. Option A: incremental refactor with tests. Option B: full rewrite. Which is generally safer?