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 isolation level prevents dirty reads, phantom reads, and non-repeatable reads?
Serializable
click to copy
Dirty read in databases occurs when?
Transaction reads uncommitted data from another transaction
click to copy
Phantom read occurs when?
Same query returns different rows in same transaction due to another transaction's INSERT/DELETE
click to copy
Database sharding is?
Horizontal partitioning of data across multiple database instances
click to copy
Read replica in databases is used for?
Scaling read operations — copy of primary database for SELECT queries
click to copy
Connection pooling in applications?
Reuses existing database connections from a pool — improves performance
click to copy
ORM (Object Relational Mapping) maps?
Object-oriented code classes to database tables automatically
click to copy
Which NoSQL type stores data as key-value pairs?
Key-value store
click to copy
Which data type in Python is immutable?
Tuple
click to copy
Python list comprehension [x*2 for x in range(5)] produces?
[0,2,4,6,8]
click to copy
What does len([1,2,3,4,5]) return in Python?
5
click to copy
Python dictionary key must be?
Immutable (string, int, tuple)
click to copy
Which Python keyword is used to handle exceptions?
except
click to copy
What is the output of print(type(3.14)) in Python?
<class 'float'>
click to copy
Python's 'pass' statement?
Does nothing — placeholder for empty code block
click to copy
Which Python function converts integer to string?
str()
click to copy
Python range(1,10,2) generates?
[1,3,5,7,9]
click to copy
Lambda in Python is?
An anonymous function defined in one line
click to copy
What does *args in Python function mean?
Variable number of positional arguments as tuple
click to copy
**kwargs in Python?
Variable number of keyword arguments as dictionary
click to copy
Python decorator is used to?
Wrap a function to modify or extend its behavior without changing its code
click to copy
Generator in Python uses which keyword?
yield
click to copy
Python 'with' statement is used for?
Context management — automatically handles resource cleanup (close files)
click to copy
What does __init__ method do in Python class?
Constructor — initializes a new object instance's attributes
click to copy
Inheritance in Python is defined as?
class Child(Parent):
click to copy
Python multiple inheritance is?
Supported — class C(A, B): inherits from both A and B
click to copy
MRO (Method Resolution Order) in Python?
Order in which Python searches classes for method/attribute in inheritance
click to copy
Python __str__ method is called by?
print() function and str() conversion
click to copy
What is the output of 5//2 in Python?
2
click to copy
Python operator ** is used for?
Exponentiation (power)
click to copy
Which Python module is used for regular expressions?
re
click to copy
os.path.join() in Python is used for?
Building file paths in an OS-independent way
click to copy
Which Python library is used for HTTP requests?
requests
click to copy
JSON module in Python provides?
Encoding/decoding JSON data (json.dumps, json.loads)
click to copy
Python f-strings (f'Hello {name}') provide?
Inline expression evaluation within strings (formatted string literals)
click to copy
Which Python keyword checks membership in a sequence?
in
click to copy
enumerate() in Python?
Returns index-value pairs when iterating over a sequence
click to copy
What is the output of bool('') in Python?
False
click to copy
Python None is?
Null equivalent — absence of value
click to copy

Computer Fundamentals → Software and Hardware 1

Python's GIL (Global Interpreter Lock) affects?
Multi-threading — prevents true parallel execution of Python threads in CPython
click to copy