Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
17 views12 pages

Programmer Topic Test - 2024

Uploaded by

renmen001002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views12 pages

Programmer Topic Test - 2024

Uploaded by

renmen001002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

PROGRAMMER TOPIC TEST - 2024

शक्ति & योद्धा टेस्ट सीरीज / topic test-05


Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

1. An operation is part of a transaction if it is C. Write D. Read


___ related.
8. In a database, prior to and after a
A. Logically B. Analytically transaction, properties are used to ensure ___.
C. Reasonably D. None A. Consistency B. Redundancy
2. To access the contents of the database, ___ C. Latency D. Anonymity
user performs transactions.
9. Which of the following is a property of
A. Single B. Two transaction?
C. Three D. Multiple A. Atomicity B. Consistency
3. Which of the following is an operation of C. Durability D.All of the above
transactions?
10. ___ states that all operations of a
A. Read B. Write transaction must occur simultaneously;
otherwise, the transaction will be aborted.
C. Commit D.All of the above
A. Atomicity B. Consistency
4. X is read from a database and stored in a
buffer in main memory with the ___ C. Isolation D. Durability
operation.
11. What is TRUE about atomicity?
A. Read B. Write
A. The transaction cannot be partially
C. Commit D. Rollback completed, since there is no midway.
5. Writing the data from the buffer back to the B. In each transaction, either the entire
database is accomplished by using the _____ transaction is executed or it is not.
operation.
C. Both A and B
A. Read B. Write
D. None of the above
C. Commit D. Rollback
12. How many operations does atomicity
6. ___ is used to permanently save the work. involve?
A. Read B. Write A. 1 B. 2
C. Commit D. Rollback C. 3 D. 4
7. An undo operation is called a ___.
A. Rollback B. Commit
Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 01 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

13. Which of the following is an operation in C. One inconsistent state to another


atomicity? inconsistent state
A. Abort B. Commit D. One consistent state to another
inconsistent state
C. Both A and B D.None of the above
18. What is TRUE about Isolation?
14. Transactions that are ___ do not expose all
changes. A. By using the data used during a
transaction, the second transaction will not be
A. Committed B. Rollbacked
able to use it until the first has been executed.
C. Aborted D.None of the above
B. The data item X cannot be accessed by
15. All changes made in a transaction are ___ any other transaction T2 until the transaction
once it commits. T1 is completed and the data item X is used
A. Visible B. Not Visible by the transaction T1.

C. Broken D. Not Broken C. It enforced the isolation property via its


concurrency control subsystem.
16. What is TRUE about Consistency?
D. All of the above
A. As a result of integrity constraints, the
database remains consistent before and after 19. A database's consistent state is measured
the transaction. by the ___ property.

B. In most cases, a database remains either A. Consistency B. Rollback


in its previous stable state or in a new stable C. Durability D. Isolation
state following the execution of a transaction.
20. A durable transaction is one that makes
C. Every transaction undergoes a ___ changes.
consistent database instance, which is the
A. Permanent B. Temporary
consistent property of databases.
C. Basic D. Advanced
D. All of the above
21. What is TRUE about Durability?
17. Transactions allow the database to be
transformed from ___. A. The failure of the system or an error in
a transaction cannot cause them to be lost.
A. One consistent state to another
consistent state B. A consistent state is reached when a
transaction is completed.
B. One inconsistent state to another
consistent state
Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 02 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

C. System failures cannot lead to the loss 26. In case of any shut down during
of that consistent state. transaction before commit which of the
following statement is done automatically?
D. All of the above
a) View b) Commit
22. A _________ consists of a sequence of
query and/or update statements. c) Rollback d) Flashback
a) Transaction b) Commit 27. A transaction completes its execution is
said to be
c) Rollback d) Flashback
a) Committed b) Aborted
23. Which of the following makes the
transaction permanent in the database? c) Rolled back d) Failed
a) View b) Commit 28. Which of the following is used to get back
all the transactions back after rollback?
c) Rollback d) Flashback
a) Commit b) Rollback
24. In order to undo the work of transaction
after last commit which one should be used? c) Flashback d) Redo
a) View b) Commit 29. ______ will undo all statements up to
commit?
c) Rollback d) Flashback
a) Transaction b) Flashback
25. Consider the following action:
c) Rollback d) Abort
TRANSACTION.....
30. A schedule in which each transaction is
Commit;
executed atomically is called a _________
ROLLBACK;
a) Non-serial schedule
What does Rollback do?
b) Serial schedule
a) Undoes the transactions before commit
c) Parallel schedule
b) Clears all transactions
d) More than one of the above
c) Redoes the transactions before commit
31. Which of the following is correct
d) No action according to the technology deployed by
DBMS?
a) Pointers are used to maintain transactional
integrity and consistency
Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 03 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

b) Cursors are used to maintain transactional Which of the following option is correct if
integrity and consistency database system has no concurrency module
and allows concurrent execution of above two
c) Locks are used to maintain transactional
transactions?
integrity and consistency
A. (1), (2) and (3) only
d) Triggers are used to maintain transactional
integrity and consistency B. (3) and (4) only
32. Identify correct matching of the following C. (1) and (2) only
sets
D. (1), (2) and (4) only
34. If S is serializable, which one of the
following orderings of the vertices of the
precedencegraph is guaranteed to yield a
serial schedule?
A. Topological order
B. Depth-first order
C. Breadth-first order

A. a - 4, b - 2, c - 3, d - 1 D. Ascending order of transaction indices


35. Suppose a database system crashes again
B. a - 4, b - 1, c - 3, d - 2
while recovering from a previous crash.
C. a - 3, b - 2, c - 1, d - 4 Assume checkpointing is not done by the
database either during the transactions or
D. a - 4, b - 2, c - 1, d – 3
during recovery.
33. Two concurrent executing transactions T1
Which of the following statements is/are
and T2 are allowed to update same stock item
correct?
say ‘A’ in an uncontrolled manner. In such
scenario. Following problems may occur: A. The same undo and redo list will be
used while recovering again.
1) Dirty read problem
B. The database will become inconsistent.
2) Lost update problem
C. All the transactions that are already
3) Transaction failure
undone and redone will not be recovered
4) Inconsistent database state again.

Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 04 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

D. The system cannot recover any further. Here, RX stands for “Read(X)” and WX
stands for “Write(X)”.
36. Consider the following schedules Which one of the following schedules is
involving two transactions. conflict equivalent to the above schedule?
S1 : r1(X) ; r1(Y) ; r2(X) ; r2(Y) ; w2(Y) ;
w1(X)
S2 : r1(X) ; r2(X) ; r2(Y) ; w2(Y) ; r1(Y) ;
w1(X) Which one of the following statements
is correct with respect to above?
A. Both S1 and S2 are conflict serializable
B. Both S1 and S2 are not conflict
serializable
C. S1 is conflict serializable and S2 is not
conflict serializable
D. S1 is not conflict serializable and S2 is
conflict serializable
37. Which of the following occurs when a 39. Consider the following partial Schedule S
transaction cannot proceed for an indefinite involving two transactions T1 and T2. Only
period of time while other transactions in the the read and the write operations have been
system continue normally? shown. The read operation on data item P is
denoted by read(P) and the write operation on
A. Starvation data item P is denoted by write(P)
B. Deadlock
C. Wound-wait
D. Wait – die
38. Consider a schedule of transactions T1
and T2:

Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 05 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

Suppose that the transaction T1 fails 43. Consider the following sequence of two
immediately after time instance 9. Which one transactions on a bank account(A) with initial
of the following statements is correct? balance 20,000 that transfers 5,000 to another
account (B) and then apply 10% interest.
A. T2 must be aborted and then both T1 and (i) T1 start
T2 must be re-started to ensure transaction (ii) T1 A old = 20000 new 15,000
atomicity (iii) T1 B old = 12000 new = 17000
B. Schedule S is non-recoverable and cannot (iv) T1 commit
ensure transaction atomicity (v) T2 start
C. Only T2 must be aborted and then re- (vi) T2 A old = 15000 new = 16500
started to ensure transaction atomicity (vii) T2 commit
D. Schedule S is recoverable and can ensure Suppose the database system crashes out just
atomicity and nothing else needs to be before log record (vii) is written. When the
done system is restricted, which one statement is
40. If transaction T1 reads a change made by true of the recovery process?
transaction T2, then T1 commits only after T2
commits. This property of a transaction A. We can apply undo and redo operation in
schedule is known as: arbitrary manner.
A. Strict B. We must redo log record (vi) to set A to
B. Serializable 16,500.
C. Recoverable C. We must undo log record (vi) to set A to
D. Cascadeless 16,500 and then redo log record (ii) and
41. Two concurrent transactions T1 and T2 (iii).
are in conflict when D. We need not redo records (ii) and (iii)
because transaction T1 has committed.
A. T1 reads from x, T2 reads from y 44. A transaction may be in one of the
B. T1 reads from x, T2 writes to x following states during its execution life cycle
C. T1 reads from x, T2 writes to y in concurrent execution environment.
D. T1 writes to x, T2 writes to y 1. FAILED
42. In DBMS, isolation property is also 2. TERMINATED
called as ________. 3. PARTIALLY COMMITTED
A. Serializability 4. COMMITTED
B. Durability
C. Atomicity A. 1 only
D. Performance B. Either 1 or 3 only
C. 3 only
D. 4 only

Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 06 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

45. Consider 4 transactions T , T , T and T


Transaction T has 5 transactions, T has 4 A. Both Statement I and Statement II are
transactions, T has 3 transactions and T has 2 correct
transactions. What is the number of non-serial B. Both Statement I and Statement II are
schedule? incorrect
A. 2522496 C. Statement I is correct but Statement II is
B. 24 incorrect
C. 2522520 D. Statement I is incorrect but Statement II is
D. 2522494 correct
46. In two phase locking, which statement is 49. Two transaction T1 and T2 are given
true T1 : R(X) T1: W(X) T2 : R(X) T2 : W(X)
A. Growing phase occurs after shrinking This is a __________ problem.
phase.
B. In shrinking phase, transaction can obtain A. Dirty Read
as well as release locks but in growing B. Lost Update
phase, it canonly obtain locks. C. Incorrect Summary
C. In growing phase, transaction can obtain as D. Unrepeatable Read
well as release locks but in shrinking phase, 50. Let transaction T1 has obtained a shared
it canonly release locks. mode lock S on data item Q and transaction T2
D. In growing phase, transaction can only has obtained an exclusive mode lock X on data
obtain locks and in shrinking phase, it can item R
only releaselocks. Consider the following statement.
47. Which one of the following problems can I: T1 can read Q but cannot write Q.
occur due to introducing locks in a concurrent II. T2 can read R but cannot write R.
transaction scenario? Which of the above statements is / are valid?

A. Information overwrite A. Only I


B. Loss of information B. Only II
C. Deadlock C. Both I and II
D. Lack of integrity D. None of above
48. Given below are two statements:
Which of the following concurrency control
protocol ensures both conflict serializability 51. What is abstraction in Java?
and freedom from deadlock? a) Hiding implementation details
Statement I: Two phase locking
Statement II: Timestamp ordering b) Hiding data
In the light of the above statements, choose c) Both a and b
the most appropriate answer from the options
given below: d) None of the above
Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 07 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

52. Which keyword is used to achieve 57. Which of the following is not a valid
abstraction in Java? access specifier for an abstract method?
a) public b) abstract a) private b) protected
c) static d) final c) public d) default
53. Which of the following can have abstract 58. Which of the following statements is true
methods? about abstract classes?
a) Abstract classes a) They cannot be extended
b) Interfaces b) They can have both abstract and non-
abstract methods
c) Both a and b
c) They cannot have constructors
d) None of the above
d) They cannot implement interfaces
54. Which keyword is used to define an
abstract method in Java? 59. Which of the following statements is true
about abstract classes and interfaces?
a) void b) abstract
a) Abstract classes can extend multiple
c) implements d) extends
classes, but interfaces cannot.
55. Which of the following is true about
b) Interfaces can have constructors, but
abstract methods?
abstract classes cannot.
a) They have a body
c) Abstract classes can have constructors,
b) They must be static but interfaces cannot.
c) They must be private d) Both abstract classes and interfaces can
d) They must be implemented by the have static methods.
subclass 60. Which keyword is used to prevent a
56. Can a class extend multiple abstract method from being overridden in Java?
classes in Java? a) final b) abstract
a) Yes c) static d) private
b) No
c) Sometimes
d) Only if they don't have abstract methods
Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 08 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

61. Which of the following is used to define a 66. Which feature of Java allows a class to
class in Java? inherit properties and behavior from another
class?
a) class b) function
a) Encapsulation b) Polymorphism
c) procedure d) subroutine
c) Inheritance d) Abstraction
62. Which of the following is used to define a
constant in Java? 67. Which of the following is not a primitive
data type in Java?
a) const b) final
a) int b) float
c) static d) abstract
c) string d) char
63. Which of the following is not a feature of
Java? 68. Java supports which of the following
types of polymorphism?
a) Platform independence
a) Compile-time polymorphism
b) Automatic memory management
b) Run-time polymorphism
c) Multiple inheritance
c) Both a and b
d) Object-oriented
d) Neither a nor b
64. Which feature of Java allows the same
code to be run on different operating systems 69. Which feature of Java allows you to
without modification? restrict access to certain members of a class?
a) Portability b) Inheritance a) Inheritance b) Polymorphism
c) Encapsulation d) Polymorphism c) Encapsulation d) Abstraction
65. Java uses which mechanism for memory 70. Java supports which of the following
management? types of exception handling?
a) Manual memory management a) Checked exceptions
b) Automatic memory management b) Unchecked exceptions
(Garbage Collection)
c) Both a and b
c) Dynamic memory allocation
d) Neither a nor b
d) Static memory allocation

Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 09 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

71. Which feature of Java allows you to 76. Which statement is used to handle
define blueprints for objects? exceptions in Java?
a) Inheritance b) Encapsulation a) try-catch b) catch-throw
c) Polymorphism d) Abstraction c) throw-catch d) exception-handle
72. Which of the following is not a valid 77. Which statement is used to execute a
access specifier in Java? block of code repeatedly as long as a
condition is true?
a) public b) private
a) while b) for
c) protected d) internal
c) do-while d) repeat
73.Which operator is used to perform string
concatenation in Java? 78. What does the finally block do in a try-
catch-finally statement in Java?
a) + b) *
a) It executes only if an exception occurs
c) / d) -
b) It executes regardless of whether an
74. Which of the following is the correct way
exception occurs or not
to declare an array in Java?
c) It executes only if no exception occurs
a) int[] arr = new int[];
d) It specifies the final action to take in the
b) int arr[];
program
c) int[] arr = new int[5];
79. In Java, which statement is used to
d) int arr[5]; redirect the flow of control from one
75. What does the default keyword indicate in statement to another within the same method?
a switch statement? a) goto b) switch
a) It is the default condition to execute c) break d) continue
b) It specifies the default case to execute if 80. What does the throw statement do in Java?
no other case matches
a) It throws an exception explicitly
c) It defines the default value for a variable
b) It catches an exception
d) It is not a valid keyword in a switch
c) It handles an exception
statement
d) It creates a new exception object

Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 010 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

81. In Java, which statement is used to define 86. Which statement is used to define the
a multi-line comment? entry point of a Java program?
a) /* */ b) // a) start() b) main()
c) ## d) <! c) execute() d) begin()
82. Which statement is used to print output in 87. What is multithreading?
Java?
a) Execution of multiple threads
a) console.log() simultaneously
b) System.print() b) Execution of multiple processes
simultaneously
c) print()
c) Execution of multiple methods
d) System.out.println()
simultaneously
83. What does the case keyword represent in a
d) Execution of multiple classes
switch statement?
simultaneously
a) It defines a condition to execute
88. Which interface is used to create a thread
b) It specifies the default case in Java?
c) It represents a specific case to match a) Runnable b) Threadable
d) It is not a valid keyword in a switch c) Executor d) Multithread
statement
89. Which method is used to start a thread in
84. In Java, which statement is used to Java?
allocate memory to objects?
a) start() b) run()
a) malloc b) new
c) begin() d) execute()
c) alloc d) create
90. Which method is called automatically
85. Which statement is used to explicitly when a thread is started in Java?
indicate that a method does not return any
a) run() b) start()
value?
c) execute() d) begin()
a) null b) return;
c) void d) none

Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 011 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com
PROGRAMMER TOPIC TEST - 2024
शक्ति & योद्धा टेस्ट सीरीज / topic test-05
Time: 02.00 Hours Questions: 100 Negative Marking: 0.33

91. What is the purpose of the join() method c) KeyListener d) WindowListener


in Java?
97. Which method is used to add a window
a) To synchronize threads listener to a Frame in AWT?
b) To start a new thread a) addWindowListener()
c) To wait for a thread to finish b) setWindowListener()
d) To interrupt a thread c) addListener()
92. Which method is used to pause the d) setListener()
execution of a thread in Java?
98. What is the purpose of the setVisible()
a) sleep() b) pause() method in AWT components?
c) wait() d) suspend() a) To set the size of the component
93. Which class provides the wait(), notify(), b) To make the component visible or
and notifyAll() methods in Java? invisible
a) Thread b) Runnable c) To set the background color of the
component
c) Object d) Executor
d) To add the component to a container
94. Which method is used to add components
to a container in AWT? 99. Which package contains the Swing classes
in Java?
a) addComponent() b) add()
a) java.awt b) java.util
c) append() d) insertComponent()
c) javax.swing d) java.swing
95. Which event listener interface is used for
handling mouse events in AWT? 100 What is Swing in Java?
a) ActionListener a) A layout manager
b) MouseListener b) An event handling framework
c) KeyListener c) A graphics library
d) WindowListener d) A GUI toolkit
96. Which event listener interface is used for
handling keyboard events in AWT?
a) ActionListener b) MouseListener
Ridhi-Sidhi Circle In Front of Mangalam Electronic Mall Near By IOC Petrol Pump
Page 012 of 012
MOB: 7014528940 / 8949174075 www.infiqueclasses.com

You might also like