Showing 131–140 of 150 questions
Q.131
Medium
Database/SQL
Which of the following is a correct SQL syntax for creating an index on multiple columns?
A
CREATE INDEX idx_name ON table_name (col1, col2);
B
CREATE UNIQUE INDEX idx_name ON table_name (col1, col2);
C
CREATE INDEX idx_name ON table_name COLUMNS (col1, col2);
D
Both A and B are correct
Correct Answer:
D. Both A and B are correct
Explanation:
Both syntaxes are valid in SQL. The first creates a composite index, while the second creates a unique composite index.
Q.132
Medium
Database/SQL
Which sorting algorithm has the best average-case time complexity for randomly distributed data?
A
Bubble Sort - O(n²)
B
Quick Sort - O(n log n)
C
Insertion Sort - O(n²)
D
Selection Sort - O(n²)
Correct Answer:
B. Quick Sort - O(n log n)
Explanation:
Quick Sort has O(n log n) average-case complexity, making it most efficient for random data. Though worst-case is O(n²), randomized pivot selection minimizes this risk.
Q.133
Medium
Database/SQL
What does ACID compliance in databases ensure?
A
Data is always encrypted
B
Atomicity, Consistency, Isolation, and Durability of transactions
C
Automatic data compression
D
Asynchronous data backup
Correct Answer:
B. Atomicity, Consistency, Isolation, and Durability of transactions
Explanation:
ACID is a fundamental database property: Atomicity (all-or-nothing), Consistency (valid state), Isolation (concurrent independence), Durability (permanent after commit).
Q.134
Medium
Database/SQL
Which cloud service model provides pre-configured application environments?
A
IaaS (Infrastructure as a Service)
B
PaaS (Platform as a Service)
C
SaaS (Software as a Service)
D
DaaS (Database as a Service)
Correct Answer:
B. PaaS (Platform as a Service)
Explanation:
PaaS provides a complete development and deployment environment in the cloud, including pre-configured tools and frameworks.
Q.135
Medium
Database/SQL
Which of the following best describes a graph data structure with no cycles?
A
Directed Graph
B
Tree
C
Complete Graph
D
Bipartite Graph
Explanation:
A tree is a special case of a graph with no cycles. It has n nodes and n-1 edges, forming a hierarchical structure.
Q.136
Medium
Database/SQL
In machine learning, what does overfitting mean?
A
The model is too simple to learn patterns
B
The model learns training data too well, including noise, reducing generalization to new data
C
The model has too many layers
D
The model requires more training data
Correct Answer:
B. The model learns training data too well, including noise, reducing generalization to new data
Explanation:
Overfitting occurs when a model learns the training data including its noise and irregularities, performing poorly on unseen test data.
Q.137
Medium
Database/SQL
What is the primary advantage of using MongoDB (NoSQL) over traditional relational databases?
A
It provides ACID compliance on all operations
B
It has flexible schema that accommodates unstructured data and horizontal scalability
C
It uses SQL for all queries
D
It requires less storage space
Correct Answer:
B. It has flexible schema that accommodates unstructured data and horizontal scalability
Explanation:
MongoDB's document-based model allows flexible schemas for unstructured data and supports horizontal scaling, unlike rigid relational schemas.
Q.138
Medium
Database/SQL
In operating systems, what is a deadlock?
A
When a process terminates unexpectedly
B
When two or more processes are blocked, each waiting for resources held by the other
C
When memory is exhausted
D
When the CPU stops functioning
Correct Answer:
B. When two or more processes are blocked, each waiting for resources held by the other
Explanation:
Deadlock is a situation where multiple processes cannot proceed because each holds resources needed by others, creating a circular wait condition.
Q.139
Medium
Database/SQL
What is the correct order of operations for the Big O notation from least to most complex?
A
O(1) < O(n) < O(n²) < O(2ⁿ) < O(n!)
B
O(n!) < O(2ⁿ) < O(n²) < O(n) < O(1)
C
O(n) < O(1) < O(n²) < O(2ⁿ) < O(n!)
D
O(log n) > O(1) > O(n) > O(n²)
Correct Answer:
A. O(1) < O(n) < O(n²) < O(2ⁿ) < O(n!)
Explanation:
Constant O(1) is fastest, followed by logarithmic O(log n), linear O(n), quadratic O(n²), exponential O(2ⁿ), and factorial O(n!) which is slowest.
Q.140
Medium
Database/SQL
Which normalization form eliminates all non-key dependencies?
Explanation:
3NF (Third Normal Form) ensures all non-key attributes depend only on the primary key, eliminating transitive dependencies.