CCS Programming Fundamentals 1 — Questions and Answers
Question 1: What is the purpose of version control in software development?
- To track changes, enable collaboration, and maintain code history (Correct answer)
- To backup files to an external drive
- To count the number of lines of code written
- To monitor developer productivity
Correct answer: To track changes, enable collaboration, and maintain code history
Version control systems track all code changes, enabling team collaboration and providing a complete history of modifications.
Question 2: What is the DRY principle in programming?
- Dont Repeat Yourself — avoid code duplication (Correct answer)
- Document, Review, Yield
- Delete Redundant Yields
- Debug and Run Yearly
Correct answer: Dont Repeat Yourself — avoid code duplication
DRY means every piece of knowledge should have a single, unambiguous representation in a system, reducing redundancy.
Question 3: What is the difference between compiled and interpreted languages?
- Compiled code is translated to machine code before execution; interpreted code is translated line by line during execution (Correct answer)
- There is no practical difference
- Compiled languages are always faster
- Interpreted languages cannot be used for web development
Correct answer: Compiled code is translated to machine code before execution; interpreted code is translated line by line during execution
Compiled languages are fully translated before execution, while interpreted languages are translated during runtime.
Question 4: What is the purpose of unit testing?
- To verify that individual components of code work correctly in isolation (Correct answer)
- To test the entire application at once
- To check network connectivity
- To measure code performance only
Correct answer: To verify that individual components of code work correctly in isolation
Unit tests verify individual components in isolation, catching bugs early and making code more maintainable.
Question 5: What is an algorithm?
- A step-by-step procedure for solving a problem or accomplishing a task (Correct answer)
- A type of programming language
- A hardware component of a computer
- A network protocol
Correct answer: A step-by-step procedure for solving a problem or accomplishing a task
An algorithm is a finite sequence of well-defined instructions for solving a specific problem or performing a computation.
Question 6: What is the purpose of code review?
- To identify bugs, improve code quality, and share knowledge among team members (Correct answer)
- To slow down the development process
- To assign blame for errors
- To satisfy management reporting requirements only
Correct answer: To identify bugs, improve code quality, and share knowledge among team members
Code review improves quality through peer examination, catches defects early, and spreads knowledge across the team.
What is the purpose of version control in software development?