OSS MCQs
OSS MCQs
2. Which naming convention is commonly used for variable and function names in Python?
A) CamelCase
B) PascalCase
C) snake_case
D) kebab-case
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
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
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
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/
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' .
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
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
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
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
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
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
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