Showing 101–110 of 150 questions
Q.101
Medium
Database/SQL
Which data structure is best suited for implementing a priority queue?
A
Stack
B
Queue
C
Heap
D
Linked List
Explanation:
A heap (binary heap) efficiently implements priority queues with O(log n) insertion and deletion of minimum/maximum elements.
Q.102
Medium
Database/SQL
In SQL, what is the difference between INNER JOIN and LEFT JOIN?
A
INNER JOIN returns all rows; LEFT JOIN returns only matching rows
B
INNER JOIN returns only matching rows; LEFT JOIN returns all rows from left table
C
Both are identical in functionality
D
INNER JOIN is faster than LEFT JOIN always
Correct Answer:
B. INNER JOIN returns only matching rows; LEFT JOIN returns all rows from left table
Explanation:
INNER JOIN returns only rows with matches in both tables. LEFT JOIN returns all rows from the left table plus matching rows from the right table.
Q.103
Medium
Database/SQL
Which cloud service model provides virtualized computing resources over the internet?
A
SaaS (Software as a Service)
B
IaaS (Infrastructure as a Service)
C
PaaS (Platform as a Service)
D
DaaS (Database as a Service)
Correct Answer:
B. IaaS (Infrastructure as a Service)
Explanation:
IaaS provides infrastructure resources (compute, storage, networking). SaaS provides applications, PaaS provides development platforms.
Q.104
Medium
Database/SQL
What is the primary purpose of database indexing?
A
Increase storage space
B
Improve query performance
C
Reduce security vulnerabilities
D
Eliminate data redundancy
Correct Answer:
B. Improve query performance
Explanation:
Indexes speed up data retrieval by creating optimized lookup structures, reducing the number of disk accesses needed to find data.
Q.105
Medium
Database/SQL
In cybersecurity, what does encryption primarily protect against?
A
Physical theft of devices
B
SQL injection attacks
C
Unauthorized access to data during transmission
D
Database schema changes
Correct Answer:
C. Unauthorized access to data during transmission
Explanation:
Encryption converts data into unreadable format, protecting it from unauthorized access during transmission and storage.
Q.106
Medium
Database/SQL
Which sorting algorithm has the best average-case time complexity?
A
Bubble Sort - O(n²)
B
Merge Sort - O(n log n)
C
Insertion Sort - O(n²)
D
Selection Sort - O(n²)
Correct Answer:
B. Merge Sort - O(n log n)
Explanation:
Merge Sort and Quick Sort have O(n log n) average complexity. Merge Sort guarantees this; Quick Sort can degrade to O(n²) in worst case.
Q.107
Medium
Database/SQL
What is the primary function of a query optimizer in a DBMS?
A
Compile SQL queries into machine code
B
Determine the most efficient execution plan for queries
C
Encrypt sensitive data in queries
D
Validate SQL syntax errors
Correct Answer:
B. Determine the most efficient execution plan for queries
Explanation:
The query optimizer analyzes different execution strategies and selects the one with minimal resource consumption and execution time.
Q.108
Medium
Database/SQL
In machine learning basics, what is the purpose of training data in AI models?
A
To test the final model accuracy
B
To teach the model patterns and make predictions
C
To validate model security
D
To encrypt sensitive information
Correct Answer:
B. To teach the model patterns and make predictions
Explanation:
Training data is used to teach AI models to recognize patterns. Test data evaluates accuracy; validation data prevents overfitting.
Q.109
Medium
Database/SQL
Which data structure is best suited for implementing a LRU (Least Recently Used) cache?
A
Hash Map + Doubly Linked List
B
Single Array
C
Binary Search Tree
D
Queue only
Correct Answer:
A. Hash Map + Doubly Linked List
Explanation:
LRU cache requires O(1) access and O(1) removal/insertion of least-used items. Hash Map provides O(1) lookup, and Doubly Linked List maintains order efficiently.
Q.110
Medium
Database/SQL
Which normalization form eliminates transitive dependencies?
A
Third Normal Form (3NF)
B
Second Normal Form (2NF)
C
First Normal Form (1NF)
D
Boyce-Codd Normal Form (BCNF)
Correct Answer:
A. Third Normal Form (3NF)
Explanation:
3NF removes transitive dependencies where non-key attributes depend on other non-key attributes. BCNF is stricter but 3NF eliminates transitive dependencies.