BPSC PGT Computer Science programming


1. Which of the following is NOT a programming language?
a) HTML
b) Python
c) Java
d) Photoshop

2. What is the purpose of a loop in programming?
a) To execute a block of code repeatedly
b) To store data for later use
c) To display output on the screen
d) To create a new variable

3. What is the difference between a compiler and an interpreter?
a) A compiler translates code into machine language, while an interpreter executes code directly.
b) A compiler executes code directly, while an interpreter translates code into machine language.
c) A compiler is used for web development, while an interpreter is used for desktop applications.
d) A compiler is used for mobile development, while an interpreter is used for gaming.

4. What is the purpose of a function in programming?
a) To execute a block of code repeatedly
b) To store data for later use
c) To display output on the screen
d) To group a block of code that can be reused

5. Which of the following is NOT a data type in programming?
a) Integer
b) String
c) Boolean
d) Circle

6. What is a conditional statement in programming?
a) A statement that is always executed
b) A statement that is executed only if a certain condition is met
c) A statement that is executed repeatedly
d) A statement that is used to define a function

7. What is an algorithm?
a) A sequence of steps to solve a problem
b) A type of programming language
c) A type of data structure
d) A type of computer hardware

8. What is the purpose of a variable in programming?
a) To store data for later use
b) To execute a block of code repeatedly
c) To display output on the screen
d) To group a block of code that can be reused

9. Which of the following is NOT a type of loop in programming?
a) For loop
b) While loop
c) If loop
d) Do-while loop

10. What is the purpose of debugging in programming?
a) To find and fix errors in code
b) To create new code
c) To display output on the screen
d) To store data for later use

11. What is the purpose of an array in programming?
a) To store multiple values in a single variable
b) To execute a block of code repeatedly
c) To display output on the screen
d) To group a block of code that can be reused

12. What is object-oriented programming?
a) A programming paradigm based on objects
b) A programming paradigm based on functions
c) A programming language
d) A type of data structure

13. Which of the following is NOT a programming paradigm?
a) Object-oriented programming
b) Procedural programming
c) Functional programming
d) Linear programming

14. What is the purpose of inheritance in object-oriented programming?
a) To allow a subclass to inherit properties and methods from a superclass
b) To create a new object
c) To store data for later use
d) To display output on the screen

15. What is the difference between a class and an object in object-oriented programming?
a) A class is a blueprint for creating objects, while an object is an instance of a class
b) A class is an instance of an object, while an object is a blueprint for creating classes
c) A class is used for web development, while an object is used for desktop applications
d) A class is used for mobile development, while an object is used for gaming

16. What is the purpose of encapsulation in object-oriented programming?
a) To hide implementation details from the user
b) To create a new object
c) To store data for later use
d) To display output on the screen

17. What is the purpose of polymorphism in object-oriented programming?
a) To allow objects of different classes to be treated as if they were the same type of object
b) To create a new object
c) To store data for later use
d) To display output on the screen

18. Which of the following is NOT a sorting algorithm?
a) Bubble sort
b) Merge sort
c) Quick sort
d) Print sort

19. What is the purpose of recursion in programming?
a) To solve a problem by breaking it down into smaller subproblems
b) To store data for later use
c) To display output on the screen
d) To execute a block of code repeatedly

20. What is a stack in programming?
a) A data structure that follows the Last-In-First-Out (LIFO) principle
b) A data structure that follows the First-In-First-Out (FIFO) principle
c) A type of loop
d) A type of sorting algorithm