Quick Revision

GK One-Line Question & Answer

15541+ short questions with short answers, covering every category and sub-category on the site — no long articles to scroll through. Good for a fast recap before an exam, or a few minutes of daily practice.

Computer Fundamentals → Introduction to Computer 39

Which scheduling policy is used for real-time tasks in Linux?
SCHED_FIFO or SCHED_RR
click to copy
I/O scheduler in Linux determines?
Order and priority of I/O requests to storage devices
click to copy
Which I/O scheduler is best for SSDs?
None/mq-deadline
click to copy
Futex (Fast Userspace muTEX) in Linux?
Operates mostly in userspace — falls to kernel only on contention
click to copy
Lock-free data structures use?
Atomic operations to ensure thread safety without locks
click to copy
ABA problem in lock-free programming occurs when?
Value changes A→B→A appearing unchanged to CAS, causing incorrect operation
click to copy
B+ tree advantages over B-tree for database indexing?
All data in leaf nodes + linked leaves enable efficient range queries
click to copy
LSM tree (Log-Structured Merge tree) is used in?
Write-optimized databases like LevelDB, RocksDB, Cassandra
click to copy
Skip list provides?
O(log n) average search with probabilistic balance (simpler than balanced BST)
click to copy
Consistent hashing is used in?
Distributed systems for even load distribution as nodes join/leave
click to copy
CAP theorem states a distributed system can guarantee only two of?
Consistency, Availability, Partition tolerance
click to copy
In CAP theorem, CP system prioritizes?
Consistency and Partition tolerance — may be unavailable during partition
click to copy
AP system in CAP theorem?
Prioritizes Availability and Partition tolerance — may return stale data
click to copy
PACELC theorem extends CAP by also considering?
Latency vs Consistency tradeoff when no partition exists
click to copy
MapReduce programming model consists of?
Map phase (parallel processing) + Reduce phase (aggregation)
click to copy
Apache Hadoop uses MapReduce on?
HDFS distributed file system across cluster
click to copy
Apache Spark is faster than MapReduce because?
In-memory processing instead of disk I/O between stages
click to copy
Directed Acyclic Graph (DAG) in Spark represents?
Task execution plan with dependencies
click to copy
Stream processing vs batch processing: stream processes?
Data in real time as it arrives
click to copy
Apache Kafka is a?
Distributed event streaming platform (message queue)
click to copy
Kafka topic partition allows?
Parallel consumption and horizontal scaling
click to copy
Event sourcing pattern stores?
All state changes as immutable sequence of events
click to copy
CQRS (Command Query Responsibility Segregation) separates?
Read (query) and write (command) data models
click to copy
Saga pattern in microservices handles?
Distributed transactions through sequence of local transactions with compensations
click to copy
Circuit breaker pattern in microservices?
Prevents cascading failures by stopping requests to failing service
click to copy
Service discovery in microservices allows?
Dynamic detection of service instances and their locations
click to copy
Which algorithm detects cycles in a directed graph?
DFS with coloring (White-Gray-Black)
click to copy
Articulation point in a graph is?
Vertex whose removal disconnects the graph
click to copy
Tarjan's algorithm finds?
Strongly Connected Components (SCCs) in directed graph
click to copy
Kosaraju's algorithm for SCCs performs how many DFS passes?
2
click to copy
Maximum flow problem solution includes?
Ford-Fulkerson / Edmonds-Karp algorithm
click to copy
Fenwick tree (Binary Indexed Tree) is used for?
Efficient prefix sum queries and point updates in O(log n)
click to copy
Segment tree supports?
Range queries and range updates in O(log n)
click to copy
Sparse table is used for?
Static range minimum/maximum queries in O(1) after O(n log n) preprocessing
click to copy
Disjoint Set Union (DSU/Union-Find) with path compression and union by rank achieves?
Near O(1) amortized per operation (inverse Ackermann function)
click to copy
Knuth-Morris-Pratt (KMP) string matching algorithm runs in?
O(n+m) using failure function
click to copy
Gradient descent optimization minimizes?
Loss function by iteratively adjusting weights
click to copy
Mini-batch gradient descent uses?
Small random subset of samples per update
click to copy
Adam optimizer combines?
RMSprop and Momentum — adaptive learning rates per parameter
click to copy

Computer Fundamentals → Memory Units 1

Stochastic Gradient Descent (SGD) differs from batch GD in?
Updates weights using single random sample per iteration
click to copy