0% found this document useful (0 votes)
8 views16 pages

OSS MCQs

Uploaded by

Ammar Khaggah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views16 pages

OSS MCQs

Uploaded by

Ammar Khaggah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

1. What is the primary purpose of coding standards?

A) To make code look aesthetically pleasing


B) To ensure code is consistent, readable, and maintainable
C) To reduce the number of comments in code
D) To enforce a single programming language for all projects

2. Which naming convention is commonly used for variable and function names in Python?
A) CamelCase
B) PascalCase
C) snake_case
D) kebab-case

3. What is the recommended way to name constants in most programming languages?


A) camelCase
B) snake_case
C) ALL_CAPS_WITH_UNDERSCORES
D) lowercase

4. How many spaces per indentation level are generally recommended in Python?
A) 2
B) 4
C) 8
D) 1

5. What is the typical maximum recommended line length for code readability?
A) 50-60 characters
B) 80-100 characters
C) 120-140 characters
D) No limit

6. Which of the following best describes the purpose of comments in code?


A) Explain every line of code
B) Explain why the code was written in a certain way
C) Replace variable names with explanations
D) Avoid the need for readable code

7. Which of these tools is commonly used for linting JavaScript code?


A) PyTest
B) ESLint
C) JUnit
D) Flake8

8. What is unit testing?


A) Testing the entire system for bugs
B) Testing a single function or method in isolation
C) Testing the integration of all components
D) Running the code manually to check results

9. Which of the following tools is commonly used for unit testing in Python?
A) Jest
B) JUnit
C) PyTest
D) Selenium
10. What is the primary goal of integration testing?
A) To test individual units of code
B) To test how different components work together
C) To ensure code formatting follows guidelines
D) To document code changes

11. Which of the following is the best practice for writing commit messages?
A) Use the past tense to describe changes
B) Write messages in an imperative mood
C) Keep messages vague and brief
D) Avoid using commit messages

12. Which of the following is an example of a good commit message?


A) Fixed bug
B) feat: add search functionality to the homepage
C) Changed some stuff
D) Update

13. Why is documentation crucial in open-source projects?


A) To make the code look longer
B) To bridge the gap between creators and users/contributors
C) To replace the need for comments in code
D) To increase the project's complexity

14. What is the primary purpose of a README file?


A) To provide a summary of recent commits
B) To summarize the project's purpose, installation, usage, and contribution
guidelines
C) To serve as a log for all issues in the project
D) To list the project's licenses

15. Which of these is an example of API documentation content?


A) Team meeting notes
B) Function descriptions and usage examples
C) Personal developer preferences
D) Roadmaps for future projects

16. What is the benefit of tutorials and guides in documentation?


A) They serve as error logs
B) They help users achieve specific tasks and understand complex features
C) They replace the need for a README file
D) They provide test results for the project

17. What tool is commonly used for documenting Python projects?


A) JSDoc
B) MkDocs
C) Sphinx
D) ESLint

18. Which of the following is the best practice for writing clear documentation?
A) Using complex language to sound professional
B) Avoiding bullet points for simplicity
C) Using clear headings, bullet points, and concise language
D) Mixing multiple formats without consistency
19. What is a good way to contribute to open-source documentation?
A) Adding complex technical terms without explanation
B) Correcting errors, adding examples, and improving clarity
C) Removing all comments from the code
D) Changing the project's codebase without approval

20. What does keeping documentation updated involve?


A) Reviewing documentation only when a major bug is found
B) Updating documentation whenever new features or changes occur
C) Archiving old documentation permanently
D) Limiting updates to annual reviews only

21. Why is understanding project structure important in large open-source projects?


A) To reduce the size of the codebase
B) To aid maintainability and collaboration
C) To increase project complexity
D) To avoid documentation entirely

22. Which of the following is a standard directory for database models in a Python web
application?
A) views/
B) models/
C) templates/
D) static/

22. Which of the following is a standard directory for managing the presentation of data in a
Python web application?
A) views/
B) models/
C) templates/
D) static/

24. Which of the following directories in a Python web application typically contain files for
serving static assets such as images, CSS, and JavaScript?
A) views/
B) models/
C) templates/
D) static/

25. What does modular design in a codebase refer to?


A) Combining all logic into a single file
B) Separating functionality into discrete components
C) Using only object-oriented programming
D) Avoiding the use of functions and classes

26. Which IDE feature allows you to jump directly to a function or class definition?
A) Search and Replace
B) Go to Definition
C) Line Numbering
D) Debug Console

27. What command would you use to search for a function name across all files using
grep?
A) grep -v 'function_name' .
B) grep -r 'function_name' .
C) grep -n 'function_name' .
D) grep -f 'function_name' .

28. What is the primary purpose of the CONTRIBUTING.md file?


A) To describe the project's licensing
B) To explain how to submit contributions to the project
C) To document all completed tasks
D) To track bugs in the project

29. Which of these tools can be used to visualize code dependencies?


A) JSDoc
B) ESLint
C) pydeps
D) Prettier

30. What is the best practice for effective collaboration in large projects?
A) Avoiding code reviews
B) Providing constructive feedback during code reviews
C) Keeping contributions undocumented
D) Working without version control

31. How can you stay organized when collaborating in large projects?
A) Work only on the main branch
B) Follow the project's coding standards and keep your branch updated
C) Avoid updating your branch frequently
D) Ignore style guidelines
32. What is the benefit of using modular code organization?
A) It increases the number of files unnecessarily
B) It separates functionality into discrete components for easier management
C) It makes the code harder to understand
D) It requires fewer tests

33. What is the benefit of using feature branches when contributing to a project?
A) To test code without affecting the main codebase
B) To merge all features into the main branch instantly
C) To avoid writing tests
D) To keep code unreviewed

34. What is a key feature of CI tools?


A) Manual deployment
B) Automatic build, test, and deploy
C) Lack of scalability
D) No version control integration

35. Why should you use CI tools?


A) To complicate the build process
B) To improve code quality and automate tasks
C) To avoid testing
D) To delay project delivery

36. How do CI tools provide real-time feedback?


A) By delaying notifications
B) Through integrations with version control systems
C) By ignoring build failures
D) By hiding test results

37. What does scalability mean in CI tools?


A) Limited project support
B) Support for multiple projects and configurations
C) Single configuration support
D) Fixed environment setup

38. Which version control systems can CI tools integrate with?


A) Only GitHub
B) Only GitLab
C) GitHub, GitLab, and other version control systems
D) None

39. What is the primary goal of an open-source license?


a) To prevent any use of the software
b) To specify how software can be used, modified, and distributed
c) To ensure the software is used exclusively for commercial purposes
d) To grant software users full control over the source code

40. Which of the following is a permissive open-source license?


a) GNU General Public License (GPL)
b) MIT License
c) Lesser General Public License (LGPL)
d) Affero General Public License (AGPL)
41. What is the key characteristic of a copyleft license like the GNU GPL?
a) Derivative works must also be licensed under the GPL
b) It allows integration into proprietary software
c) It does not require attribution
d) It allows use in commercial projects without restrictions

42. What is required when redistributing software under the MIT License?
a) Make the source code available to the public
b) Include the original license and copyright notice
c) Ensure all derivative works are licensed under MIT
d) Provide a copy of the GPL license

43. What is the key feature of the Apache License 2.0 that is not present in the MIT License?
a) Patent grant for contributors' patents
b) Strict copyleft requirements
c) A requirement for source code availability
d) Prohibition of proprietary use

44. What does a Contributor License Agreement (CLA) help to clarify?


a) The number of contributions allowed per user
b) The ownership and legal rights for contributions
c) The license type for a project
d) The software distribution model
45. Which type of CLA is typically signed by companies?
a) Individual CLA
b) Corporate CLA
c) Contributor’s Rights CLA
d) Project Maintainer CLA

46. Which intellectual property (IP) protects the original expression of ideas in software
code?
a) Patents
b) Trademarks
c) Copyright
d) Trade Secrets

47. What is a key risk associated with using open-source software under improper
licensing?
a) Misuse of trademarks
b) Non-compliance with license terms
c) Lack of proper documentation
d) Violation of contributor agreements

48. Which of the following is generally not covered by open-source licenses?


a) Copyright
b) Patents
c) Trademarks
d) Redistribution rights
49. Which of the following statements is true about combining code under different open-
source licenses?
a) All open-source licenses are compatible with each other.
b) You must ensure that the licenses of combined code do not conflict.
c) Copyleft licenses allow you to combine code with proprietary licenses freely.
d) Permissive licenses are incompatible with all other licenses.

50. Which open-source license specifically includes a patent retaliation clause,


terminating the license if a user sues for patent infringement?
a) MIT License
b) Apache License 2.0
c) GNU General Public License (GPL)
d) Creative Commons

51. What is the primary purpose of a code review?


A) To write code faster
B) To identify bugs, ensure quality, and improve maintainability
C) To generate documentation
D) To meet deadlines

52. What is the first step in the code review process?


A) Reviewer leaves comments
B) Author writes the code and creates a pull request
C) Code is merged into the main branch
D) Continuous Integration (CI) checks are run

53. How should feedback in a code review be provided?


A) Vague and general
B) Constructive, specific, and respectful
C) Harsh and direct
D) Focused solely on grammar

54. What is the purpose of timeboxing in code reviews?


A) To extend the review period for detailed analysis
B) To focus on small, manageable changes and avoid long reviews
C) To rush the review process
D) To reduce the number of reviewers

55. What is one of the best practices for a reviewer during a code review?
A) Ignore the PR description
B) Provide timely feedback and focus on collaboration
C) Reject any changes without suggestions
D) Avoid leaving comments on code readability

56. What should the author do before submitting a code for review?
A) Write clean, readable code and document changes
B) Avoid writing tests
C) Only focus on functionality
D) Ignore code standards

57. What is the role of automated tools in the code review process?
A) Replace human reviewers
B) Verify code correctness, style compliance, and run tests before human review
C) Write a code
D) Merge the code into the main branch
58. What is one common mistake to avoid in a code review?
A) Focusing on high-level design
B) Rushing the review process
C) Focusing only on the logic
D) Reviewing code too slowly

59. What should reviewers focus on during a code review?


A) The coder’s personal style
B) Functionality, readability, performance, and security
C) Only the length of the code
D) Personal opinions

60. What is the key challenge in open-source code reviews?


A) Limited time zones for contributors and reviewers
B) Having too many tools for collaboration
C) Reviewers always being available
D) Complete control by maintainers

61. What is an example of feedback that is not constructive?


A) “The function might fail in edge cases, could you handle them?”
B) “This code is a mess, it’s wrong.”
C) “Consider renaming the variable for clarity.”
D) “This approach might cause issues with negative input.”

62. What should a contributor do before submitting a pull request in an open-source


project?
A) Write detailed documentation and explain decisions
B) Submit without any context
C) Avoid following contribution guidelines
D) Ignore existing coding standards

63. What is an example of constructive feedback?


A) “This looks wrong, fix it.”
B) “The logic might fail with empty inputs; can you handle that case?”
C) “This is a disaster, try again.”
D) “The code doesn’t make sense to me.”

64. Why is it important to focus on the code, not the person, in a review?
A) To avoid conflict and focus on improvement
B) To criticize the coder
C) To disregard personal feedback
D) To encourage competition

65. What is one key principle of high-quality code?


A) Make the code as short as possible
B) Follow project and industry coding standards
C) Write code that only you understand
D) Avoid using comments

66. What is the primary goal of giving feedback during a code review?
A) To demotivate the coder
B) To help improve the code and foster learning
C) To criticize the author harshly
D) To show superiority in knowledge

67. What should you do when receiving feedback that seems unclear?
A) Ignore the feedback
B) Ask for examples or clarification
C) Dispute the feedback immediately
D) Refuse to make any changes

68. What is a key element of writing high-quality code?


A) Write everything in a single function
B) Keep functions short, clear, and focused on a single responsibility
C) Use the most complex algorithms
D) Avoid testing

69. How can you handle feedback on personal style choices during a review?
A) Ignore the team standards
B) Discuss your approach while being open to team guidelines
C) Reject any feedback that challenges your style
D) Argue for your approach without listening

70. What is the last step in the code review process?


A) Review the code
B) Merge the code after it is approved
C) Write new tests
D) Write a pull request description

You might also like