Showing 531–540 of 654 questions
Which data structure uses LIFO (Last In First Out)?
A
Queue
B
Stack
C
Array
D
Tree
Explanation:
Stack follows LIFO principle. Queue follows FIFO. Array and Tree are not strictly LIFO/FIFO structures
In OOP, what is inheritance?
A
Creating multiple instances of a class
B
A class acquiring properties of another class
C
Hiding internal implementation details
D
Creating interfaces
Correct Answer:
B. A class acquiring properties of another class
Explanation:
Inheritance allows a class to inherit properties and methods from another class (parent/base class)
Which sorting algorithm has the best average case time complexity?
A
Bubble Sort
B
Quick Sort
C
Insertion Sort
D
Selection Sort
Correct Answer:
B. Quick Sort
Explanation:
Quick Sort has O(n log n) average case complexity, which is optimal among comparison-based sorts
What is the output of: System.out.println(10 / 3) in Java?
Explanation:
Both operands are integers, so integer division is performed: 10 / 3 = 3 (truncated)
What is the main purpose of normalization in databases?
A
To increase query speed
B
To reduce data redundancy
C
To add more tables
D
To encrypt data
Correct Answer:
B. To reduce data redundancy
Explanation:
Database normalization organizes data to minimize redundancy and improve data integrity
Which of the following is a characteristic of Microservices architecture?
A
Single large monolithic codebase
B
Small, independent, loosely coupled services
C
Tightly integrated components
D
Single database for all services
Correct Answer:
B. Small, independent, loosely coupled services
Explanation:
Microservices architecture emphasizes small, independent services that communicate through APIs
What does REST API stand for?
A
Resource Exchange Standard Transfer API
B
Representational State Transfer API
C
Reliable Essential Service Transfer API
D
Rapid Endpoint Service Technology API
Correct Answer:
B. Representational State Transfer API
Explanation:
REST stands for Representational State Transfer, an architectural style for web services
In a relational database, a Primary Key must be:
A
Non-unique
B
Unique and not null
C
Can contain null values
D
Can be duplicated
Correct Answer:
B. Unique and not null
Explanation:
A Primary Key uniquely identifies each record and cannot contain null values
What will be the output? int x = 5; System.out.println(++x + x++);
Explanation:
++x increments x to 6 first, then x++ uses 6 and increments to 7. So 6 + 6 = 12
Which of the following is an advantage of Cloud Computing?
A
Limited scalability
B
No internet required
C
On-demand resource availability and cost efficiency
D
Complete data isolation
Correct Answer:
C. On-demand resource availability and cost efficiency
Explanation:
Cloud computing provides scalability, flexibility, and pay-as-you-go pricing models