What is the purpose of a loop in programming?
A. To execute a specific set of instructions repeatedly.
B. To store data temporarily.
C. To perform mathematical calculations.
D. To create graphical user interfaces.
Which programming language is widely used for web development?
A. Python
B. Java
C. HTML
D. C++
What does HTML stand for?
A. Hyper Text Markup Language
B. High Technical Machine Language
C. Hyperlinks and Text Markup Language
D. Home Tool Markup Language
In object-oriented programming, what is encapsulation?
A. A process of hiding the internal details of an object.
B. A technique used to combine multiple objects into a single entity.
C. A method for organizing code into reusable blocks.
D. A way to define relationships between objects.
Which data structure follows the Last In, First Out (LIFO) principle?
A. Queue
B. Stack
C. Linked List
D. Array
What is the purpose of a constructor in object-oriented programming?
A. To initialize an object’s state.
B. To perform type conversions.
C. To handle exceptions.
D. To define a class hierarchy.
Which sorting algorithm has the best average-case time complexity?
A. Bubble Sort
B. Insertion Sort
C. Merge Sort
D. Selection Sort
What is the output of the following code snippet?
makefile
Copy code
x = 5
y = 2
print(x % y)
A. 0
B. 1
C. 2
D. 3
What is the purpose of the "elif” statement in Python?
A. To define a block of code that will be executed if a condition is true.
B. To specify the final block of code in a loop.
C. To handle exceptions in Python programs.
D. To provide an alternative condition to "if” statement.
What is the output of the following code snippet?
scss
Copy code
my_list = [1, 2, 3, 4, 5]
print(my_list[1:3])
A. [1, 2]
B. [2, 3]
C. [3, 4]
D. [2, 3, 4]
Difficulty Level: Moderate
Which keyword is used to define a function in Python?
A. define
B. function
C. def
D. create
What is the result of 2 + 3 * 4 – 6?
A. 3
B. 8
C. 14
D. 16
In object-oriented programming, what is inheritance?
A. A process of creating a new class from an existing class.
B. A technique for hiding the internal details of a class.
C. A way to define relationships between objects.
D. A method for organizing code into reusable blocks.
Which programming language is primarily used for developing mobile applications
A. Java
B. Python
C. Swift
D. C#
What is the purpose of the "for” loop in programming?
A. To execute a specific set of instructions repeatedly.
B. To make decisions based on conditions.
C. To store data temporarily.
D. To create graphical user interfaces.
What is the output of the following code snippet?
makefile
Copy code
my_string = "Hello, World!”
print(my_string[7:])
A. "Hello”
B. "World!”
C. "World”
D. "Hello, World!”
Which data structure is used to implement a First In, First Out (FIFO) queue?
A. Stack
B. Linked List
C. Array
D. Queue
What does CSS stand for?
A. Cascading Style Sheets
B. Computer Style Sheets
C. Creative Style Sheets
D. Colorful Style Sheets
Which programming language is commonly used for data analysis and scientific computing?
A. Java
B. C++
C. R
D. PHP
What is the output of the following code snippet?
go
Copy code
x = 10
y = 3
print(x // y)
A. 3.333
B. 3.0
C. 3
D. 3.33
Correct Answers:
A
C
A
A
B
A
C
A
D
B
C
B
A
C
A
C
D
A
C
C