WorksheetsTech Tournament Knockouts QF-1
Total questions: 20
Worksheet time: 30mins
Which principle of OOP refers to bundling data and methods into a single unit?
Encapsulation
Inheritance
Polymorphism
Abstraction
Which OOP principle allows an object to take many forms depending on context?
Polymorphism
Inheritance
Composition
Aggregation
Assertion (A): Abstract classes can have both abstract and non-abstract methods. Reason (R): Abstraction hides implementation details while providing a blueprint for derived classes.
A true, R true, R explains A
A true, R true, R does not explain A
A true, R false
A false, R true
I ensure that one interface can be used for multiple implementations. Who am I?
Overloading
Overriding
Polymorphism
Abstraction
Consider a scenario: A base class defines a method, and a derived class replaces it with its own implementation at runtime. This is an example of:
Static binding
Method overloading
Method overriding
Encapsulation
A system is designed with multiple inheritance. Which of the following issues is most commonly associated with this design?
Runtime polymorphism failure
Diamond problem
Data abstraction violation
Method hiding
Which normal form eliminates partial dependency?
1NF
2NF
3NF
BCNF
A transaction in DBMS must follow the ACID properties. The "I" stands for:
Integrity
Isolation
Independence
Indexing
Which of the following anomalies occurs when a transaction reads the same data twice and gets different results due to another concurrent transaction’s updates?
Lost update
Dirty read
Non-repeatable read
Phantom read
Consider two transactions: T1: Reads X, increments by 10, writes X T2: Reads X, decrements by 5, writes X If run concurrently without locking, what problem may occur?
Phantom read
Cascading abort
Lost update
Deadlock
In a database system using strict two-phase locking, which of the following is TRUE?
Deadlocks cannot occur under strict 2PL
Cascading rollbacks cannot occur under strict 2PL
Dirty reads are possible under strict 2PL
Phantom reads are eliminated under strict 2PL
Consider a relation R(A, B, C, D) with functional dependencies: • A → B • C → D • AC → B Which of the following is a candidate key?
A only
AC
AD
CD
Which of the following scenarios benefits the most from a bitmap index?
A table with millions of rows and high-cardinality attributes
A small lookup table with unique keys
A fact table column storing gender values (Male/Female/Other)
A relation with frequent range queries on numeric data
Fill in the blank: In OOP, using (a) avoids tight coupling by preferring composition over inheritance.
Which join returns all rows when there is a match in one of the tables?
INNER JOIN
FULL OUTER JOIN
CROSS JOIN
LEFT JOIN
In strict 2PL, when are locks released?
After each operation
After read phase
At commit/abort
At scheduler’s discretion
In Java OOP, which of the following cannot be overridden (non-virtual)?
Constructor
Instance method
Abstract method
Overridden method
In OOP, what is the diamond problem mainly related to?
Function overloading
Multiple inheritance
Dynamic binding
Encapsulation
Two interfaces provide the same default method. Implementing class without override:
First wins
Last wins
Compile error
Runtime error
Which SQL statement adds a NOT NULL constraint on column age?
ALTER TABLE emp ADD NOT NULL(age);
ALTER TABLE emp ADD CONSTRAINT age NOT NULL;
ALTER TABLE emp MODIFY age NOT NULL;
ALTER TABLE emp DROP age NOT NULL;
