Programming
Programming
a) A set of instructions that a computer follows 5. What does the acronym ASCII stand for?
a) A fixed value that cannot be changed 7. Which of the following is an arithmetic operator?
11. Which of the following is a type of loop? 15. What is syntax in programming?
b) A step-by-step procedure for solving a problem a) The process of translating source code into
machine code all at once
c) A type of data structure
b) The process of translating and executing source
d) A programming language
code line by line
d) Abstraction
19. What is a flowchart?
a) A programming language
23. What is a string in programming?
b) A graphical representation of an algorithm
a) A numerical data type
c) A type of data structure
b) A sequence of characters
d) A function in programming
c) A type of loop
a) A way of organizing and storing data a) A type of loop that iterates a specific number of
times
b) A type of loop
b) A function that calls itself
c) A function in programming
c) A way of defining variables
d) A programming language
d) A data structure
27. What is a list in programming? 31. Which of the following is a core principle of OOP?
a) A collection of key-value pairs a) The process of hiding data and methods within a
class
b) A type of loop
b) An instance of a class
c) A type of loop
33. What is inheritance?
a) The process of hiding data and methods within a 38. What is an abstract class?
class
a) A class that cannot be instantiated
b) The process of inheriting properties from a
b) A class that can be instantiated
parent class
c) A type of loop
c) The ability of an object to take on many forms
d) A way of defining variables
d) The ability to define multiple functions with the
same name
d) Debugger
b) Writing code that can be used in different parts a) A program that translates source code into
of the program or in other programs machine code all at once
c) Using only global variables b) A program that translates and executes source
code line by line
d) Ignoring modularity
c) A program that finds and fixes errors in code
43. Which of the following is a popular version control c) A program that finds and fixes errors in code
system? d) A program that writes code
a) Compiler
b) False
50. Which of the following is a common programming
paradigm? c) 5
a) Hardware programming d) 10
b) System programming
c) Procedural programming 53. What type of loop is best suited for iterating
through a known number of elements?
d) Network programming
a) While loop
b) Do-while loop
d) If-else statement 57. What is the term for converting a value from one
data type to another?
a) Casting
54. What is the output of the following code snippet
(assuming the programming language uses zero-based b) Compiling
indexing for arrays):
c) Interpreting
my_array = [10, 20, 30, 40]
print(my_array[2]) d) Debugging
a) 10
c) 30 a) `int("123")`
d) 40 b) `print("Hello")`
c) `x = 5 + 3`
55. What is the purpose of the modulus operator (%) d) `if x > 0:`
in programming?
56. What is the output of the following code snippet: d) A data type for storing large amounts of data
x = 15 % 4
print(x)
60. Which of the following is a valid Boolean value?
a) 3.75
a) 1
b) 1
b) 0
c) 3
c) "True"
d) 4
d) true
c) 1
66. What is a parameter in a function?
d) 0
a) A value returned by the function
b) A value that the function sends back to the caller 71. Which of the following is an advantage of using
modular programming?
c) A local variable within the function
a) Increased code complexity
d) A global variable
b) Easier debugging and maintenance
c) To store data
69. What is a global variable?
d) To execute the program
a) A variable defined within a function
c) A type of loop
70. What is the scope of a variable?
d) A function in programming
a) The data type of the variable
c) A type of loop
75. What is a stack (in computer science)?
d) A function in programming
a) A type of data structure that follows the LIFO
(Last-In, First-Out) principle
79. What is a graph (in computer science)?
b) A type of data structure that follows the FIFO
(First-In, First-Out) principle a) A linear data structure
c) A type of loop b) A hierarchical data structure
d) A function in programming c) A data structure consisting of nodes and edges
d) A type of loop
76. What is a queue (in computer science)?
a) A type of data structure that follows the LIFO 80. What is searching (in computer science)?
(Last-In, First-Out) principle
a) The process of sorting data
b) A type of data structure that follows the FIFO
(First-In, First-Out) principle b) The process of finding a specific element in a data
structure
c) A type of loop
c) The process of deleting data
d) A function in programming
d) The process of inserting data
c) Bubble sort
86. What is a constant time complexity, represented
d) Depth-first search
in Big O notation?
a) O(n)
83. What is time complexity?
b) O(log n)
a) A measure of the amount of memory used by an c) O(1)
algorithm
d) O(n^2)
b) A measure of the amount of time taken by an
algorithm to run
c) A measure of the length of the code 87. What is a linear time complexity, represented in
Big O notation?
d) A measure of the number of lines of code
a) O(n)
b) O(log n)
84. What is space complexity?
c) O(1)
a) A measure of the amount of time taken by an
algorithm to run d) O(n^2)
c) A measure of the amount of memory used by an 88. What is a logarithmic time complexity,
algorithm represented in Big O notation?
b) O(log n)
b) O(log n)
a) An instance of an object
91. What is encapsulation? b) A blueprint for creating objects
a) The process of hiding data and methods within a c) A type of loop
class
d) A function in programming
b) The process of inheriting properties from a parent
class
c) The ability of an object to take on many forms 95. What is an object in OOP?
d) The ability to define multiple functions with the a) A blueprint for creating classes
same name
b) An instance of a class
c) A type of loop
92. What is inheritance?
d) A function in programming
a) The process of hiding data and methods within a
class
b) The process of inheriting properties from a parent 96. What is an interface in programming?
class
c) A type of loop
d) Ignoring modularity
6. a) A symbol that performs a specific operation 24. b) Combining two or more strings
53. c) For loop 73. b) A variable that stores the memory address
of another variable
54. c) 30
74. b) The process of assigning memory space to
55. b) To find the remainder of a division variables or data structures
56. c) 3 75. a) A type of data structure that follows the
57. a) Casting LIFO (Last-In, First-Out) principle
86. c) O(1)
87. a) O(n)
88. b) O(log n)
89. d) O(n^2)