Computer Knowledge — Database/SQL
Programming, networking, database and OS questions
18 Questions 5 Topics Take Test
Advertisement
Showing 1–10 of 18 questions in Database/SQL
Q.1 Hard Database/SQL
In a sharded database architecture deployed on cloud infrastructure, which of the following represents the most critical challenge that must be addressed?
A Shard key selection and distribution skew
B Implementing full-text search across shards
C Eliminating all network latency between shards
D Converting all queries to read-only operations
Correct Answer:  A. Shard key selection and distribution skew
EXPLANATION

Shard key selection determines data distribution and performance. Poor shard key choices lead to hotspots, uneven load distribution, and performance degradation across the sharded cluster.

Take Test
Q.2 Hard Database/SQL
In AI/ML, what is the role of activation functions in neural networks?
A Encrypt network weights
B Introduce non-linearity enabling networks to learn complex patterns
C Increase training speed
D Reduce dataset size
Correct Answer:  B. Introduce non-linearity enabling networks to learn complex patterns
EXPLANATION

Activation functions (ReLU, sigmoid, tanh) add non-linearity, allowing neural networks to approximate non-linear relationships.

Take Test
Q.3 Hard Database/SQL
What is the primary challenge of implementing ACID properties in distributed databases?
A Requires minimal network latency
B Network partitions, latency, and node failures make maintaining consistency difficult while ensuring availability
C Distributed systems automatically ensure ACID
D Only centralized databases can support ACID
Correct Answer:  B. Network partitions, latency, and node failures make maintaining consistency difficult while ensuring availability
EXPLANATION

The CAP theorem shows it's impossible to guarantee all three: Consistency, Availability, and Partition tolerance simultaneously.

Take Test
Q.4 Hard Database/SQL
In distributed systems, what is a consensus algorithm primarily used for?
A Encrypting data
B Ensuring all nodes agree on a single value despite failures
C Compressing database files
D Load balancing across servers
Correct Answer:  B. Ensuring all nodes agree on a single value despite failures
EXPLANATION

Consensus algorithms (like Raft, Paxos) enable distributed systems to reliably agree on state even with node failures.

Take Test
Q.5 Hard Database/SQL
In database normalization, what does the Boyce-Codd Normal Form (BCNF) address that 3NF might miss?
A Elimination of multivalued dependencies
B Removal of anomalies from composite candidate keys
C Prevention of circular foreign keys
D Ensuring data type consistency
Correct Answer:  B. Removal of anomalies from composite candidate keys
EXPLANATION

BCNF handles edge cases in 3NF where anomalies can occur with composite candidate keys where determinants are not candidate keys themselves.

Take Test
Advertisement
Q.6 Hard Database/SQL
In a B-tree of order m, what is the maximum number of keys that a non-root node can contain?
A m-1
B m
C 2m-1
D 2m
Correct Answer:  C. 2m-1
EXPLANATION

A B-tree of order m can have at most 2m-1 keys in any node and minimum m-1 keys in non-root nodes.

Take Test
Q.7 Hard Database/SQL
What is the primary advantage of using GraphQL over traditional REST APIs in modern application architecture?
A GraphQL always provides better performance
B GraphQL allows clients to request only required data fields, reducing over-fetching
C GraphQL eliminates the need for databases
D REST APIs are completely replaced by GraphQL
Correct Answer:  B. GraphQL allows clients to request only required data fields, reducing over-fetching
EXPLANATION

GraphQL's query language enables clients to specify exact data requirements, eliminating over-fetching and under-fetching issues common in REST.

Take Test
Q.8 Hard Database/SQL
In cybersecurity, what is SQL injection and why is it a critical vulnerability in 2024?
A Injecting SQL commands to execute unauthorized database operations
B A performance optimization technique
C A method to improve database security
D An outdated vulnerability no longer relevant
Correct Answer:  A. Injecting SQL commands to execute unauthorized database operations
EXPLANATION

SQL injection allows attackers to insert malicious SQL code through application inputs, remaining a critical OWASP Top 10 vulnerability despite awareness.

Take Test
Q.9 Hard Database/SQL
Which of the following best describes a distributed transaction and its challenges in microservices architecture?
A Transactions that execute only on primary databases
B Transactions spanning multiple services requiring coordination and handling failures
C Transactions that cannot be executed in microservices
D Local transactions that never require coordination
Correct Answer:  B. Transactions spanning multiple services requiring coordination and handling failures
EXPLANATION

Distributed transactions in microservices require mechanisms like Saga pattern or Two-Phase Commit to maintain consistency across services.

Take Test
Q.10 Hard Database/SQL
In database replication, what is the primary difference between synchronous and asynchronous replication?
A Synchronous is always faster
B Asynchronous waits for replica confirmation; Synchronous does not
C Synchronous waits for replica confirmation; Asynchronous does not
D Both have identical performance characteristics
Correct Answer:  C. Synchronous waits for replica confirmation; Asynchronous does not
EXPLANATION

Synchronous replication waits for replicas to acknowledge writes (safer but slower), while asynchronous replication doesn't wait (faster but less safe).

Take Test
IGET
iget AI
Online · Ask anything about exams
Hi! 👋 I'm your iget AI assistant.

Ask me anything about exam prep, MCQ solutions, study tips, or strategies! 🎯
UPSC strategy SSC CGL syllabus Improve aptitude NEET Biology tips