Software Engineering Trivia 4 — Questions and Answers
Question 1: What does the term 'idempotent' mean when describing an HTTP method?
- The request always returns the same response body
- Making multiple identical requests has the same effect as one (Correct answer)
- The request cannot be cached
- The request must include authentication
Correct answer: Making multiple identical requests has the same effect as one
An idempotent operation produces the same server state regardless of how many times it is applied, making retries safe.
Question 2: Which software development methodology emphasizes iterative development, collaboration, and responding to change over following a fixed plan?
- Waterfall
- Agile (Correct answer)
- Six Sigma
- CMMI
Correct answer: Agile
Agile methodologies value individuals and interactions, working software, customer collaboration, and responding to change as stated in the Agile Manifesto.
Question 3: In a relational database, what does the term 'normalization' primarily aim to reduce?
- Query execution time
- Data redundancy and anomalies (Correct answer)
- Index fragmentation
- Number of table joins
Correct answer: Data redundancy and anomalies
Normalization organizes tables to minimize redundancy and dependency, preventing update, insert, and delete anomalies.
Question 4: What is a 'memory leak' in software engineering?
- When a program reads uninitialized memory
- When allocated memory is never freed after use (Correct answer)
- When two processes share the same memory address
- When a pointer references a freed memory block
Correct answer: When allocated memory is never freed after use
A memory leak occurs when a program allocates heap memory but loses all references to it without freeing it, gradually exhausting available memory.
Question 5: Which of the following best describes 'continuous integration' (CI)?
- Deploying code to production automatically after every commit
- Frequently merging code changes into a shared repository and running automated builds and tests (Correct answer)
- Writing tests before writing production code
- Integrating third-party APIs into the codebase regularly
Correct answer: Frequently merging code changes into a shared repository and running automated builds and tests
CI is the practice of automatically building and testing code every time a developer pushes changes, catching integration errors early.
Question 6: What is the main advantage of using an index in a database table?
- It reduces storage space for the table
- It enforces referential integrity between tables
- It speeds up data retrieval at the cost of additional storage and write overhead (Correct answer)
- It automatically removes duplicate rows
Correct answer: It speeds up data retrieval at the cost of additional storage and write overhead
Database indexes create auxiliary data structures that allow the engine to locate rows quickly without scanning the full table, trading write speed for read speed.
Question 7: In object-oriented design, what does 'encapsulation' refer to?
- Creating multiple classes from a single base class
- Bundling data and the methods that operate on that data within a single unit and restricting direct access (Correct answer)
- Writing code that works with multiple data types
- Replacing conditional logic with polymorphism
Correct answer: Bundling data and the methods that operate on that data within a single unit and restricting direct access
Encapsulation hides internal state and implementation details behind a public interface, reducing coupling and protecting data integrity.
What does the term 'idempotent' mean when describing an HTTP method?