ICT Software Development Concepts 5 — Questions and Answers
Question 1: What is the primary difference between 'stack' and 'heap' memory in programming?
- Stack is for long-term storage; heap is for temporary computation
- Stack is managed automatically with LIFO allocation; heap is manually managed with dynamic allocation (Correct answer)
- Stack stores only integers; heap stores objects
- Stack is slower than heap for all operations
Correct answer: Stack is managed automatically with LIFO allocation; heap is manually managed with dynamic allocation
Stack memory is automatically managed in a last-in, first-out manner for function calls, while heap memory is dynamically allocated at runtime.
Question 2: What does 'dead code' refer to in software development?
- Code that causes the application to crash
- Code that is never executed or reachable during normal program execution (Correct answer)
- Deprecated library functions
- Code written in an obsolete programming language
Correct answer: Code that is never executed or reachable during normal program execution
Dead code is source code that is never executed at runtime, often because it is unreachable or its results are never used.
Question 3: In agile development, what is the purpose of a 'retrospective' meeting?
- To plan the work for the next sprint
- To demonstrate completed features to stakeholders
- To reflect on the past sprint and identify process improvements (Correct answer)
- To estimate effort for upcoming user stories
Correct answer: To reflect on the past sprint and identify process improvements
A retrospective is held at the end of each sprint for the team to inspect their process and create a plan for improvements.
Question 4: What is 'code coverage' in software testing?
- The number of developers who have reviewed the code
- The percentage of source code lines or branches executed during automated tests (Correct answer)
- The total number of test cases written for a project
- The ratio of comments to lines of code
Correct answer: The percentage of source code lines or branches executed during automated tests
Code coverage measures the percentage of code executed by a test suite, helping identify untested portions of the application.
Question 5: Which security vulnerability occurs when an attacker injects malicious scripts into content viewed by other users?
- SQL Injection
- Cross-Site Scripting (XSS) (Correct answer)
- Buffer Overflow
- Man-in-the-Middle Attack
Correct answer: Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS) allows attackers to inject malicious client-side scripts into web pages viewed by other users.
Question 6: What is the main purpose of using 'design patterns' in software development?
- To enforce a specific programming language syntax
- To provide reusable solutions to commonly occurring design problems (Correct answer)
- To automatically generate documentation
- To replace the need for testing
Correct answer: To provide reusable solutions to commonly occurring design problems
Design patterns are reusable solutions to common software design problems, providing proven templates that speed up development and improve communication.
Question 7: What does 'containerization' using tools like Docker provide for software deployment?
- Automatic code generation from specifications
- A consistent, isolated environment that packages application code with all its dependencies (Correct answer)
- Built-in encryption for all network traffic
- A graphical interface for managing server resources
Correct answer: A consistent, isolated environment that packages application code with all its dependencies
Containerization packages an application with all its dependencies into a portable unit, ensuring consistent behavior across different environments.
What is the primary difference between 'stack' and 'heap' memory in programming?