Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

State true or false: Exclusive locks are held until transaction commit in degree two consistency(a) True(b) FalseI have been asked this question in an international level competition.This interesting question is from Insert, Delete Operations and Predicate Reads in division Concurrency Control of RDBMS

Answer»

Correct ANSWER is (a) True

The explanation is: Exclusive locks are held until TRANSACTION commit in DEGREE two CONSISTENCY, no transaction can read an uncommitted value.

2.

Which of the following does cursor stability ensure(a) The tuple that is currently being processed by the iteration is locked in shared mode(b) The tuple that is currently being processed is not locked in shared mode(c) Any modified tuples are not locked in exclusive mode(d) None of the mentionedThis question was posed to me during an interview for a job.This interesting question is from Insert, Delete Operations and Predicate Reads in portion Concurrency Control of RDBMS

Answer»

The correct answer is (a) The tuple that is currently being processed by the iteration is LOCKED in SHARED MODE

Explanation: Cursor stability ensures that the tuple that is currently being processed by the iteration is locked in shared mode and any modified tuples are locked in exclusive mode until the transaction COMMITS.

3.

To prevent the phantom phenomenon, _______ is used(a) Key value locking(b) Next key locking(c) Previous key locking(d) None of the mentionedThe question was asked in unit test.My question comes from Insert, Delete Operations and Predicate Reads in chapter Concurrency Control of RDBMS

Answer»

Right option is (B) Next key locking

The explanation is: The failure of a system to PREVENT a non SERIALIZED tuple when two transactions CONFLICT with each other is called as phantom phenomenon. To prevent the phantom phenomenon, the next key locking is used.

4.

State true or false: Key value locking provides increased concurrency(a) True(b) FalseThe question was asked in exam.My question comes from Insert, Delete Operations and Predicate Reads in chapter Concurrency Control of RDBMS

Answer»

The correct OPTION is (a) True

Best explanation: Key VALUE locking PROVIDES increased concurrency. Using key value improperly however might cause PHANTOM PHENOMENON to occur.

5.

Transactions that involve user interactions are called __________(a) Validations(b) Conversations(c) Interfaces(d) None of the mentionedThis question was addressed to me in an interview for job.I'm obligated to ask this question of Insert, Delete Operations and Predicate Reads in chapter Concurrency Control of RDBMS

Answer»

Correct option is (b) Conversations

The explanation: TRANSACTIONS that involve user INTERACTIONS are called as conversation. These are NAMED DIFFERENTLY to differentiate them from regular transactions. Validation using VERSION numbers is very useful for such transactions.

6.

_________ is a form of two degree consistency designed for programs that iterate over tuples of a relation by using cursors.(a) Cursor stability(b) Serializability(c) Non-serializability(d) Predicate lockingThe question was posed to me in homework.I'm obligated to ask this question of Insert, Delete Operations and Predicate Reads in division Concurrency Control of RDBMS

Answer»

Right answer is (a) Cursor stability

For explanation I WOULD say: Cursor stability is a form of two degree CONSISTENCY designed for programs that iterate over tuples of a RELATION by USING cursors. It ENSURES that the tuple that is currently being processed is locked in shared mode and any modified tuples are locked in exclusive mode until the transaction commits.

7.

Which of the following is included in the operational mechanism of the index locking protocol?(a) Every transaction must have at least one index(b) A transaction that performs a lookup must acquire a shared lock on all the index leaf nodes that it accesses(c) The rule of the two phase locking mechanism must be observed(d) All of the mentionedI have been asked this question by my school teacher while I was bunking the class.Origin of the question is Insert, Delete Operations and Predicate Reads in chapter Concurrency Control of RDBMS

Answer» RIGHT choice is (d) All of the mentioned

The best explanation: The operational MECHANISM of the index LOCKING PROTOCOL includes, every transaction must have at least one index. A transaction that performs lookup must acquire a shared lock on all the index leaf nodes that it ACCESSES. The rule of the two phase locking mechanism must be followed.
8.

Which of the following does not lock the entire index(a) Phantom locking(b) Phantom problem(c) Index locking(d) Index problemI had been asked this question in an online quiz.I need to ask this question from Insert, Delete Operations and Predicate Reads in section Concurrency Control of RDBMS

Answer» CORRECT answer is (c) Index locking

Explanation: Index locking avoids locking the entire index. Any transaction that inserts a tuple into a relation MUST insert information into EVERY index MAINTAINED on the relation.
9.

________ deletes a data item from a database(a) Delete(Q)(b) Insert(Q)(c) Drop(Q)(d) None of the mentionedI had been asked this question by my college professor while I was bunking the class.My doubt stems from Insert, Delete Operations and Predicate Reads in chapter Concurrency Control of RDBMS

Answer» RIGHT option is (a) Delete(Q)

BEST explanation: Delete(Q) deletes a data item from a database. INSERT(Q) inserts a new data item Q into the database and assign Q an initial value.
10.

Which of the following transactions can multiversion two phase locking protocol not differentiate.(a) Read only transactions(b) Update transactions(c) All of the mentioned(d) Double operator transactionsI had been asked this question in an international level competition.My doubt is from Multiversion Schemes, Snapshot Isolation in division Concurrency Control of RDBMS

Answer» CORRECT answer is (d) Double OPERATOR TRANSACTIONS

Best explanation: The multiversion two phase locking protocol cannot differentiate double operator transactions but it can differentiate between READ only transactions and update transactions.
11.

In ________ no two aborts occur unless two concurrent transactions update the same data item.(a) Multiversion scheme(b) Timestamp protocol(c) Lock based protocol(d) Snapshot isolationI have been asked this question in a job interview.My question is taken from Multiversion Schemes, Snapshot Isolation in portion Concurrency Control of RDBMS

Answer»

The correct OPTION is (d) Snapshot isolation

Easy EXPLANATION: In snapshot isolation no TWO aborts OCCUR unless two concurrent transactions update the same data item. This makes snapshot isolation attractive but it does not ensure serializability.

12.

State true or false: Snapshot isolation has low overhead(a) True(b) FalseThis question was addressed to me in a national level competition.My question is based upon Multiversion Schemes, Snapshot Isolation in portion Concurrency Control of RDBMS

Answer»

Correct answer is (a) True

The best EXPLANATION: SNAPSHOT isolation is attractive in PRACTICE because it has a relatively very LOW overhead.

13.

Oracle uses __________ for the serializable isolation level(a) Multiversion scheme(b) Timestamp protocol(c) Lock based protocol(d) Snapshot isolationThe question was asked in my homework.My question is from Multiversion Schemes, Snapshot Isolation in section Concurrency Control of RDBMS

Answer»

The correct option is (d) Snapshot ISOLATION

Easy EXPLANATION: Oracle USES snapshot isolation for the serializable isolation level. POSTGRESQL also uses only snapshot isolation for the serializable isolation level.

14.

The situation in which each pair of transactions has read a data written by the other, but there is no data written by the transactions is called as _______(a) Deadlock(b) Read skew(c) Deadlock skew(d) Write skewThe question was asked during an online interview.The query is from Multiversion Schemes, Snapshot Isolation in portion Concurrency Control of RDBMS

Answer»

The correct choice is (d) WRITE skew

The explanation: The situation in which each pair of transactions has read a data written by the other, but there is no data written by the transactions is CALLED as write skew.

15.

Under ________ the system uses locking mechanism that applies only to updates(a) First updater wins(b) First committer wins(c) First writer wins(d) None of the mentionedThis question was addressed to me by my college director while I was bunking the class.I'd like to ask this question from Multiversion Schemes, Snapshot Isolation in chapter Concurrency Control of RDBMS

Answer»

Correct OPTION is (a) FIRST updater wins

To elaborate: Under first updater wins, the system USES a locking mechanism that applies only to UPDATES. Read OPERATIONS do not get affected by this mechanism.

16.

Which of the following is a variant of snapshot isolation(a) First committer wins(b) First updater wins(c) More than one of the mentioned(d) None of the mentionedI had been asked this question by my college director while I was bunking the class.This interesting question is from Multiversion Schemes, Snapshot Isolation topic in chapter Concurrency Control of RDBMS

Answer»

Correct OPTION is (c) More than one of the mentioned

The best I can explain: First committer WINS and first updater wins are two DIFFERENT variations of SNAPSHOT ISOLATION.

17.

State true or false: Snapshot isolation prevents lost updates(a) True(b) FalseThis question was posed to me in an international level competition.I'd like to ask this question from Multiversion Schemes, Snapshot Isolation in section Concurrency Control of RDBMS

Answer»

Correct choice is (a) True

To explain I would SAY: Snapshot ISOLATION prevents LOST UPDATES because it does not allow two transactions to simultaneously WRITE on the same database.

18.

If the first update is overwritten by a second, it is called as a _______ update(a) Useful(b) Overlapping(c) Lost(d) ConcurrentThis question was posed to me in an online interview.I would like to ask this question from Multiversion Schemes, Snapshot Isolation topic in section Concurrency Control of RDBMS

Answer» RIGHT option is (c) LOST

The explanation is: If the FIRST update is overwritten by a second, it is called as a lost update. This generally occurs whenever TWO transactions are allowed to write on the database.
19.

In _______ schemes, each write operation creates a new version of Q(a) Multiversion(b) Snapshot isolation(c) Lock based(d) TimestampThe question was asked in examination.My query is from Multiversion Schemes, Snapshot Isolation topic in portion Concurrency Control of RDBMS

Answer»

The correct choice is (a) Multiversion

Easiest explanation: In multiversion SCHEMES, each write operation CREATES a new VERSION of Q. When a TRANSACTION ISSUES a read operation, the concurrency control manager selects one of the versions of Q to be read.

20.

State true or false: We determine the serializability order of validation protocol by the validation ordering technique(a) True(b) FalseThe question was asked in an online interview.My question comes from Validation Based Protocols topic in portion Concurrency Control of RDBMS

Answer»

The correct OPTION is (B) False

The best explanation: We determine the serializability order of the validation protocol by the TIMESTAMP ordering TECHNIQUE. There is no technique called as the validation ordering technique to determine the serializability order of the validation protocol.

21.

State true or false: Locking and timestamp ordering force a wait or rollback whenever a conflict is detected.(a) True(b) FalseThe question was asked during an interview.My enquiry is from Validation Based Protocols topic in division Concurrency Control of RDBMS

Answer»

The correct option is (a) True

Explanation: LOCKING and timestamp ordering FORCE a wait or ROLLBACK whenever a conflict is detected. This property is called PESSIMISM of locking and timestamp PROTOCOLS.

22.

Which of the following timestamps is used to record the time when a database has completed its write operation?(a) Start(i)(b) Validation(i)(c) Finish(i)(d) Write(i)The question was asked in semester exam.This intriguing question originated from Validation Based Protocols topic in section Concurrency Control of RDBMS

Answer»

Correct option is (c) Finish(i)

The EXPLANATION: There are three different timestamps for each transaction START(i), VALIDATION(i), finish(i). Finish(i) is used to RECORD the time when a transaction has finished its WRITE phase.

23.

Which of the following timestamps is used to record the time when a transaction has finished its read phase?(a) Start(i)(b) Validation(i)(c) Finish(i)(d) Write(i)I have been asked this question in an interview for job.I'm obligated to ask this question of Validation Based Protocols in portion Concurrency Control of RDBMS

Answer»

Right option is (b) Validation(i)

Easy EXPLANATION: There are three different timestamps for each transaction START(i), validation(i), finish(i). The validation phase is used to record the TIME at which a transaction has FINISHED its read phase and has STARTED its validation phase.

24.

Which of the following timestamp is used to record the time at which the transaction started execution?(a) Start(i)(b) Validation(i)(c) Finish(i)(d) Write(i)This question was addressed to me during an online interview.My enquiry is from Validation Based Protocols in division Concurrency Control of RDBMS

Answer» RIGHT choice is (a) Start(i)

To EXPLAIN I would say: There are three different timestamps for each TRANSACTION start(i), validation(i), finish(i). Start(i) is USED to record the time at which the transaction EXECUTION started.
25.

Read only operations omit the _______ phase(a) Read phase(b) Validation phase(c) Write phase(d) None of the mentionedI got this question at a job interview.This question is from Validation Based Protocols in chapter Concurrency Control of RDBMS

Answer»

The correct choice is (c) Write phase

The best explanation: READ only operations do not ALLOW write OPERATION to be performed on them. So, they omit the write phase but EXECUTE the read and VALIDATION phases.

26.

During the _______ phase, the local variables that hold the write operations are copied to the database(a) Read phase(b) Validation phase(c) Write phase(d) None of the mentionedThe question was posed to me during an online interview.I'd like to ask this question from Validation Based Protocols topic in section Concurrency Control of RDBMS

Answer»

Right CHOICE is (c) Write PHASE

Explanation: During the write phase, the local variables that hold the write operations are copied to the DATABASE. READ only operations omit this phase.

27.

During the _________ phase the validation test is applied to the transaction(a) Read phase(b) Validation phase(c) Write phase(d) None of the mentionedI got this question in semester exam.My question is based upon Validation Based Protocols in portion Concurrency Control of RDBMS

Answer»

Right OPTION is (b) Validation phase

The explanation is: During the validation phase, the validation TEST is applied to the transaction. This DETERMINES whether the transaction is allowed to proceed or not WITHOUT CAUSING a violation of serializability.

28.

During __________ phase, the system reads data and stores them in variables local to the transaction.(a) Read phase(b) Validation phase(c) Write phase(d) None of the mentionedI have been asked this question in an online quiz.Question is taken from Validation Based Protocols topic in section Concurrency Control of RDBMS

Answer»

Right option is (a) Read phase

Best explanation: During the read phase, the system READS data and stores them in variables local to the transaction. It performs all write OPERATIONS on TEMPORARY local variables WITHOUT updates on the ACTUAL database.

29.

The _________ requires each transaction executes in two or three different phases in its lifetime(a) Validation protocol(b) Timestamp protocol(c) Deadlock protocol(d) View protocolI had been asked this question in examination.Query is from Validation Based Protocols in chapter Concurrency Control of RDBMS

Answer» CORRECT choice is (a) VALIDATION protocol

To EXPLAIN I would say: The validation protocol REQUIRES each transaction to execute in two or three different phases in its LIFETIME depending on whether it is a read only or an update transaction.
30.

In timestamp ordering protocol, suppose that the transaction Ti issues write(Q) and TS(Ti)

Answer»

Right option is (d) WRITE OPERATION is rejected

The best I can explain: In timestamp ordering protocol, suppose that the transaction TI issues write(Q) and TS(Ti)

31.

In timestamp ordering protocol, suppose that the transaction Ti issues read(Q) and TS(Ti)

Answer»

The correct choice is (b) Read operation is rejected

To EXPLAIN I WOULD say: Suppose that TRANSACTION Ti issues read(Q). If TS(Ti ) < W-timestamp(Q), then Ti needs to read a value of Q that was already overwritten. Hence, the read operation is rejected, and Ti is rolled BACK.

32.

Which of the following timestamp based protocols generates serializable schedules?(a) Thomas write rule(b) Timestamp ordering protocol(c) Validation protocol(d) None of the mentionedI got this question in a job interview.My question is based upon Timestamp based Protocols topic in portion Concurrency Control of RDBMS

Answer»

Right answer is (a) Thomas write RULE

The EXPLANATION is: Thomas write rule PROTOCOL generates serializable schedules that no other protocol can generate.

33.

State true or false: The Thomas write rule has a greater potential concurrency than the timestamp ordering protocol(a) True(b) FalseI got this question in examination.Asked question is from Timestamp based Protocols topic in section Concurrency Control of RDBMS

Answer»

Right answer is (a) True

Easy explanation: The Thomas write rule has a greater POTENTIAL CONCURRENCY than the timestamp ordering protocol. This is because it is a MODIFIED version of the timestamp ordering protocol in which obsolete write operations can be IGNORED under certain circumstances.

34.

The default timestamp ordering protocol generates schedules that are(a) Recoverable(b) Non-recoverable(c) Starving(d) None of the mentionedThe question was posed to me by my college professor while I was bunking the class.Origin of the question is Timestamp based Protocols in division Concurrency Control of RDBMS

Answer»

The correct answer is (B) Non-recoverable

Explanation: The timestamp ORDERING protocol GENERATES SCHEDULES that are non-recoverable. But it can be extended to MAKE the schedules recoverable.

35.

A ________ ensures that any conflicting read and write operations are executed in timestamp order(a) Organizational protocol(b) Timestamp ordering protocol(c) Timestamp execution protocol(d) 802-11 protocolThis question was addressed to me during an interview.I want to ask this question from Timestamp based Protocols topic in division Concurrency Control of RDBMS

Answer»

Right OPTION is (B) TIMESTAMP ORDERING protocol

To explain: A timestamp ordering protocol ensures that any conflicting read and write operations are executed in timestamp order.

36.

R-timestamp(Q) denotes?(a) The largest timestamp of any transaction that can execute write(Q) successfully(b) The largest timestamp of any transaction that can execute read(Q) successfully(c) The smallest timestamp of any transaction that can execute write(Q) successfully(d) The smallest timestamp of any transaction that can execute read(Q) successfullyThis question was posed to me in my homework.This is a very interesting question from Timestamp based Protocols topic in division Concurrency Control of RDBMS

Answer»

Correct OPTION is (b) The LARGEST timestamp of any TRANSACTION that can execute read(Q) successfully

The best EXPLANATION: R-timestamp(Q) denoted the largest timestamp of any transaction that can execute read(Q) successfully.

37.

W-timestamp(Q) denotes?(a) The largest timestamp of any transaction that can execute write(Q) successfully(b) The largest timestamp of any transaction that can execute read(Q) successfully(c) The smallest timestamp of any transaction that can execute write(Q) successfully(d) The smallest timestamp of any transaction that can execute read(Q) successfullyThe question was posed to me in a job interview.Question is taken from Timestamp based Protocols topic in division Concurrency Control of RDBMS

Answer»

The CORRECT CHOICE is (a) The LARGEST timestamp of any transaction that can execute write(Q) successfully

Explanation: W-timestamp(Q) denotes The largest timestamp of any transaction that can execute write(Q) successfully.

38.

A logical counter is _________ after a new timestamp has been assigned(a) Incremented(b) Decremented(c) Doubled(d) Remains the sameThe question was posed to me in exam.This question is from Timestamp based Protocols in division Concurrency Control of RDBMS

Answer»

The correct option is (a) INCREMENTED

To explain I would say: A logical COUNTER is incremented after a NEW timestamp has been ASSIGNED everytime.

39.

Which of the following cannot be used to implement a timestamp(a) System clock(b) Logical counter(c) External time counter(d) None of the mentionedI have been asked this question by my college director while I was bunking the class.My question is taken from Timestamp based Protocols in portion Concurrency Control of RDBMS

Answer»

The correct ANSWER is (c) External time counter

For explanation: An external time counter cannot be USED to implement a timestamp. System clock and a LOGICAL counter can be used.

40.

Which of the following steps must be taken while choosing a victim?(a) Avoiding starvation(b) Number of transactions involved in rollback(c) Data items used by the transaction(d) All of the mentionedThis question was posed to me by my college professor while I was bunking the class.My question comes from Deadlock Handling topic in section Concurrency Control of RDBMS

Answer»

The correct answer is (d) All of the mentioned

The best I can explain: While CHOOSING a victim we MUCH choose the ONE with a minimum cost. That is the one which AVOIDS starvation, the one with the least number of TRANSACTION involved in the rollback and the one with the least amount of data items used.

41.

State true or false: Partial rollback is not possible.(a) True(b) FalseThe question was posed to me by my college director while I was bunking the class.My question is based upon Deadlock Handling topic in portion Concurrency Control of RDBMS

Answer»

The correct choice is (b) False

The explanation is: Partial rollback is possible but it REQUIRES the system too MAINTAIN an additional AMOUNT of information on the states of the TRANSACTIONS.

42.

How do we generally recover from a deadlock?(a) By aborting all the transactions(b) By rolling back all the transactions(c) By rolling back only a selected number of transactions(d) None of the mentionedI have been asked this question in semester exam.My question is based upon Deadlock Handling in chapter Concurrency Control of RDBMS

Answer» RIGHT option is (C) By rolling back only a selected number of transactions

Explanation: We generally RECOVER from DEADLOCKS by rolling back only a selected number of transactions
43.

The _________ graph describes deadlocks precisely(a) Wound wait graph(b) Wait die graph(c) Wait for graph(d) None of the mentionedI had been asked this question in an internship interview.My query is from Deadlock Handling in section Concurrency Control of RDBMS

Answer»

The CORRECT option is (c) WAIT for GRAPH

For explanation I would say: The wait for graph describes deadlocks PRECISELY. Existence of a cycle in this graph implies that a deadlock will occur.

44.

Lock timeouts have which of the following advantages?(a) Unnecessary rollbacks do not occur(b) Transactions do not starve(c) It is easy to implement(d) All of the mentionedI have been asked this question at a job interview.This intriguing question originated from Deadlock Handling topic in chapter Concurrency Control of RDBMS

Answer»

Right answer is (d) All of the mentioned

The EXPLANATION: In lock timeout METHOD, unnecessary rollbacks do not occur, TRANSACTIONS do not starve and it is also easy to implement and is HENCE WIDELY used if transactions are short and long waits are likely to be due to deadlocks.

45.

State true or false: Wait die scheme is a non-preemptive technique(a) True(b) FalseThis question was posed to me in an online interview.The doubt is from Deadlock Handling topic in chapter Concurrency Control of RDBMS

Answer»

Right answer is (a) True

To EXPLAIN: The wait-die scheme is a non-preemptive technique. When transaction Ti requests a data item currently held by Tj , Ti is allowed to wait only if it has a TIMESTAMP SMALLER than that of Tj (that is, Ti is OLDER than Tj ). Otherwise, Ti is rolled BACK (dies).

46.

Deadlocks can be prevented using(a) Preemption and transaction rollbacks(b) Wait and die scheme(c) Wound-wait scheme(d) All of the mentionedI had been asked this question by my school teacher while I was bunking the class.Enquiry is from Deadlock Handling in division Concurrency Control of RDBMS

Answer»

The CORRECT OPTION is (d) All of the mentioned

For explanation I would say: PREEMPTION and transaction rollbacks, wait and DIE scheme, wound wait scheme are all different methods of deadlock prevention.

47.

Which of the following is not a method in deadlock handling(a) Deadlock prevention(b) Deadlock detection(c) Deadlock recovery(d) Deadlock distributionI had been asked this question in quiz.I would like to ask this question from Deadlock Handling in section Concurrency Control of RDBMS

Answer»

Correct OPTION is (d) Deadlock distribution

Easiest explanation: Deadlock distribution is not a method in deadlock HANDLING whereas, deadlock prevention is followed by deadlock detection and deadlock RECOVERY.

48.

A system is in a _______ state if there exists a set of transactions in which every transaction is waiting for another transaction in the set.(a) Deadlock(b) Starved(c) Isolated(d) None of the mentionedThis question was posed to me by my college director while I was bunking the class.This is a very interesting question from Deadlock Handling in chapter Concurrency Control of RDBMS

Answer»

The CORRECT CHOICE is (a) Deadlock

The EXPLANATION: A SYSTEM is in a deadlock state if there EXISTS a set of transactions in which every transaction is waiting for another transaction in the set.

49.

If a transaction may release locks but may not obtain any locks, it is said to be in ______ phase(a) Growing phase(b) Shrinking phase(c) Deadlock phase(d) Starved phaseThe question was asked in exam.My query is from Lock Based Protocols topic in section Concurrency Control of RDBMS

Answer»

The correct CHOICE is (b) SHRINKING phase

For explanation: If a transaction MAY release locks but may not obtain any locks, it is SAID to be in shrinking phase. Shrinking phase is a phase in two PHASED locking protocol.

50.

If a transaction may obtain locks but may not release any locks then it is in _______ phase(a) Growing phase(b) Shrinking phase(c) Deadlock phase(d) Starved phaseI had been asked this question during an online interview.Enquiry is from Lock Based Protocols topic in division Concurrency Control of RDBMS

Answer»

Correct option is (a) GROWING phase

The BEST EXPLANATION: If a transaction may OBTAIN locks but may not RELEASE any locks then it is in growing phase. Growing phase is a phase in two phased locking protocol.