CAD Structure & Design — Questions and Answers
Question 1: Which design principle ensures that an application is easy to maintain and scale?
- Monolithic design
- Modular design (Correct answer)
- Hardcoded logic
- Redundant coding
Correct answer: Modular design
Modular design ensures an application is easy to maintain and scale by breaking it down into smaller, independent, and interchangeable components. This approach simplifies understanding, testing, and debugging, as changes in one module are less likely to impact others. Furthermore, modularity enhances scalability by allowing individual components to be developed, deployed, or scaled independently, efficiently adapting to increased load or new features.
Question 2: What is the primary advantage of using an MVC (Model-View-Controller) architecture in application development?
- Increases database storage
- Separates concerns for better maintainability (Correct answer)
- Removes the need for testing
- Eliminates the use of controllers
Correct answer: Separates concerns for better maintainability
The primary advantage of MVC (Model-View-Controller) architecture is that it separates concerns, dividing an application into distinct components for data/logic (Model), user interface (View), and input handling (Controller). This separation makes the codebase more organized, easier to understand, and significantly improves maintainability. It also allows multiple developers to work on different parts of the application concurrently, enhancing development efficiency and flexibility.
Question 3: Which tool is commonly used for version control in application development?
- JIRA
- Git (Correct answer)
- Docker
- Postman
Correct answer: Git
Git is a distributed version control system widely used in application development to track changes in source code. It allows multiple developers to collaborate efficiently on a project, manage different versions of the code, and revert to previous states if necessary. Git's robust branching and merging capabilities are essential for maintaining code integrity and facilitating teamwork.
Question 4: What is the purpose of continuous integration (CI) in application development?
- Manually test every code change
- Automate merging and testing of code changes (Correct answer)
- Increase manual debugging
- Reduce code documentation
Correct answer: Automate merging and testing of code changes
The purpose of continuous integration (CI) is to automate the merging and testing of code changes frequently throughout the development cycle. Developers regularly integrate their work into a shared repository, triggering automated builds and tests. This practice quickly identifies and addresses integration issues and bugs, ensuring the codebase remains stable and functional, and reducing the time and effort needed for debugging later.
Question 5: Which testing method is used to verify individual units of code?
- Regression testing
- Unit testing (Correct answer)
- Integration testing
- Load testing
Correct answer: Unit testing
Unit testing is the testing method used to verify individual units or components of code in isolation. A 'unit' typically refers to the smallest testable part of an application, such as a function or method. This granular testing helps identify bugs early in the development cycle, ensuring that each part of the code works as expected before being integrated with other components, thus improving overall code quality.
Question 6: Which principle promotes code reusability and maintainability in software design?
- WET (Write Everything Twice)
- DRY (Don't Repeat Yourself) (Correct answer)
- YOLO (You Only Live Once)
- KISS (Keep It Simple, Stupid)
Correct answer: DRY (Don't Repeat Yourself)
The DRY (Don't Repeat Yourself) principle promotes code reusability and maintainability by advocating that every piece of knowledge or logic should have a single, unambiguous representation within a system. By avoiding redundant code, developers reduce the overall size of the codebase, make it easier to maintain, and minimize inconsistencies when changes are needed. This approach enhances efficiency and improves software quality.
Which design principle ensures that an application is easy to maintain and scale?