Design and Analysis of 7.
What type of pseudocode helps
programmers design and convey their
Algorithms strategies and plans?
o Formal code
Assignment I o Natural language
o Pseudocode
1. What characteristic ensures an algorithm will o Flowcharts
always come to an end? o Answer: Pseudocode
o Finiteness
8. Which of the following is used to visually
o Definiteness
represent an algorithm's steps and decision
o Input
points?
o Output
o Pseudocode
o Answer: Finiteness
o Flowcharts
2. Which characteristic of a good algorithm o Formal code
ensures that each step is clearly defined? o Stepwise refinement
o Finiteness
o Answer: Flowcharts
o Definiteness
9. The process of breaking down an algorithm
o Input
into fundamental steps in a top-down
o Output
manner is known as_.
o Answer: Definiteness
o Pseudocode
3. An algorithm designed to compute the o Flowcharts
factorial of a number takes a single integer o Formal Algorithm Description
as input. Which characteristic does this o Stepwise Refinement
represent? o Answer: Stepwise Refinement
o Finiteness
10. What is the Big O notation used for in
o Definiteness
algorithm analysis?
o Input
o Time complexity
o Output
o Space complexity
o Answer: Input
o Input size
4. The output of a sorting algorithm is a sorted o Output size
list. This characteristic is known as_. o Answer: Time complexity
o Finiteness
11. Which time complexity represents a
o Definiteness
constant time algorithm?
o Input
o O(n)
o Output
o O(log n)
o Answer: Output
o O(1)
5. Which of the following algorithms is more o O(n^2)
efficient for large datasets? o Answer: O(1)
o Bubble Sort
12. The space complexity of an algorithm that
o QuickSort
employs an array of size n to store
o Linear Search
intermediate computations is_.
o Binary Search
o O(n)
o Answer: QuickSort
o O(log n)
6. Dijkstra's algorithm is commonly used in. o O(1)
o Search Engines
o O(n^2)
o GPS Navigation
o Answer: O(n)
o E-commerce
13. In asymptotic analysis, which notation
o Social Media
provides the upper bound of the running
o Answer: GPS Navigation
time?
o Big O
o Big Omega
o Big Theta o By ignoring all visited vertices
o Little o o Answer: By using a priority queue to
o Answer: Big O select the vertex with the shortest
14. The best-case time complexity of a linear tentative distance
search algorithm occurs when the target 4. What is a limitation of Dijkstra's Algorithm?
element is_. o It only works with unweighted
o Not in the list graphs
o Last in the list o It cannot handle negative edge
o First in the list weights
o Middle of the list o It is too slow for small graphs
o Answer: First in the list o It always finds the longest path
15. What type of analysis considers the average o Answer: It cannot handle negative
performance of an algorithm by assuming a edge weights
probability distribution over the inputs? 5. How does the priority queue improve the
o Asymptotic Analysis efficiency of Dijkstra's Algorithm?
o Probabilistic Analysis o By reducing the number of vertices
o Best Case Analysis o By sorting the vertices by their
o Amortised Analysis names
o Answer: Probabilistic Analysis o By always selecting the vertex with
the smallest tentative distance
______________________________________________________ o By increasing the number of edges
o Answer: By always selecting the
Assignment II vertex with the smallest tentative
distance
1. Which of the following is an application of 6. Compare Dijkstra's Algorithm with the
Dijkstra's Algorithm? Bellman-Ford Algorithm. Which one can
o Finding the longest path in a graph handle negative edge weights?
o Network routing o Dijkstra's Algorithm
o Finding a minimum spanning tree o Bellman-Ford Algorithm
o Sorting a list of numbers o Both
o Answer: Network routing o Neither
2. During the iteration step of Dijkstra's o Answer: Bellman-Ford Algorithm
Algorithm, what happens to the current 7. Explain how the A* Algorithm enhances
vertex? Dijkstra's Algorithm.
o It is marked as visited and removed o By using a stack instead of a priority
from the set of unvisited vertices queue
o It is marked as unvisited and added o By using heuristics to guide the
to the set of visited vertices search
o Its distance value is set to ∞ o By ignoring all edges
o It is skipped in the next iteration o By increasing the number of
o Answer: It is marked as visited and iterations
removed from the set of unvisited o Answer: By using heuristics to guide
vertices the search
3. How does Dijkstra's Algorithm ensure it 8. What is the role of the priority queue in
always finds the shortest path to the current optimising Dijkstra's Algorithm?
vertex? o To sort the edges by their weight
o By checking all possible paths o To keep track of visited vertices
o By using a priority queue to select o To select the vertex with the smallest
the vertex with the shortest tentative tentative distance
distance o To increase the graph size
o By updating the distance values to ∞
o Answer: To select the vertex with o To create redundant data
the smallest tentative distance o To increase transmission time
9. How can Dijkstra's Algorithm be o Answer: To reduce the overall size
implemented to handle real-time traffic of data by assigning shorter codes
updates in GPS navigation systems? to more frequent items
o By ignoring traffic updates 13. In Huffman coding, what is a binary tree
o By recalculating the shortest path used for?
dynamically as traffic conditions o To sort data
change o To create a hierarchical structure of
o By using only historical traffic data nodes
o By avoiding busy roads o To build a tree with the data items as
o Answer: By recalculating the the terminal nodes and the binary
shortest path dynamically as traffic code for each item as the path from
conditions change the root
10. Describe the steps involved in implementing o To merge data items
Dijkstra's Algorithm in a programming o Answer: To build a tree with the
language. data items as the terminal nodes and
o Initialize distances, iterate over the binary code for each item as the
vertices and update distances using path from the root
a priority queue 14. Which property ensures that no code is a
o Sort all vertices, find the longest prefix of another code in Huffman coding?
path, and mark visited vertices o Suffix codes
o Initialize distances, skip all vertices o Prefix codes
and use a stack o Redundant codes
o Use a stack, sort vertices, and find o Sequential codes
the longest path o Answer: Prefix codes
o Answer: Initialize distances, iterate 15. How are the nodes with the lowest
over vertices and update distances frequencies handled in the Huffman Tree
using a priority queue construction?
11. Explain the concept of bidirectional Dijkstra's o They are merged to form a new
Algorithm and its benefits. node
o It starts from both the source and o They are deleted
destination vertices simultaneously, o They are assigned the longest codes
reducing the search space and o They are left unchanged
improving efficiency o Answer: They are merged to form a
o It starts from the source vertex only, new node
increasing the search space
o It starts from the destination vertex
only, reducing the efficiency
o It uses a stack to track visited
vertices
o Answer: It starts from both the
source and destination vertices
simultaneously, reducing the search
space and improving efficiency
12. What is the primary goal of Huffman
coding?
o To maximise data size
o To reduce the overall size of data by
assigning shorter codes to more
frequent items
Software Testing o Deployment
o Answer: Testing
Assignment I 8. In the Waterfall Model, what must be
completed before the next phase begins?
o Design
1. What is the primary objective of the SDLC?
o Maintenance
o Ensure low costs
o Current Phase
o Deliver quality software
o Testing
o Avoid user involvement
o Answer: Current Phase
o Speed up development
o Answer: Deliver quality software
9. What is one disadvantage of the Waterfall
2. Which SDLC model is known for its Model?
o Flexibility
sequential phases?
o Scalability
o Agile
o Difficulty in accommodating changes
o Waterfall
o High Cost
o V Model
o Answer: Difficulty in
o RAD
o Answer: Waterfall
accommodating changes
3. The V Model emphasizes on which aspect 10. Which SDLC model involves developing
during development? prototypes for user feedback?
o Waterfall
o Speed
o V Model
o Documentation
o Agile
o Parallel Testing
o RAD
o User Feedback
o Answer: RAD
o Answer: Parallel Testing
4. Which model is best suited for projects with 11. What is the primary focus of the
rapidly changing requirements? maintenance phase?
o Design improvement
o Waterfall
o Performance enhancement
o V Model
o Bug fixes
o Agile
o Code development
o RAD
o Answer: Bug fixes
o Answer: Agile
5. Which of the following is not a phase of 12. What does RAD stand for in SDLC models?
o Rapid Application Development
SDLC?
o Robust Agile Design
o Requirement Gathering
o Reliable Application Development
o Design
o Rapid Agile Development
o Marketing
o Answer: Rapid Application
o Maintenance
o Answer: Marketing
Development
6. What is a key characteristic of the Agile 13. Which model ensures higher success due to
Model? early testing?
o Waterfall
o Sequential Phases
o V Model
o Fixed Requirements
o Agile
o Iterative Development
o RAD
o Long Development Cycles
o Answer: V Model
o Answer: Iterative Development
7. Which phase involves checking that the 14. How do software bugs impact operational
software meets the required standards? performance?
o Enhance efficiency
o Implementation
o Cause failures
o Testing
o Reduce costs
o Design
o Improve functionality
o Answer: Cause failures o It eliminates the need for other
15. Which of the following is a key objective of testing types
software testing? o It is only used for minor defects
o Speed o Answer: It complements formal
o Defect Identification testing methods
o Market Fit 6. What is the primary goal of alpha testing?
o Cost Reduction o Verify internal structures
o Answer: Defect Identification o Detect defects before external
release
-------------------------------------------------------- o Test software performance
o Evaluate usability
Assignment II o Answer: Detect defects before
external release
1. What is a key characteristic of gray box 7. Which testing technique is used in the first
testing? phase of alpha testing?
o Complete knowledge of internal o Black-box testing
code o White-box testing
o No knowledge of internal structures o Beta testing
o Partial knowledge of internal o Usability testing
structures o Answer: Black-box testing
o Testing only user interfaces 8. What is the main focus of beta testing?
o Answer: Partial knowledge of o Identify internal bugs
internal structures o Gather feedback from external users
2. Which testing approach helps to identify o Test internal code logic
logic flaws within boolean conditions? o Measure software performance
o Condition Coverage o Answer: Gather feedback from
o Path Coverage external users
o Statement Coverage 9. What type of testing is performed by
o Branch Coverage selected end-users in a real environment?
o Answer: Condition Coverage o Alpha testing
3. What is the purpose of branch coverage? o White-box testing
o Ensure every decision branch is o Beta testing
tested o Unit testing
o Test overall system performance o Answer: Beta testing
o Validate user interfaces 10. Which tool is commonly used for
o Simplify the code performance testing?
o Answer: Ensure every decision o JIRA
branch is tested o Selenium
4. Which type of testing can be more effective o Apache JMeter
than formal methods for certain types of o Git
defects? o Answer: Apache JMeter
o Automated Testing 11. What is the primary objective of load
o Intuitive Testing testing?
o Unit Testing o Test user interfaces
o Functional Testing o Measure software performance
o Answer: Intuitive Testing under expected load
5. What is one of the primary advantages of o Test software security
intuitive and experience-based testing? o Test code logic
o It is fully automated
o It complements formal testing Answer: Measure software performance
methods under expected load
12. What is the difference between load testing
and stress testing?
o No difference
o Load testing is for normal
conditions, stress testing for extreme
conditions
o Stress testing is easier
o Load testing is less thorough
o Answer: Load testing is for normal
conditions, stress testing for extreme
conditions
13. What does KPI stand for in software testing?
o Key Performance Indicator
o Key Process Indicator
o Knowledge Performance Indicator
o Known Process Indicator
o Answer: Key Performance Indicator
14. Which KPI measures the proportion of code
or functionalities tested by the test cases?
o Defect Density
o Test Coverage
o Mean Time to Repair (MTTR)
o Test Case Pass Rate
o Answer: Test Coverage
15. What is the purpose of defect density as a
KPI?
o Measure test case execution
o Evaluate user satisfaction
o Measure the number of defects per
software size unit
o Measure time taken to fix defects
o Answer: Measure the number of
defects per software size unit
Web Application Development 7. How are objects that survive two garbage
collections categorized in the .NET
Assignment I Framework?
o Generation 0
o Generation 1
1. What does the .NET Framework primarily
o Generation 2
emphasize on?
o Generation 3
o Data Analytics
o Answer: Generation 2
o Windows OS
o Linux OS
8. Which namespace in the BCL contains
o macOS
classes for file operations?
o System.Collections
o Answer: Windows OS
o System.IO
2. Which component of the .NET Framework
o System.Net
controls the running of .NET programs?
o System.Data
o FCL
o Answer: System.IO
o CLR
o ASP.NET
9. What does a Portable Executable (PE) file
o ADO.NET
contain in the .NET Framework?
o Bytecode
o Answer: CLR
o Metadata
3. Which .NET component is specifically
o Source Code
developed for constructing interactive web
o Binary Code
applications?
o Answer: Metadata
o ADO.NET
o Windows Forms
10. Which type of application is used for
o ASP.NET
command line interfaces in .NET?
o Console Applications
o WPF
o Windows Forms Applications
o Answer: ASP.NET
o ASP.NET Web Applications
4. What does MSIL stand for in the context of
o WPF Applications
the .NET Framework?
o Answer: Console Applications
o Microsoft Instruction Language
o Managed System Intermediate
11. Which of these JIT compiler types translates
Language the whole code into machine code at the
o Microsoft Intermediate Language
time of installation?
o Normal-JIT
o Managed System Instruction
o Pre-JIT
Language
o Econo-JIT
o Answer: Microsoft Intermediate
o None of the above
Language
o Answer: Pre-JIT
5. What service does the CLR provide to help
avoid memory leaks? 12. Which of these collections offers type safety
o Exception Handling
and better performance in .NET?
o ArrayList
o Memory Management
o Hashtable
o Type Safety
o Generic Collections
o Security Enforcement
o Stack
o Answer: Memory Management
o Answer: Generic Collections
6. Which version of the .NET Framework
introduced LINQ? 13. How is memory managed for static data and
o 2
global variables in .NET?
o Stack Memory
o 3
o Heap Memory
o 3.5
o Global Memory
o 4
o Local Memory
o Answer: 3.5
o Answer: Heap Memory
o Reduces performance
o Limits data manipulation
14. Which .NET component is responsible for o Answer: Simplifies querying XML
managing database connections? data
o ASP.NET 5. How can you ensure data integrity during
o Windows Forms multiple operations in Entity Framework?
o ADO.NET o By using eager loading
o CLR o By using transactions
o Answer: ADO.NET o By using lazy loading
15. In which namespace would you find classes o By using LINQ queries
for handling collections in .NET? o Answer: By using transactions
o System.IO 6. What is the role of the DbContext class in
o System.Collections Entity Framework?
o System.Net o To manage database connections
o System.Data o To handle file I/O operations
o Answer: System.Collections o To manage entity objects and
database connections
-------------------------------------------------------- o To read XML files
o Answer: To manage entity objects
Assignment II and database connections
7. How can you create a new XML file in .NET
1. How do you handle concurrency in Entity using XmlWriter?
Framework? o Using WriteStartElement
o Using optimistic concurrency control o Using ReadElement
o Using pessimistic concurrency o Using WriteXml
control o Using CreateElement
o Using transaction logs o Answer: Using WriteStartElement
o Using backup databases 8. How do you load related data explicitly in
o Answer: Using optimistic Entity Framework?
concurrency control o By using Include
2. What is the primary benefit of using eager o By using Load
loading in Entity Framework? o By using Fetch
o Reduces memory usage o By using Retrieve
o Increases initial load time o Answer: By using Load
o Reduces the number of database 9. What do tiers represent in software
queries architecture?
o Increases complexity o Logical separation
o Answer: Reduces the number of o Physical distribution
database queries o Functional division
3. How can you transform XML data into HTML o Code separation
using .NET? o Answer: Logical separation
o Using XmlReader 10. Which layer in a three-layer architecture
o Using XmlDocument contains the user interface components?
o Using XslCompiledTransform o Data Layer
o Using XmlWriter o Business Logic Layer
o Answer: Using o Presentation Layer
XslCompiledTransform o Service Layer
4. What is the main advantage of using LINQ o Answer: Presentation Layer
to XML? 11. What is the primary benefit of using layered
o Simplifies querying XML data architecture?
o Increases code complexity o Increased code complexity
o Modular code structure
o Reduced code clarity
o Decreased modifiability
o Answer: Modular code structure
12. In an N-Tier architecture, what is the role of
the Application Layer?
o Handle user interface
o Manage business processes and
rules
o Store data
o Provide third-party services
o Answer: Manage business processes
and rules
13. Which class in .NET is used to represent an
entire XML document?
o XmlReader
o XmlWriter
o XmlElement
o XmlDocument
o Answer: XmlDocument
14. How can you read child nodes from an XML
document in C#?
o Using XmlWriter
o Using XmlReader
o Using XmlDocument and XmlNode
o Using XmlAttribute
o Answer: Using XmlDocument and
XmlNode
15. What is the primary advantage of N-Tier
architecture?
o Single point of failure
o Difficult to scale
o Improved scalability and
maintainability
o Increased performance overhead
o Answer: Improved scalability and
maintainability
Cyber Security o Audit Logs
o Redundancy
Assignment I o Digital Signatures
o Hashing
o Answer: Redundancy
1. What is the process of confirming the
identity of a user, device, or entity in a 8. Cyber crimes that involve targeting personal
computer network? data and privacy are classified as?
o Crimes Against Government
o Authorization
o Crimes Against Property
o Authentication
o Crimes Against Individuals
o Non-repudiation
o Corporate Crimes
o Confidentiality
o Answer: Crimes Against Individuals
o Answer: Authentication
2. Which of the following is an example of 9. Which type of cyber crime involves
biometrics used in authentication? unauthorized access to computer networks
o Passwords
or systems?
o Phishing
o Security Tokens
o Hacking
o Voice Recognition
o Cyberbullying
o Access Control
o Identity Theft
o Answer: Voice Recognition
o Answer: Hacking
3. What is determined by Role-Based Access
Control (RBAC)? 10. What is the primary goal of ransomware
o Roles for Users
attacks?
o Gain Information
o Security Tokens
o Encrypt Files
o Digital Signatures
o Financial Gain
o Data Masking
o Disrupt Services
o Answer: Roles for Users
o Answer: Financial Gain
4. What technique is used to ensure that data
has not been altered during transfer or 11. Which type of phishing targets specific
storage? individuals with personalized messages?
o Email Phishing
o Encryption
o Whaling
o Hashing
o Spear Phishing
o Data Masking
o Malware
o Redundancy
o Answer: Spear Phishing
o Answer: Hashing
5. Which principle makes it impossible for a 12. What is the objective of cyber espionage?
o Financial Gain
party to deny receipt of a message?
o Spread Malware
o Confidentiality
o Obtain Confidential Information
o Availability
o Harass Individuals
o Non-repudiation
o Answer: Obtain Confidential
o Integrity
o Answer: Non-repudiation
Information
6. What measure can be taken to ensure 13. Which type of malware disguises itself as
confidentiality of data? legitimate software?
o Worms
o Data Masking
o Trojans
o Access Controls
o Spyware
o Encryption
o Viruses
o Redundancy
o Answer: Trojans
o Answer: Encryption
7. Which of the following is a method to 14. Cyberbullying includes which of the
improve system availability? following activities?
o Sending Threatening Messages
o Encrypting Files o Answer: To identify security
o Stealing Data vulnerabilities
o Spreading Malware 5. Which type of hacker is known for
o Answer: Sending Threatening performing penetration tests with
Messages permission?
15. What is the purpose of data masking? o Black-hat
o Encrypt Data o White-hat
o Obscure Content o Grey-hat
o Verify Identity o Script kiddies
o Control Access o Answer: White-hat
o Answer: Obscure Content 6. What is the initial phase of ethical hacking
that involves gathering information about
___________________________________________________ the target system?
o Scanning
Assignment II o Gaining Access
o Reconnaissance
1. How does cloud security differ from o Maintaining Access
traditional IT security? o Answer: Reconnaissance
o It Increases Complexity 7. Which hacking technique involves tricking
o It Requires Different Security users into providing personal information
Measures through fake websites or emails?
o It Limits Access o Phishing
o It Reduces Costs o SQL Injection
o Answer: It Requires Different o XSS
Security Measures o CSRF
2. What role does artificial intelligence (AI) play o Answer: Phishing
in modern cybersecurity? 8. Which tool is commonly used for network
o Reduces Security scanning to discover open ports and
o Increases Costs services?
o Enhances Threat Detection and o Wireshark
Prevention o Metasploit
o Limits Employee Access o Nmap
o Answer: Enhances Threat Detection o John the Ripper
and Prevention o Answer: Nmap
3. How can an organisation effectively train its 9. How can organisations prevent SQL injection
employees to ensure they follow attacks?
cybersecurity policies? o By Using Strong Passwords
o By Reducing Training Sessions o By Implementing Input Validation
o By Increasing Workload o By Disabling Cookies
o By Conducting Regular Training and o By Monitoring Traffic
Awareness Programs o Answer: By Implementing Input
o By Limiting Internet Access Validation
o Answer: By Conducting Regular 10. What is the purpose of maintaining access
Training and Awareness Programs during an ethical hacking process?
4. What is the primary purpose of ethical o To steal data
hacking? o To monitor the system continuously
o To steal data o To log out users
o To disrupt services o To delete logs
o To identify security vulnerabilities o Answer: To monitor the system
o To sell information continuously
11. Which phase of ethical hacking involves
exploiting discovered vulnerabilities to gain
unauthorized access?
o Reconnaissance
o Gaining Access
o Scanning
o Covering Tracks
o Answer: Gaining Access
12. What is the main goal of social engineering
attacks?
o To exploit technical vulnerabilities
o To manipulate human behavior
o To disable firewalls
o To encrypt data
o Answer: To manipulate human
behavior
13. How can organisations ensure the legality of
ethical hacking practices?
o By Obtaining Explicit Permission
o By Disabling Firewalls
o By Ignoring Laws
o By Using Short Passwords
o Answer: By Obtaining Explicit
Permission
14. What ethical principle requires ethical
hackers to protect sensitive information
from unauthorized disclosure?
o Integrity
o Confidentiality
o Professionalism
o Compliance
o Answer: Confidentiality
15. How does the use of tools like Wireshark
benefit penetration testers?
o By Encrypting Data
o By Analyzing Network Traffic
o By Blocking Attacks
o By Disabling Ports
o Answer: By Analyzing Network
Traffic
7. Which component of a web application
handles the business processes and
Advanced Internet Programming database operations?
o Client-side
Assignment I o User Interface
o Server-side
1. What is a web application? o Middleware
o A software installed on a computer o Answer: Server-side.
o A software run on a web server 8. Which characteristic is associated with
o A static HTML page dynamic web applications?
o A mobile application o Fixed Content
o Answer: A software run on a web o Faster Loading
server. o Static Content
2. Which of the following is NOT a o Database Integration
characteristic of static web applications? o Answer: Database Integration.
o Fixed Content 9. What is a Content Management System
o Faster Loading (CMS) primarily used for?
o Interactive Content o Data Analysis
o Cost-Effective o Game Development
o Answer: Interactive Content. o Content Creation and Management
3. What is a key component of web o Network Security
applications that includes HTML, CSS, and o Answer: Content Creation and
JavaScript? Management.
o Server-side 10. Which type of web application mimics native
o Client-side applications by having features like offline
o Database mode and notifications?
o Middleware o Static
o Answer: Client-side. o Dynamic
4. Which type of web application creates o Progressive
content in real-time based on user activities? o Single-Page
o Static o Answer: Progressive.
o Dynamic 11. What is the primary advantage of using a
o Single-Page static website for small-scale projects?
o Multi-Page o Interactivity
o Answer: Dynamic. o Cost-Effectiveness
5. What technology is commonly used in o Personalisation
Single-Page Applications to fetch new o High Maintenance
content without refreshing the entire page? o Answer: Cost-Effectiveness.
o AJAX 12. How do Single-Page Applications (SPAs)
o SQL enhance user experience?
o FTP o By frequently refreshing the page
o SMTP o By providing a smooth, mobile-like
o Answer: AJAX. interface
6. Which type of website typically has fixed o By increasing server-side load
content that does not change based on user o By limiting database interactions
interactions? o Answer: By providing a smooth,
o E-commerce mobile-like interface.
o Social Networking 13. When deciding on the type of web
o Static application to develop, what is a key
o Dynamic consideration for dynamic applications?
o Answer: Static. o Fixed Content
o Minimal Interactivity o By simplifying transaction
o Database Integration management
o Simple Development o By improving performance
o Answer: Database Integration. o By handling exceptions
14. What is a significant challenge in developing o Answer: By preventing SQL injection
web applications that are fast in terms of 5. How can CRUD operations be effectively
loading and response time? implemented in a JSP and Servlet-based
o Security web application?
o Scalability o By using only JSP pages
o Performance o By using Servlets to handle requests
o Compatibility and JSP to display results
o Answer: Performance. o By using only Servlets
15. Which type of web application is more o By using only HTML forms
suitable for projects that need to update o Answer: By using Servlets to handle
content frequently based on user input? requests and JSP to display results
o Static 6. What is batch processing in JDBC used for?
o Dynamic o Reducing database size
o Multi-Page o Reducing network bandwidth
o Single-Page o Executing multiple SQL commands
o Answer: Dynamic. in a batch
o Improving database security
----------------------------------------------------- o Answer: Executing multiple SQL
commands in a batch
Assignment II 7. Which method is used to add individual SQL
commands to a batch in JDBC?
1. What is the primary advantage of using o executeBatch()
PreparedStatement for database operations? o addBatch()
o Simplifies query writing o createBatch()
o Allows dynamic query creation o setBatch()
o Improves performance o Answer: addBatch()
o Simplifies transaction management 8. What is the primary benefit of using batch
o Answer: Improves performance processing in JDBC?
2. How does JDBC improve database o Enhanced security
connectivity for Java applications compared o Reduced execution time
to ODBC? o Increased complexity
o Platform-specific o Improved readability
o Language-independent o Answer: Reduced execution time
o Language-specific to Java 9. What is the default mode of JDBC
o Requires middleware transactions?
o Answer: Language-specific to Java o Auto-commit
3. What is the primary function of the o Manual commit
ResultSet interface? o Batch processing
o To handle SQL exceptions o Savepoints
o To execute SQL statements o Answer: Auto-commit
o To manage query results
o To handle database transactions
o Answer: To manage query results
4. How does the use of PreparedStatement 10. How can transaction management ensure
enhance the security of database data consistency in JDBC?
operations? o By using auto-commit
o By preventing SQL injection
o By grouping multiple SQL
statements into a single unit
o By executing statements individually
o By increasing the transaction size
o Answer: By grouping multiple SQL
statements into a single unit
11. Which method in JDBC is used to create a
savepoint?
o setSavepoint()
o createSavepoint()
o save()
o addSavepoint()
o Answer: setSavepoint()
12. What is the purpose of Callable Statements
in JDBC?
o To execute batch commands
o To handle complex queries
o To call stored procedures
o To manage database connections
o Answer: To call stored procedures
13. Which method is used to prepare a Callable
Statement in JDBC?
o prepareStatement()
o prepareCall()
o createCallable()
o callProcedure()
o Answer: prepareCall()
14. How does connection pooling improve
database connectivity in JDBC?
o By reducing security
o By reusing existing connections
o By increasing connection creation
time
o By simplifying code
o Answer: By reusing existing
connections
15. What is the main advantage of using
Prepared Statements in JDBC?
o Increased performance
o Increased complexity
o Simplified syntax
o Limited functionality
o Answer: Increased performance