#1
Which of the following is NOT a programming paradigm?
Relational
ExplanationRelational is not a programming paradigm; it's a database model.
#2
In Python, what will be the output of the following code?
x = 5
y = 2
print(x // y)
2
ExplanationThe double slash operator '//' performs integer division in Python, resulting in 2.
#3
What does the acronym 'SQL' stand for?
Structured Query Language
Explanation'SQL' stands for Structured Query Language, used for managing and manipulating databases.
#4
Which data structure follows the Last In, First Out (LIFO) principle?
Stack
ExplanationStack follows the Last In, First Out (LIFO) principle.
#5
What is the purpose of the 'else' statement in programming?
To define a default case when all other conditions are not met
Explanation'else' statement defines the action to be taken when the 'if' condition is false or not met.
#6
Which of the following is a dynamically typed programming language?
Python
ExplanationPython is dynamically typed, allowing variables to hold values of any type.
#7
What does the acronym 'JSON' stand for?
JavaScript Object Notation
Explanation'JSON' stands for JavaScript Object Notation, a lightweight data interchange format.
#8
Which of the following sorting algorithms has the best average-case time complexity?
Merge Sort
ExplanationMerge Sort has a time complexity of O(n log n) in the average case.
#9
What does the term 'recursion' refer to in programming?
A function calling itself
ExplanationRecursion is a programming technique where a function calls itself.
#10
Which of the following is NOT a valid variable name in Python?
1variable
ExplanationVariable names in Python cannot start with a number.
#11
Which of the following is a statically typed programming language?
Java
ExplanationJava is statically typed, meaning variable types are determined at compile time.
#12
What is the purpose of a constructor in object-oriented programming?
To initialize the object's state
ExplanationConstructors initialize the object's state or perform setup tasks when an object is created.
#13
What is the main advantage of using version control systems like Git?
Efficient collaboration and tracking changes
ExplanationVersion control systems like Git enable efficient collaboration and track changes in code.
#14
What does the term 'polymorphism' refer to in object-oriented programming?
Ability of a function to behave differently based on the object type
ExplanationPolymorphism allows a function to behave differently based on the object type it is called with.
#15
What does 'HTML' stand for in web development?
Hyper Text Markup Language
Explanation'HTML' stands for Hyper Text Markup Language, used for creating web pages.
#16
In object-oriented programming, what is encapsulation?
Binding data and methods that manipulate the data into a single unit
ExplanationEncapsulation is the bundling of data and methods that operate on the data, into a single unit or class.
#17
What does 'URL' stand for in web development?
Uniform Resource Locator
Explanation'URL' stands for Uniform Resource Locator, providing the address for resources on the internet.
#18
What is the main difference between 'GET' and 'POST' HTTP methods?
GET appends data to the URL, while POST sends data in the request body
ExplanationGET method appends data to the URL, visible to users, while POST sends data in the request body, keeping it hidden.
#19
What does the acronym 'IDE' stand for?
Integrated Development Environment
Explanation'IDE' stands for Integrated Development Environment, providing comprehensive facilities to programmers for software development.
#20
What is the purpose of the 'yield' keyword in Python?
To return a value from a generator function
Explanation'yield' keyword in Python is used to return a value from a generator function without terminating it.
#21
In C++, what keyword is used to dynamically allocate memory?
new
Explanation'new' is used in C++ to allocate memory dynamically during runtime.
#22
What does the acronym 'API' stand for in programming?
Application Programming Interface
Explanation'API' stands for Application Programming Interface, facilitating interaction between software components.
#23
What is the purpose of the 'break' statement in loops?
To exit the loop immediately
Explanation'break' statement terminates the loop it is in and transfers control to the statement immediately following the loop.
#24
What is the purpose of the 'finally' block in exception handling?
To execute a block of code regardless of whether an exception is thrown or not
Explanation'finally' block in exception handling ensures a block of code executes whether an exception is thrown or not.
#25
Which of the following is NOT a valid data type in JavaScript?
list
Explanation'list' is not a valid data type in JavaScript; it should be 'array'.