NEW
Font size
WorksheetsProgramming and Database Quiz
Total questions: 40
Worksheet time: 20mins
Which of the following statements about tokens is TRUE?
Keywords can be redefined using macros
Identifiers can start with digits
Constants are not considered tokens
Operators and separators are tokens
Which flow control statement can cause unreachable code even without a loop?
break
continue
return
goto
Which OOP principle is violated if a subclass accesses private data members using pointers?
Inheritance
Polymorphism
Encapsulation
Abstraction
Which scenario BEST represents abstraction?
Hiding data using private access
Multiple inheritance
Exposing only essential features
Overloading constructors
Which of the following cannot be overridden in Java?
static methods
protected methods
public methods
abstract methods
Constructor chaining is achieved using:
super() and this()
virtual constructors
friend functions
dynamic binding
Which relationship is represented by composition?
IS-A
HAS-A (strong ownership)
HAS-A (weak ownership)
USES-A
Which feature resolves method call at runtime?
Method overloading
Templates
Dynamic binding
Inline functions
Which exception is checked at compile time?
ArithmeticException
NullPointerException
IOException
ArrayIndexOutOfBoundsException
Which pseudocode construct guarantees execution at least once?
while
for
do–while
if–else
Which normal form removes partial dependency?
1NF
2NF
3NF
BCNF
Which key uniquely identifies tuples and may contain NULL values?
Primary key
Candidate key
Foreign key
Super key
Which SQL command is DDL?
INSERT
UPDATE
ALTER
SELECT
Which isolation level prevents dirty reads but allows non-repeatable reads?
Read Uncommitted
Read Committed
Repeatable Read
Serializable
Lost update problem occurs due to:
Lack of atomicity
Lack of isolation
Lack of durability
Lack of consistency
Which join returns matching rows and unmatched rows from both tables?
Inner join
Left outer join
Right outer join
Full outer join
Which index structure supports range queries efficiently?
Hash index
B+ Tree
Bitmap index
Heap file
Which command permanently saves a transaction?
ROLLBACK
SAVEPOINT
COMMIT
CHECKPOINT
Authorization in DBMS mainly ensures:
Data consistency
Data integrity
Data availability
Controlled access
Which anomaly is eliminated by normalization?
Retrieval anomaly
Insertion anomaly
Search anomaly
Memory anomaly
Which SDLC model is BEST for unclear requirements?
Waterfall
V-Model
Spiral
Big Bang
Which Agile artifact represents work to be done?
Product Backlog
Sprint Review
Daily Scrum
Burnup chart
In Scrum, who prioritizes backlog items?
Scrum Master
Product Owner
Development Team
Stakeholders
Which UML diagram shows object interactions over time?
Class diagram
Use case diagram
Sequence diagram
Activity diagram
Which principle states “high cohesion and low coupling”?
KISS
SOLID
Separation of Concerns
DRY
White-box testing focuses on:
Functional behavior
Internal logic
User experience
Requirements
Cyclomatic complexity measures:
Code size
Code readability
Independent paths
Execution time
Which metric measures project progress over time?
LOC
Burn-down chart
Defect density
Cohesion
XP emphasizes:
Documentation
Customer involvement
Formal reviews
Big design upfront
Software maintenance consuming highest cost is:
Corrective
Adaptive
Perfective
Preventive
Time complexity of binary search in worst case:
O(1)
O(n)
O(log n)
O(n log n)
Which data structure is best for implementing recursion?
Queue
Stack
Tree
Graph
In a singly linked list, deletion of a node requires access to:
Next node
Previous node
Head node
Tail node
Which traversal of BST gives sorted order?
Preorder
Postorder
Level order
Inorder
Which heap property is used in priority queue?
Complete binary tree
Binary search tree
Heap order property
Graph property
Hashing gives best performance when:
Load factor is high
Collision rate is high
Load factor is low
Table is full
Dijkstra’s algorithm fails when graph has:
Cycles
Directed edges
Negative weights
Self loops
Which sorting algorithm is stable?
Quick sort
Heap sort
Merge sort
Selection sort
Greedy algorithm may fail for:
MST
Huffman coding
0/1 Knapsack
Job sequencing
Optimal substructure is a property of:
Greedy algorithms
Dynamic Programming
Backtracking
Divide and Conquer
