0% found this document useful (0 votes)
411 views219 pages

CUET UG Computer Science 20 Sets Book 2025

The document is a guide for CUET(UG) 2025 Computer Science exam preparation, featuring 20 practice papers with full explanations based on the syllabus released by NTA. It covers key topics such as database concepts, SQL, computer networks, and data structures, along with practice questions and answers. The book is published by Nodia and Company and is available for purchase online only, with a focus on providing valuable content for students preparing for the exam.
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)
411 views219 pages

CUET UG Computer Science 20 Sets Book 2025

The document is a guide for CUET(UG) 2025 Computer Science exam preparation, featuring 20 practice papers with full explanations based on the syllabus released by NTA. It covers key topics such as database concepts, SQL, computer networks, and data structures, along with practice questions and answers. The book is published by Nodia and Company and is available for purchase online only, with a focus on providing valuable content for students preparing for the exam.
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/ 219

Downloaded from www.mcqgpt.

com
CUET(UG) 2025

COMPUTER
SCIENCE

20 PRACTICE PAPERS with Full Explanation


As per Syllabus released by NTA

NODIA AND COMPANY

Downloaded from www.mcqgpt.com


CUET (UG) Computer Science 20 Sets
Edition March 2025
Copyright © By Nodia and Company

Information contained in this book has been obtained by author, from sources believes to be reliable.
However, neither Nodia and Company nor its author guarantee the accuracy or completeness of
any information herein, and Nodia and Company nor its author shall be responsible for any
error, omissions, or damages arising out of use of this information. This book is published with
the understanding that Nodia and Company and its author are supplying information but are not
attempting to render engineering or other professional services.

MRP Rs 250.00

This book is available on amazon and flipkart only and not available in market.

Published by :
Nodia and Company
125, Sector 6, Vidyadhar Nagar, Jaipur 302039
Phone :+91 9024037387

Downloaded from www.mcqgpt.com


Contents
PRACTICE PAPER 01 7

PRACTICE PAPER 02 17

PRACTICE PAPER 03 27

PRACTICE PAPER 04 36

PRACTICE PAPER 05 45

PRACTICE PAPER 06 55

PRACTICE PAPER 07 65

PRACTICE PAPER 08 75

PRACTICE PAPER 09 85

PRACTICE PAPER 10 94

PRACTICE PAPER 11 103

PRACTICE PAPER 12 113

PRACTICE PAPER 13 123

PRACTICE PAPER 14 133

PRACTICE PAPER 15 143

PRACTICE PAPER 16 152

PRACTICE PAPER 17 161

PRACTICE PAPER 18 171

PRACTICE PAPER 19 182

PRACTICE PAPER 20 192


********

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


CUET (UG) Exam - 2025
Syllabus
Computer Science

Section A

1 : Database Concepts
• Introduction to database concepts, difference between database and file system, rela-
tional data model : concept of domain, tuple, relation, keys - candidate key, primary key,
alternate key, foreign key.
• Relational algebra : selection, projection, union, set difference and cartesian product.
2 : Structured Query Language - I
• Advantages of using Structured Query Language, Data Definition Language, Data
Query Language and Data Manipulation Language, Introduction to MySQL, Creating a
database using MySQL, DataTypes
• Data Definition : CREATE TABLE, DROP TABLE, ALTER TABLE,Data Query : SE-
LECT, FROM, WHERE
• Data Manipulation : INSERT, UPDATE, DELETEMath functions : POWER (), ROUND
(), MOD ().Text functions : UCASE ()/UPPER (), LCASE ()/LOWER (), MID ()/SUB-
STRING ()/SUBSTR (),LENGTH (), LEFT (), RIGHT (), INSTR (), LTRIM (), RTRIM
(), TRIM ().
3 : Structured Query Language - II
• Date Functions : NOW (), DATE (), MONTH (), MONTHNAME (), YEAR (), DAY (),
DAYNAME ().
• Aggregate Functions : MAX (), MIN (), AVG (), SUM (), COUNT (); using COUNT(*).
Querying and manipulating data using Group by, Having, Order by.
• Operations on Relations - Union, Intersection, Minus, Cartesian Product, JOIN
4 : Computer Networks
• Introduction to computer networks, Evolution of networking,
• Network types : LAN, WAN, MAN
• Network devices : Modem, Ethernet Card, Repeater, Hub, Switch, Router,Gateway.Net-
work Topologies : Mesh, Ring, Bus, Star, and Tree topologies.
• Basic concept of MACand IP Address Difference between Internet and web.
Section B1 : Computer Science

1 : Exception and File Handling in Python


• Exception Handling : syntax errors, exceptions, need of exception handling, user-de-
fined exceptions, raising exceptions, handling exceptions, catching exceptions, Try -
except else clause, Try - finally clause, recovering and continuing with finally, built-in
exception classes.
• File Handling : text file and binary file, file types, open and close files, reading and writ-
ing text files, reading and writing binary files using pickle module, file access modes.

Downloaded from www.mcqgpt.com


2 : Stack
• Stack (List Implementation) : Introduction to stack (LIFO Operations), operations on
stack (PUSH and POP) and its implementation in python. Expressions in Prefix, Infix
and postfix notations,
• evaluating arithmetic expressions using stack, conversion of Infix expression to postfix
expression
3 : Queue
• Queue (List Implementation) : Introduction to Queue (FIFO), Operations on Queue
(INSERT and DELETE) and its implementation in Python. Introduction to DQueue
and its implementation in Python.
4 : Searching
• Searching : Sequential search, Binary search, Analysis of Sequential and Binary Search.
Dry run to identify best, worst and average cases. Implementation of searching tech-
niques in Python.
5 : Sorting
• Overview of sorting techniques, Bubble Sort, Selection Sort and Insertion Sort. Dry
run to identify best, worst and average cases. Implementation of sorting techniques in
Python.
• Hashing : Hash Functions, Collision Resolution.
6 : Understanding Data
• Data and its purpose, collection and organization; understanding data using statistical
methods : mean, median, standard deviation, variance; data interpretation.
7 : Database Concepts
• Introduction to database concepts, difference between database and file system, rela-
tional data model : concept of domain, tuple, relation, keys - candidate key, primary key,
alternate key, foreign key;
• Relational algebra : selection, projection, union, set difference and cartesian product.
8 : Structured Query Language
• Advantages of using Structured Query Language, Data Definition Language, Data
Query Language and Data Manipulation Language, Introduction to MySQL, Creating a
database using MySQL, Data Types
• Data Definition : CREATE TABLE, DROP TABLE, ALTER TABLE,
• Data Query : SELECT, FROM, WHERE
• Data Manipulation : INSERT, UPDATE, DELETE
• Math functions : POWER (), ROUND (), MOD ().
• Text functions : UCASE ()/UPPER (), LCASE ()/LOWER (), MID ()/SUBSTRING ()/
SUBSTR (), LENGTH (), LEFT (), RIGHT (), INSTR (), LTRIM (), RTRIM (), TRIM ().
• Date Functions : NOW (), DATE (), MONTH (), MONTHNAME (), YEAR (), DAY
(),DAYNAME ()
• Aggregate Functions : MAX (), MIN (), AVG (), SUM (), COUNT (); using COUNT(*).
• Querying and manipulating data using Group by, Having, Order by.
• Operations on Relations - Union, Intersection, Minus, Cartesian Product, JOIN

Downloaded from www.mcqgpt.com


9 : Computer Networks
• Introduction to computer networks, Evolution of networking,
• Network types : LAN, WAN, MAN
• Network devices : Modem, Ethernet Card, Repeater, Hub, Switch, Router, Gateway.
Network
• Topologies : Mesh, Ring, Bus, Star, and Tree topologies
• Basic concept of MAC and IP Address.
• Difference between Internet and web
10 : Data Communication
• Concept of communication, Types of Data Communication, switching techniques
• Communication Media : Wired Technologies – Twisted pair cable, Co-axial cable, Eth-
ernet Cable,Optical Fibre;
• Introduction to mobile telecommunication technologies
• Wireless Technologies – Bluetooth, WLAN, Infrared, Microwave
• Network Protocol : Need for Protocol, Categorization and Examples of protocol, HTTP,
FTP, IP, PPP;electronic mail protocol
• Concept of Channel, Bandwidth (Hz, KHz, MHz) and Data Transfer rate (bps, Kbps,
Mbps, Gbps,Tbps)
11 : Security Aspects
• Threats and prevention : Viruses, Worms, Trojan horse, Spam, Cookies, Adware, Fire-
wall, http vs https.
• Network Security Concepts : Firewall, Cookies, Hackers and Crackers
• Antivirus and their workings
• Network security threats : Denial of service, Intrusion problems, Snooping, Eavesdrop-
ping.

 **********

Downloaded from www.mcqgpt.com


PRACTICE PAPER 01

PRACTICE PAPER 01

1. Which choice best defines a primary key in a relational exist, but only one can be officially designated as the
database? primary key to maintain integrity and consistency.
(A) A duplicated attribute that identifies multiple rows
4. Why is a foreign key important in relational tables?
(B) A unique attribute that identifies a single row
(C) A numeric attribute used for calculations only (A) It makes all columns mandatory
(D) A textual attribute with no indexing capability (B) It ensures software updates are automatic
(C) It helps link tables by referencing a primary key in
Ans another table
(B) A unique attribute that identifies a single row (D) It converts text data to numeric form
A primary key is a unique identifier for rows in a relation,  Ans
ensuring that no two rows share the same key value. It
helps maintain data integrity by preventing duplicate (C) It helps link tables by referencing a primary key in
records. Each table can have exactly one primary key, another table
central to structuring and retrieving data efficiently. This A foreign key establishes a relationship between two
constraint supports references in database applications. tables by referencing a primary key in another table.
This linkage enforces referential integrity, ensuring that
2. Which term describes a domain in a relational database data remains consistent and valid across related tables. It
context? prevents orphan records and supports efficient retrieval
(A) A structured query output of interconnected information in a relational database
(B) A set of permissible values for an attribute without unnecessary duplication.
(C) A compilation of all foreign key constraints
5. Which SQL command is used to remove rows from a
(D) A storage unit with unlimited capacity
table?
Ans (A) UPDATE
(B) A set of permissible values for an attribute (B) DELETE
A domain specifies the valid values an attribute (C) CREATE
can assume in a relational database. It ensures data (D) ALTER
consistency and reliability by restricting inputs to a  Ans
specific range or type, such as integers or dates. This
constraint safeguards data integrity and prevents entries (B) DELETE
that fall outside acceptable boundaries for each attribute. The DELETE command in SQL is used to remove one
or more rows from an existing table based on specified
3. How many primary keys can a single relation (table) conditions. It allows selective data removal when
have at once? combined with a WHERE clause. Unlike DROP, which
(A) One removes an entire table, DELETE preserves the table
(B) Two structure and related schema definitions intact and
(C) Unlimited helps maintain consistency.
(D) Depends on database engine
6. Which of the following statements about the UPDATE
Ans command is NOT correct?
(A) One (A) It modifies existing rows in a table
A table can only have one primary key, though that (B) It can affect multiple rows using a single command
key can consist of multiple columns if needed. This (C) It automatically creates new tables if none exist
restriction enforces a unique identifier for each record, (D) It can use a WHERE clause to target specific rows
preventing duplication. Additional candidate keys may  Ans

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


page 8 CUET UG Computer Science

(C) It automatically creates new tables if none exist  Ans


The UPDATE command modifies existing rows in a (C) To categorize rows before performing calculations
specified table. It can operate on one or many rows like SUM() or AVG()
using suitable conditions. It cannot, however, create GROUP BY groups rows sharing common values
new tables if they do not exist. Separate commands like into subsets before applying aggregate functions. By
CREATE TABLE are required for adding new tables or aggregating each group independently, queries can
altering data structures. produce summarized results, such as total or average
values, per category. This approach enables more
7. How does the SELECT command differ from the
detailed analysis of data trends, ensuring that aggregated
UPDATE command in SQL?
outcomes reflect meaningful divisions in the dataset.
(A) SELECT retrieves rows, while UPDATE modifies
rows 10. Which of the following is NOT a valid aggregate
(B) Both commands delete rows from tables function in MySQL?
(C) SELECT modifies data, while UPDATE only (A) SUM()
displays data (B) MEDIAN()
(D) They perform identical operations in different (C) MAX()
syntaxes (D) COUNT()
Ans  Ans
(A) SELECT retrieves rows, while UPDATE modifies (B) MEDIAN()
rows MySQL does not have a built-in MEDIAN() function,
SELECT is used to fetch and display data from one or unlike SUM(), MAX(), and COUNT(). MEDIAN
more tables based on specified criteria, without altering can be calculated using various workarounds, such
stored values. UPDATE, by contrast, changes existing as subqueries or user-defined functions, but it is not
rows according to given conditions. This distinction directly available as a standard aggregate. Users must
ensures that data retrieval and data modification remain employ alternative methods to derive a median value
separate operations, preserving clarity and consistency. accurately from query results.
8. Which SQL clause is best used to filter records based on 11. Match each MySQL function with its main purpose:
a specified condition?
(A) GROUP BY Column I Column II
(B) ORDER BY 1. UCASE() a. Returns the remainder
(C) WHERE of a division operation
(D) HAVING 2. MOD() b. Extracts characters
Ans from the left side of a
string
(C) WHERE
3. LEFT() c. Converts a string to
The WHERE clause refines query results by returning
uppercase
only rows that meet a specified condition. It can be
used with SELECT, UPDATE, or DELETE to precisely 4. NOW() d. Provides the current
target affected data. This approach ensures queries focus date and time
on relevant entries, improving efficiency and accuracy Options:
in handling large datasets. Such granular control helps (A) 1-c, 2-a, 3-b, 4-d
maintain consistent and secure operations. (B) 1-d, 2-b, 3-c, 4-a
(C) 1-b, 2-c, 3-d, 4-a
9. Why is the GROUP BY clause used in conjunction with (D) 1-a, 2-d, 3-b, 4-c
aggregate functions?
 Ans
(A) To limit the number of result columns
(B) To arrange rows in ascending order (A) 1-c, 2-a, 3-b, 4-d
(C) To categorize rows before performing calculations UCASE() transforms text to uppercase, MOD()
like SUM() or AVG() calculates the remainder, LEFT() retrieves a specified
(D) To automatically drop unused tables number of characters from the string’s left side, and

Downloaded from www.mcqgpt.com


PRACTICE PAPER 01

NOW() yields the current date and time. Matching (B) A localized network covering a small area, like a
these functions correctly ensures proper usage in SQL building
queries for text manipulation, arithmetic operations, A LAN connects computers and devices within a
substring extraction, and timestamp retrieval. limited geographic area, such as a home, school, or
office building. It facilitates high-speed data transfers
12. Which of the following statements about JOIN and resource sharing among connected machines. This
operations are correct? localized structure reduces latency and lowers costs,
1. INNER JOIN returns matching rows across tables. making LANs ideal for smaller-scale networking needs
2. LEFT JOIN returns all rows from the right table. in confined environments and deployment.
3. RIGHT JOIN returns all rows from the right table.
4. FULL JOIN returns all matching rows plus non- 15. What topology arranges all devices in a closed loop,
matching rows from both tables. where each device connects to exactly two others?
(A) 1 and 2 only (A) Bus
(B) 1, 3, and 4 only (B) Star
(C) 2, 3, and 4 only (C) Ring
(D) 1, 2, 3, and 4 (D) Tree
Ans  Ans
(B) 1, 3, and 4 only (C) Ring
INNER JOIN retrieves records present in both tables. In a ring topology, each node is connected to exactly
RIGHT JOIN includes all rows from the right table, two neighbors, forming a continuous loop. Data travels
along with matching rows from the left table. FULL around the ring until it reaches the destination. While
JOIN includes matching and non-matching rows from it can simplify cabling, a single break in the loop can
both tables. LEFT JOIN returns rows from the left table disrupt communication unless specialized mechanisms,
and matching ones from the right. such as dual rings, are fully implemented.

13. Which device is primarily used to forward data packets 16. Which networking approach differentiates LAN, MAN,
between computer networks? and WAN primarily?
(A) Hub (A) Transmission protocol used
(B) Switch (B) Geographical coverage area
(C) Router (C) Encryption method implemented
(D) Repeater (D) Cable type required
Ans  Ans
(C) Router (B) Geographical coverage area
A router directs data packets across different networks, LANs cover a small area, like offices or homes, MANs
determining the optimal path for transmission using span a city or metropolitan region, and WANs connect
routing tables. Unlike switches or hubs that mainly geographically distant locations. Though they may share
operate within a single network, routers connect networking protocols, the key difference lies in physical
multiple networks and manage traffic efficiently. They scope and distance. This classification influences cost,
facilitate inter-network communication, ensuring data complexity, and bandwidth requirements for each
reaches its correct destination across diverse segments network type.
securely.
17. Which Python keyword initiates an exception-handling
14. What is a LAN (Local Area Network)? block?
(A) A network that spans entire continents (A) throw
(B) A localized network covering a small area, like a (B) except
building (C) try
(C) A wireless protocol used for smartphones (D) raise
(D) A software tool for database backups  Ans
Ans (C) try

Downloaded from www.mcqgpt.com


page 10 CUET UG Computer Science

In Python, the try keyword starts a block of code where The finally block executes whether an exception is
exceptions might occur. It is commonly paired with raised or not, ensuring essential cleanup. It does not stop
except or finally clauses to manage errors gracefully. This except blocks from running; instead, it follows them to
structure helps isolate risky operations and provides a finalize operations like closing files. Developers can
controlled way to handle runtime anomalies without also use else for code that runs only if no exception is
crashing the entire program or causing data loss. triggered, before finally carefully.

18. What is a user-defined exception in Python? 21. Arrange the following stack operations in the correct
(A) An error automatically raised by the Python sequence when evaluating an arithmetic expression in
interpreter postfix form:
(B) A custom error class created by the programmer 1. Push operands
(C) A syntax error that halts execution 2. Apply operator to top elements
(D) A library function that logs events 3. Pop operands
Ans 4. Push the result onto the stack
(A) 1 -> 3 -> 2 -> 4
(B) A custom error class created by the programmer (B) 1 -> 2 -> 3 -> 4
User-defined exceptions are Python error classes crafted (C) 3 -> 1 -> 4 -> 2
by developers to represent specific error conditions in (D) 1 -> 4 -> 3 -> 2
their applications. By subclassing Exception or related
classes, programmers can often tailor messages and  Ans
responses, offering clearer diagnostics. These custom (A) 1 -> 3 -> 2 -> 4
exceptions improve code readability and modularity When evaluating postfix expressions, first push any
by differentiating unique error scenarios from generic operand onto the stack. When an operator appears,
built-in errors. pop the required number of operands, perform the
operation, then push the result back. So, the sequence
19. Which file mode in Python is used for both reading and is push operands (1), pop operands (3), apply operator
writing in a text file without overwriting the existing (2), and finally push the result (4) correctly.
content?
(A) w+ 22. Why is a stack considered a LIFO structure?
(B) r+ (A) Because the last item removed is the first item
(C) a+ inserted
(D) x+ (B) Because the last item inserted is the first item
Ans removed
(C) Because items can only be removed in a fixed
(B) r+ sequence
The ‘r+’ mode opens an existing text file for both (D) Because it automatically sorts elements
reading and writing, starting at the beginning without
automatically truncating the file’s content. Developers  Ans
can then properly update or append within the same (B) Because the last item inserted is the first item
session and handle text operations effectively. This removed
option requires that the file already exists before A stack follows the Last-In, First-Out principle. The
opening. most recently added element is removed first, akin to a
stack of plates where the top plate is taken before those
20. Which of the following is NOT true about Python’s beneath. This structured approach supports operations
finally clause? like undo functionality, expression evaluation, and
(A) It always executes, regardless of exceptions function call management in many computing scenarios
(B) It is used to close resources or clean up tasks quite effectively.
(C) It prevents the except block from running
(D) It can appear after the else clause 23. What is the time complexity of pushing an element onto
Ans a stack implemented with a Python list, assuming no
resizing cost?
(C) It prevents the except block from running (A) O(n)

Downloaded from www.mcqgpt.com


PRACTICE PAPER 01

(B) O(1) (C) It automatically doubles size when full


(C) O(log n) (D) It can store negative indexes
(D) O(n^2)  Ans
Ans (B) It uses an array with a wrap-around to reuse vacated
(B) O(1) space
Pushing to a stack using a Python list’s append operation A circular queue overcomes the limitation of a linear
is generally O(1) under amortized analysis. No shifting queue by linking the end of the array back to its front,
of elements is required at the end of the list. If resizing forming a loop. When an element is dequeued, the freed
occurs, occasional overhead might appear. However, space can be reused. This wrap-around design optimizes
in typical usage, push (append) operations can be storage utilization and prevents wasted slots at the
considered constant-time overall on average. array’s front effectively.

24. Which queue operation removes an element from the 27. Which searching algorithm inspects elements in a
front? sorted list by repeatedly halving the search space?
(A) ENQUEUE (A) Sequential Search
(B) DEQUEUE (B) Binary Search
(C) PEEK (C) Linear Search
(D) INSERT (D) Hash Search
Ans  Ans
(B) DEQUEUE (B) Binary Search
A queue is a First-In, First-Out structure, where elements Binary search begins by comparing the target value
inserted first are removed first. DEQUEUE specifically to the middle element of a sorted list. If the target is
takes the front element out, shifting the remaining items smaller, the algorithm continues in the left sub-list; if
forward in some implementations. ENQUEUE adds larger, it proceeds in the right sub-list. Repeated halving
elements at the rear. This organization is widely used for dramatically reduces comparisons, yielding an O(log n)
scheduling processes and handling asynchronous tasks time complexity, making searching efficient overall.
efficiently in many systems.
28. Which statements are true about sequential search?
25. What is a DQueue (or Deque)? 1. It checks each element until a match is found.
(A) A queue that only allows insertion at the front 2. It requires the list to be sorted.
(B) A queue that only allows deletion at the rear 3. Its worst-case time complexity is O(n).
(C) A queue that supports insertion and deletion at 4. It cannot find an element if it is not unique.
both ends (A) 1 and 3 only
(D) A queue limited to one element (B) 1, 2, and 3 only
Ans (C) 2 and 4 only
(D) 1, 3, and 4 only
(C) A queue that supports insertion and deletion at both
ends  Ans
A deque, short for double-ended queue, permits (A) 1 and 3 only
insertion and removal from either the front or the Sequential or linear search scans the list from the start,
rear. This versatility offers more efficient operations in comparing each element until it finds a match or reaches
certain scenarios compared to a standard queue, which the end. Its worst-case complexity is O(n). Sorting is
only allows front removal and rear insertion. Deques not required, and it can locate duplicate items. Hence,
are used for scheduling, caching, and adaptive dynamic statements 1 and 3 are correct, while 2 and 4 are not.
data handling.
29. Assertion (A) : Binary search is more efficient than
26. How does a circular queue differ from a simple linear sequential search for large sorted lists.
queue? Reason (R) : Binary search splits the list into halves,
(A) It doesn’t allow rear insertion reducing the number of comparisons logarithmically.
(B) It uses an array with a wrap-around to reuse vacated (A) Both (A) and (R) are true, and (R) is the correct
space explanation of (A).

Downloaded from www.mcqgpt.com


page 12 CUET UG Computer Science

(B) Both (A) and (R) are true, but (R) is not the correct (A) Both (A) and (R) are true, and (R) is the correct
explanation of (A). explanation of (A).
(C) (A) is true, but (R) is false. (B) Both (A) and (R) are true, but (R) is not the correct
(D) (A) is false, but (R) is true. explanation.
Ans (C) (A) is true, (R) is false.
(D) (A) is false, (R) is true.
(A) Both (A) and (R) are true, and (R) is the correct
explanation of (A).  Ans
Binary search operates in O(log n) time for sorted (A) Both (A) and (R) are true, and (R) is the correct
lists by repeatedly halving the search space. Sequential explanation of (A).
search, with O(n) complexity, is less efficient for large Insertion Sort often excels when data is already close
datasets. The reason directly explains why binary search to sorted because each new element is positioned by
outperforms sequential search under these conditions, shifting only those that are larger. Fewer shifts mean
confirming that both the assertion and reason are faster performance. Bubble Sort, by contrast, repeatedly
indeed correct. swaps adjacent pairs. Thus, the reason directly clarifies
why Insertion Sort outperforms Bubble Sort on nearly
30. Which of the following statements about Bubble Sort is sorted arrays.
NOT correct?
(A) It repeatedly swaps adjacent elements if they are in 33. What is the mean of a dataset?
the wrong order (A) The most frequently occurring value
(B) It can take O(n^2) time in the worst case (B) The middle value when data is sorted
(C) It always completes sorting in exactly n passes (C) The sum of all values divided by the number of
(D) It compares pairs of elements to move larger ones to values
the right (D) The largest minus the smallest value
Ans  Ans
(C) It always completes sorting in exactly n passes (C) The sum of all values divided by the number of
Bubble Sort iteratively compares adjacent elements, values
swapping them if out of order, gradually placing larger The mean, or average, is computed by adding all data
values at the end. Its worst-case complexity is O(n^2). points and dividing by the quantity of points. It provides
However, it does not invariably need exactly n passes; a central measure, though it can be skewed by outliers.
the algorithm may conclude earlier if no swaps occur, In contrast, the median is the middle value, and the
indicating the array is fully sorted. mode is the most frequent value in the dataset overall.

31. In Selection Sort, how many swaps occur in the best, 34. Which statistical measure indicates how far data points
average, or worst case for a list of n elements? spread from the mean and is calculated as the square
(A) Up to n*(n-1)/2 root of variance?
(B) Exactly 1 per pass, resulting in n-1 swaps (A) Median
(C) It depends on whether the list is partially sorted (B) Range
(D) Twice as many swaps as Bubble Sort (C) Standard Deviation
Ans (D) Mode

(B) Exactly 1 per pass, resulting in n-1 swaps  Ans


Selection Sort selects the smallest element in each pass (C) Standard Deviation
and swaps it with the element at the start of the unsorted Standard deviation reflects the dispersion of data
region. This approach results in exactly one swap per relative to the mean, computed as the square root of the
pass, leading to n-1 swaps overall for a list of size n, variance. A higher standard deviation indicates data
regardless of its initial order or arrangement of items. points are more widely scattered, while a lower one
suggests they’re closer to the average. It is a fundamental
32. Assertion (A) : Insertion Sort can be more efficient than concept in data analysis and statistics.
Bubble Sort on nearly sorted data.
Reason (R) : Insertion Sort places each element at its 35. Match each term with its corresponding definition:
correct position by shifting larger elements to the right.

Downloaded from www.mcqgpt.com


PRACTICE PAPER 01

37. Match each networking device with its primary


Column I Column II
function:
1. Median a. Measure of data
spread as the Column I Column II
difference between 1. Hub a. Broadcasts data to all
max and min values connected ports without
2. Mode b. Value appearing filtering
most frequently in 2. Switch b. Filters and forwards data
a dataset between LAN segments based
3. Variance c. Average of squared on MAC addresses
deviations from the 3. Router c. Connects multiple networks
mean and directs data using IP
4. Range d. Middle value in a addresses
sorted list 4. Gateway d. Translates protocols between
Options: different network systems
(A) 1-d, 2-b, 3-c, 4-a Options:
(B) 1-b, 2-a, 3-d, 4-c
(A) 1-a, 2-b, 3-c, 4-d
(C) 1-c, 2-d, 3-a, 4-b
(B) 1-b, 2-a, 3-d, 4-c
(D) 1-a, 2-c, 3-b, 4-d
(C) 1-c, 2-d, 3-a, 4-b
Ans (D) 1-d, 2-c, 3-b, 4-a
(A) 1-d, 2-b, 3-c, 4-a  Ans
Median is the middle value once the data is sorted, mode
(A) 1-a, 2-b, 3-c, 4-d
is the most frequent element, variance is the average
A hub blindly repeats incoming signals to all ports. A
of squared deviations from the mean, and range is the
switch forwards data selectively using MAC addresses.
difference between maximum and minimum values.
A router uses IP addresses to route traffic between
Understanding these measures facilitates interpretation
different networks. A gateway translates protocols to
of central tendency and variability in a dataset effectively.
allow communication across incompatible systems.
36. Arrange these stages in the evolution of the internet in Correct mapping ensures efficient and interoperable
chronological order: data flow in a network today.
1. ARPANET research begins
38. Match each Python exception type with its typical cause:
2. Introduction of the World Wide Web
3. Widespread adoption of broadband Column I Column II
4. Social media platforms emerge 1. ZeroDivisionError a.
Occurs when an
(A) 1 -> 2 -> 3 -> 4 operation or function
(B) 1 -> 3 -> 2 -> 4 is applied to an object
(C) 2 -> 1 -> 4 -> 3 of inappropriate type
(D) 3 -> 4 -> 1 -> 2 2. ValueError b. Triggered when
Ans attempting to divide
by zero
(A) 1 -> 2 -> 3 -> 4
ARPANET, originating in the late 1960s, laid the 3. TypeError c. Raised when a file
foundation for modern networking. The World Wide is requested but not
Web emerged in the early 1990s, enabling global found
hyperlinked information access. Broadband gained 4. FileNotFoundError d. Caused by an
prominence in the 2000s, providing faster internet. argument of correct
Finally, social media platforms gained widespread usage type but inappropriate
worldwide, dramatically changing communication and value
information-sharing patterns. Options:
(A) 1-b, 2-d, 3-a, 4-c

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


page 14 CUET UG Computer Science

(B) 1-a, 2-c, 3-d, 4-b Bluetooth offers short-range connectivity, commonly
(C) 1-d, 2-a, 3-c, 4-b for devices like headphones. Infrared does need line-of-
(D) 1-c, 2-b, 3-d, 4-a sight to function effectively. Wi-Fi, or WLAN, powers
Ans moderate-range wireless internet access. Microwave
technology remains relevant for long-distance
(A) 1-b, 2-d, 3-a, 4-c communication links, so claiming it is irrelevant is
ZeroDivisionError arises when dividing by zero. incorrect. Therefore, statements 1, 2, and 4 are accurate.
ValueError emerges if a function receives an argument
of correct type but invalid value. TypeError appears Direction :Carefully read the case study provided and then
when an operation is applied to an incompatible type. thoroughly answer the subsequent five questions.
FileNotFoundError occurs if a requested file cannot Greenfield High School decided to integrate a new relational
be located. Accurately matching exceptions enables database system to manage student records, course
targeted error handling in Python effectively. enrollments, and exam results. The primary objective was
to centralize data across multiple departments, ensuring
39. Which statements are correct regarding network accurate and up-to-date information. The database
security threats? schema included separate tables for students, teachers,
1. A virus replicates itself to infect files courses, and grades, linked via foreign keys to maintain
2. A Trojan horse disguises malicious content as referential integrity. By implementing a robust primary
legitimate software key structure, administrators could quickly retrieve
3. Adware always deletes operating system files details about each student’s profile, along with associated
4. A firewall filters incoming and outgoing traffic class schedules. This initiative also enhanced data security
(A) 1, 2, and 4 only through role-based access, restricting unauthorized
(B) 1 and 3 only modifications. Teachers were trained to input marks
(C) 2 and 3 only directly, reducing manual errors. The success of this system
(D) 1, 2, and 3 only led to faster result generation, simplified record audits,
Ans and an overall improvement in communication among
(A) 1, 2, and 4 only school stakeholders. Administrators saved time during
A virus replicates to spread between files or systems, admissions and routine tasks, increasing efficiency.
while a Trojan horse hides its harmful nature behind a 41. Which key structure in the school’s database ensures
genuine application. A firewall monitors and controls each student has a unique identifier?
network traffic. Adware typically displays unwanted (A) Foreign Key
advertisements rather than deleting system files. Thus, (B) Composite Key
statements 1, 2, and 4 accurately describe network (C) Primary Key
security aspects effectively. (D) Candidate Key
40. Which statements are true about wireless  Ans
communication technologies? (C) Primary Key
1. Bluetooth is typically used for short-range The primary key in each table guarantees unique
connections identification of records, such as individual students,
2. Infrared requires line-of-sight for reliable preventing duplicate entries. Other key types, like
transmission candidate keys, are potential primary keys, and foreign
3. Microwave is irrelevant in modern networking keys establish relationships between tables. The primary
4. Wi-Fi (WLAN) provides wireless internet access key is crucial for referencing and organizing data
over moderate distances accurately and systematically.
(A) 1, 2, and 4 only
(B) 1 and 3 only 42. How did role-based access enhance data security in the
(C) 2 and 3 only school’s database?
(D) 1, 2, and 3 only (A) By removing all user restrictions
Ans (B) By allowing only certain users to view or edit data
(C) By providing an auto-save feature every minute
(A) 1, 2, and 4 only (D) By encrypting data using public keys only

Downloaded from www.mcqgpt.com


PRACTICE PAPER 01

Ans (C) Faster result generation and communication


(B) By allowing only certain users to view or edit data Centralizing data eliminated redundant processes and
Role-based access limits database privileges based on removed the need to reconcile separate departmental
user roles, permitting only authorized personnel to files. Real-time updates enabled administrators
view, modify, or delete specific records. In a school, and teachers to access current information quickly,
teachers might update grades, while administrators streamlining tasks like result compilation and record
handle enrollment or policy changes. This targeted audits. This unified approach improved communication
approach reduces the risk of accidental or malicious between stakeholders, enhancing overall efficiency and
data manipulation by unqualified users significantly. reducing administrative overhead significantly.

43. What advantage resulted from teachers entering marks Direction :Carefully read the case study provided and then
directly into the system? thoroughly answer the subsequent five questions.
(A) Increased manual errors The public library in Rivertown implemented a Python-
(B) Enhanced duplication of data based file management program to track book loans
(C) Reduced manual errors and returns. Librarians used text files to store member
(D) Slower result processing data and borrowed titles. They noticed that frequent
updates sometimes introduced errors, prompting a shift
Ans
to binary files with the pickle module for more reliable
(C) Reduced manual errors data serialization. By catching exceptions, the system
Having teachers directly enter marks into the database avoided crashes when members tried to return non-
decreases reliance on paper records, minimizing existent books or input invalid IDs. Staff created custom
transcription errors. It eliminates additional data entry exceptions to highlight overdue items, simplifying the fine
steps, enhancing accuracy and saving time. Automated calculation process. A robust try-except-finally structure
checks within the system can also validate inputs, ensured that files were closed properly, preventing data
ensuring that potential mistakes are caught early and corruption during unexpected shutdowns. As a result,
corrected before finalizing results very efficiently. library staff gained confidence in the program’s accuracy,
improved record-keeping, and streamlined daily tasks.
44. Which concept ensures linked tables remain consistent,
Fewer mistakes boosted overall patron satisfaction.
preventing orphan records?
This migration reduced manual intervention and saved
(A) Data replication
valuable time.
(B) Referential integrity
(C) Transaction logging 46. Why did the library switch from text files to binary files
(D) Composite indexing with the pickle module?
Ans (A) Text files are always read-only
(B) Binary files cannot store complex objects
(B) Referential integrity
(C) To achieve more reliable data serialization
Referential integrity enforces valid relationships
(D) To prevent librarians from accessing data
between tables. For example, a student ID in the grades
table must match an existing record in the students table.  Ans
If a related record is deleted, referential integrity ensures (C) To achieve more reliable data serialization
corresponding entries are handled appropriately. This Binary files using pickle allow Python objects to be saved
safeguard keeps linked data synchronized and prevents and restored with minimal loss or formatting issues.
invalid references effectively. Text files can introduce parsing errors or encoding
conflicts, especially when the data structure is complex.
45. What was a direct benefit of centralizing data across
By adopting pickle, the library ensured dependable and
multiple departments?
consistent records, minimizing errors and preserving
(A) More scattered data storage
data relationships.
(B) Separate databases for each department
(C) Faster result generation and communication 47. How did custom exceptions help the library manage
(D) Removal of all security protocols overdue books?
Ans (A) By hiding all error messages
(B) By automatically destroying files

Downloaded from www.mcqgpt.com


page 16 CUET UG Computer Science

(C) By highlighting overdue items for fine calculation (C) Enhanced patron satisfaction
(D) By forcing a program restart (D) Mandatory system shutdowns
Ans  Ans
(C) By highlighting overdue items for fine calculation (C) Enhanced patron satisfaction
Custom exceptions allowed staff to specifically detect As errors declined, patrons encountered fewer billing
and handle overdue cases, triggering alerts or special disputes, missed due dates, or incorrect records. The
logic for fines. Rather than mixing overdue errors with system’s reliability improved trust in library services,
generic exceptions, these user-defined types made the leading to happier members. Staff also spent less time
code easier to maintain. This approach streamlined troubleshooting problems and more time assisting
the process of identifying late returns and automating visitors. Consequently, overall satisfaction and
penalty assessments very effectively. confidence in the digital system increased.

48. What role does the try-except-finally structure play in  **************


the library program?
(A) It prevents any user input
(B) It ensures files are closed properly and errors are
handled
(C) It skips exception handling entirely
(D) It merges multiple files into one
Ans
(B) It ensures files are closed properly and errors are
handled
The try block houses code that may trigger exceptions,
the except block catches and manages any errors, and
finally guarantees essential cleanup, like closing files.
This prevents data corruption when unexpected issues
arise. By encapsulating operations, librarians reduce the
risk of program crashes and maintain consistent record
updates effectively and safely.

49. Which issue prompted the library to handle exceptions


when members returned books?
(A) Non-existent books or invalid IDs
(B) Overly large file sizes
(C) Automatic disposal of records
(D) Perfectly functioning returns
Ans
(A) Non-existent books or invalid IDs
When members attempted to return books not listed or
entered an incorrect ID, the system could crash without
proper exception handling. By validating these inputs
and catching related errors, librarians preserved data
integrity and user experience. This approach ensured
the program gracefully handled irregularities instead of
terminating unexpectedly or losing records.

50. What was one outcome of fewer mistakes in the library’s


file handling process?
(A) Lower patron satisfaction
(B) Frequent data loss

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


PRACTICE PAPER 02

PRACTICE PAPER 02

1. Which of the following correctly describes the difference (B) ALTER TABLE
between a candidate key and the primary key in a table? ALTER TABLE allows changes to a table’s structure,
(A) A candidate key must contain exactly two columns, including adding or dropping columns, modifying
while the primary key has one column definitions, or renaming the table. CREATE
(B) A candidate key is any potential unique key, while TABLE establishes a new table, UPDATE modifies row
the primary key is the chosen unique identifier data, and USE switches the current database context. By
(C) A candidate key can be repeated, while the primary using ALTER TABLE, administrators adapt schemas to
key cannot evolving data requirements.
(D) There can be multiple primary keys but only one
4. Why is the WHERE clause often used in an UPDATE
candidate key
statement?
Ans (A) To automatically join two tables
(B) A candidate key is any potential unique key, while (B) To filter the rows that should be modified
the primary key is the chosen unique identifier (C) To reorder columns before modification
Candidate keys are attributes or sets of attributes that (D) To generate a new index
uniquely identify table records. The primary key is  Ans
selected from among these candidate keys as the main
identifier. While multiple candidate keys can exist, (B) To filter the rows that should be modified
only one is chosen as the primary key. This distinction In SQL, the WHERE clause narrows the scope of
ensures database tables are unambiguously referenced. an UPDATE statement by specifying which rows
to change. Without WHERE, every row in the table
2. In relational algebra, which operation returns a subset of would be updated, potentially causing unintended
columns from a relation? data alterations. By filtering targeted rows, developers
(A) Selection (σ) maintain precision and protect data integrity during
(B) Projection (π) modification operations.
(C) Union
5. Which of the following is NOT a valid DDL (Data
(D) Cartesian Product (×)
Definition Language) command in SQL?
Ans (A) CREATE
(B) Projection (π) (B) DROP
Projection (π) in relational algebra extracts specific (C) TRUNCATE
columns (attributes) from a relation, effectively (D) SELECT
narrowing the data set. By contrast, Selection (σ) filters  Ans
rows based on conditions, Unionmerges two relations
with similar attributes, and Cartesian Product (×) pairs (D) SELECT
every row of one relation with every row of another. Data Definition Language includes commands like
CREATE, DROP, and TRUNCATE to define or alter
3. Which command in MySQL modifies the structure of database structures. SELECT is part of Data Query
an existing table, such as adding a new column? Language (DQL), used for retrieving data rather than
(A) CREATE TABLE modifying schema. Thus, while SELECT is critical for
(B) ALTER TABLE querying, it does not define or remove tables, indexes,
(C) UPDATE or constraints.
(D) USE
6. Which statement distinguishes the HAVING clause
Ans from the WHERE clause in SQL?

Downloaded from www.mcqgpt.com


page 18 CUET UG Computer Science

(A) HAVING is used only with numeric columns, (A) Switch


WHERE for text columns (B) Gateway
(B) HAVING filters rows before aggregation, WHERE (C) Repeater
filters groups after aggregation (D) Router
(C) HAVING filters groups after aggregate functions,  Ans
WHERE filters rows before aggregation
(D) Both HAVING and WHERE are identical (C) Repeater
A repeater boosts or regenerates signals, allowing them
Ans to travel over longer distances without significant loss.
(C) HAVING filters groups after aggregate functions, It operates solely at the physical layer, forwarding every
WHERE filters rows before aggregation bit without filtering or interpreting addresses. Routers,
WHERE applies conditions to individual rows before switches, and gateways perform more advanced
grouping or aggregating data. HAVING applies tasks like routing, switching, or protocol translation,
conditions to grouped records, typically used with respectively, beyond simple signal regeneration.
aggregate functions like SUM or COUNT. This
10. Which protocol is primarily responsible for transferring
distinction allows developers to exclude entire grouped
results based on aggregate values, whereas WHERE files between client and server on a network?
discards rows prior to any grouping step. (A) HTTP
(B) FTP
7. Which aggregate function in MySQL would best provide (C) SMTP
the total of a numeric column across all rows? (D) PPP
(A) AVG()  Ans
(B) SUM()
(C) COUNT() (B) FTP
(D) POWER() File Transfer Protocol (FTP) enables uploading and
downloading files between a client and a server over
Ans a network. HTTP is mainly for transferring hypertext
(B) SUM() documents, SMTP is for sending email, and PPP
SUM() computes the total of the values in a specified establishes direct connections over serial links. FTP
column, making it suitable for calculating overall supports directory listing, file manipulation, and
amounts, such as total sales or total marks. AVG() authenticated sessions for secure transfers.
gives the mean, COUNT() determines the number of
11. Arrange these network developments in the order they
rows, and POWER() is a mathematical function for
exponentiation, not used for summing column values. emerged:
1. Invention of Ethernet
8. Which network topology involves a single backbone 2. Introduction of Wi-Fi (802.11)
cable to which all nodes are directly connected? 3. Rise of optical fiber for high-speed links
(A) Star 4. Widespread mobile broadband (4G/5G)
(B) Bus (A) 1 -> 2 -> 3 -> 4
(C) Ring (B) 2 -> 3 -> 1 -> 4
(D) Mesh (C) 2 -> 1 -> 4 -> 3
Ans (D) 3 -> 4 -> 2 -> 1

(B) Bus  Ans


In a bus topology, all devices attach to a central cable (A) 1 -> 2 -> 3 -> 4
known as the bus. Signals travel in both directions along Ethernet was introduced in the 1970s, becoming a
this backbone. A break in the cable can halt the entire standard for wired local networks. Wi-Fi (802.11) began
network. Though simpler and cheaper for small setups, in the late 1990s, enabling wireless LANs. Optical fiber
bus topologies are less commonly used today due to rose to prominence for high-speed backbone links,
scalability issues. especially in the 2000s. Finally, widespread mobile
broadband (4G/5G) expanded robust wireless access for
9. Which device regenerates signals to extend the range of smartphones and devices.
a network but does not route or filter traffic?

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


PRACTICE PAPER 02

12. Match each layer of the TCP/IP model with its primary Ring’s declining usage further differentiates it from
responsibility: contemporary wireless networking methods.
Column I Column II 14. How does a switch differ from a hub in local area
1. Network Interface a. Ensures end-to-end networking?
Layer communication and (A) A switch broadcasts incoming data to all ports,
error-checking (e.g., while a hub filters by MAC
TCP, UDP) (B) Both forward packets to all ports, but a switch is
2. Internet Layer b. Interacts with user slower
applications and (C) A hub blindly repeats signals, while a switch
protocols (e.g., HTTP, forwards data selectively using MAC addresses
FTP) (D) Hubs are Layer 3 devices, switches are Layer 1
3. Transport Layer c. Maps IP addresses  Ans
to MAC and handles (C) A hub blindly repeats signals, while a switch
physical network forwards data selectively using MAC addresses
details A hub replicates incoming signals to all connected
4. Application Layer d. Routes data across ports, causing unnecessary traffic. A switch reads MAC
multiple networks via addresses to send data only to the intended recipient
IP port, reducing collisions and improving throughput.
Options: This operation occurs at the data link layer, making
(A) 1-a, 2-b, 3-d, 4-c switches more efficient and scalable than basic hubs.
(B) 1-c, 2-d, 3-a, 4-b
15. Which Python statement is used to raise a user-defined
(C) 1-d, 2-a, 3-c, 4-b
exception intentionally?
(D) 1-b, 2-c, 3-a, 4-d
(A) throw
Ans (B) catch
(B) 1-c, 2-d, 3-a, 4-b (C) raise
The Network Interface Layer oversees physical network (D) except
details, including MAC addresses. The Internet Layer  Ans
uses IP for routing across networks. The Transport Layer
(C) raise
(TCP/UDP) provides end-to-end reliability or speed.
In Python, the raise statement explicitly triggers an
The Application Layer handles high-level protocols such
exception, often a user-defined subclass of Exception.
as HTTP and FTP. Proper layering ensures modular
Developers employ raise to handle error conditions
design and easier troubleshooting.
programmatically or to communicate invalid states.
13. Which of the following is NOT a wireless communication Other keywords, like except, are used for catching
technology mentioned in typical WLAN/WPAN exceptions, while throw is not a native Python keyword
contexts? for exceptions.
(A) Bluetooth
16. What is the purpose of a finally block in Python
(B) Infrared
exception handling?
(C) Microwave
(A) To disable all error messages
(D) Token Ring
(B) To ensure code within it executes regardless of
Ans exceptions
(D) Token Ring (C) To declare custom exception classes
Token Ring is a wired LAN protocol where a token (D) To skip the except block
circulates in a ring topology to manage access. It  Ans
is not a wireless technology like Bluetooth (short-
(B) To ensure code within it executes regardless of
range WPAN), Infrared (line-of-sight connectivity),
exceptions
or Microwave (point-to-point wireless links). Token
A finally block contains statements that run whether
an exception occurs or not. It is frequently used for

Downloaded from www.mcqgpt.com


page 20 CUET UG Computer Science

cleanup, like closing files or releasing resources. This typical for images or serialized objects, while text mode
design guarantees that critical post-processing steps suits readable data formats.
happen even if errors surface, maintaining program
20. Which Python module allows the serialization of objects
stability and preventing resource leaks or corruption.
to and from binary files with minimal effort?
17. Which built-in exception is raised in Python when an (A) csv
invalid index is used on a list or string? (B) pickle
(A) ValueError (C) sqlite3
(B) TypeError (D) json
(C) IndexError  Ans
(D) KeyError
(B) pickle
Ans The pickle module in Python simplifies writing and
(C) IndexError reading serialized objects to binary files. It preserves
IndexError appears when a sequence reference, such object structure, including nested data. Although json
as my_list[5], goes out of valid range. ValueError is popular for text-based serialization, it omits certain
arises from an inappropriate value, TypeError stems Python-specific objects. csv is for comma-separated text
from using incorrect types, and KeyError occurs when data, and sqlite3 is a database interface. pickle best fits
a dictionary key is missing. Understanding these full object serialization.
distinctions helps developers create robust exception-
21. Why is a stack particularly useful for managing function
handling logic in Python.
calls in many programming languages?
18. Which of these file modes in Python does NOT preserve (A) It sorts function names alphabetically
existing file data? (B) It allows the last invoked function to be handled
(A) r first upon return
(B) a (C) It requires all function calls to complete in parallel
(C) r+ (D) It merges multiple return values into a single
(D) w variable
Ans  Ans
(D) w (B) It allows the last invoked function to be handled first
Using w overwrites the file, creating a new, empty file upon return
if one does not already exist or discarding existing Stacks implement the Last-In, First-Out principle,
contents if it does. The r mode is read-only, a appends aligning with how function calls nest. When a function
new data, and r+ allows reading and writing without calls another, the return address is pushed onto the stack;
automatically truncating existing content. after completion, that address is popped, resuming the
caller. This mechanism elegantly manages nested calls,
19. How does reading from a binary file in Python differ local variables, and return sequences without confusion.
from reading from a text file?
(A) Binary files cannot be read in Python 22. In infix to postfix conversion using a stack, what role
(B) Text files must only store ASCII content does operator precedence serve?
(C) Binary files store data as raw bytes, while text files (A) It is ignored entirely
store data in human-readable encoding (B) It dictates the order in which operators are popped
(D) There is no difference at all and pushed
Ans (C) It ensures operands are processed before operators
(D) It blocks parentheses from being used
(C) Binary files store data as raw bytes, while text files
store data in human-readable encoding  Ans
In Python, reading binary files retrieves a sequence of (B) It dictates the order in which operators are popped
bytes exactly as stored, whereas text files are interpreted and pushed
using an encoding (e.g., UTF-8). This distinction affects When converting infix expressions to postfix, a stack is
how data is processed and displayed. Binary mode is used to temporarily hold operators. Higher-precedence
operators must be popped and output before pushing

Downloaded from www.mcqgpt.com


PRACTICE PAPER 02

lower-precedence ones. Parentheses further override pointer (3) to reflect the new head, and finally return
precedence. This systematic handling of precedence and or record the removed element (4). This straightforward
associativity ensures that the resulting postfix expression sequence maintains the FIFO ordering characteristic of
evaluates correctly. queues.

23. Which operation in a queue is responsible for inserting 26. Match each searching algorithm with its key
a new element at the rear? characteristic:
(A) DEQUEUE Column I Column II
(B) ENQUEUE 1. Linear Search a. Uses a hashing function to
(C) FRONT directly map keys
(D) POP
2. Binary Search b. Checks elements
Ans sequentially until a match
(B) ENQUEUE is found
ENQUEUE adds an element to the rear (tail) of a queue, 3. Hashing c. Locates the middle index,
maintaining its First-In, First-Out structure. DEQUEUE requiring sorted data
removes an element from the front. FRONT or PEEK 4. Interpolation d. Estimates the position
may return the first element without removal. These Search based on the key’s
fundamental operations keep the queue orderly for distribution
scheduling, buffering, or level-order processing tasks. Options:
(A) 1-a, 2-c, 3-d, 4-b
24. Which statement about a circular queue is FALSE?
(B) 1-b, 2-d, 3-c, 4-a
(A) It links the rear back to the front array index
(C) 1-b, 2-c, 3-a, 4-d
(B) It allows unused space to be reused
(D) 1-d, 2-a, 3-b, 4-c
(C) It automatically sorts the queue elements
(D) It prevents the queue from becoming full when  Ans
there are free slots (C) 1-b, 2-c, 3-a, 4-d
Ans Linear Search (1-b) checks each element one by one.
Binary Search (2-c) halves a sorted list. Hashing (3-
(C) It automatically sorts the queue elements
a) applies a hash function to directly index data.
A circular queue reuses vacated positions by wrapping
Interpolation Search (4-d) estimates the likely position
around, linking rear and front indexes. This design
by examining key distribution. Correct mapping
prevents false-full conditions when free space exists.
underscores their differing performance and data
However, it does not inherently sort the elements. Any
requirements.
sorting or priority management requires separate logic.
The circular structure simply optimizes space usage in 27. Which statements are true about binary search?
queue implementations. 1. The list must be sorted.
2. Worst-case complexity is O(n).
25. Arrange the operations for deleting an element from a
3. It compares the target with the middle element.
simple (linear) queue in the correct sequence:
4. It consistently splits the data into two halves.
1. Check if queue is empty
(A) 1, 3, and 4 only
2. Remove the front element
(B) 1 and 2 only
3. Increment the front pointer
(C) 2 and 3 only
4. Return or store the removed element
(D) 1, 2, 3, and 4
(A) 1 -> 2 -> 4 -> 3
(B) 1 -> 4 -> 3 -> 2  Ans
(C) 1 -> 2 -> 3 -> 4 (A) 1, 3, and 4 only
(D) 2 -> 3 -> 4 -> 1 Binary search needs a sorted list (statement 1). It
Ans compares the target with the middle element (statement
3) and splits the list roughly in half each iteration
(C) 1 -> 2 -> 3 -> 4
(statement 4). Its worst-case time complexity is O(log
To delete from a queue, first verify it is not empty (1).
Then remove the front element (2), update the front

Downloaded from www.mcqgpt.com


page 22 CUET UG Computer Science

n), not O(n). Hence, 1, 3, and 4 accurately describe of-place algorithms might copy the entire dataset to
binary search. another structure. In-place sorting conserves space
without inherently changing time complexity.
28. Assertion (A) : Linear search is simpler to implement
than binary search. 31. Which of these statements about Quick Sort is FALSE?
Reason (R) : Linear search requires the data to be sorted (A) It uses a pivot to partition the array
before any lookup. (B) Its average time complexity is O(n log n)
(A) Both (A) and (R) are true, and (R) is the correct (C) It never degrades to O(n²)
explanation of (A). (D) It relies on a divide-and-conquer approach
(B) Both (A) and (R) are true, but (R) is not the correct  Ans
explanation.
(C) (A) is true, (R) is false. (C) It never degrades to O(n²)
(D) (A) is false, (R) is true. Quick Sort can degrade to O(n²) performance in
the worst case, particularly when the chosen pivot
Ans consistently produces unbalanced partitions. Its average
(C) (A) is true, (R) is false. performance is O(n log n), and it does employ a divide-
Linear search is indeed simpler to code because it and-conquer method with a pivot. Hence, claiming it
checks each element in turn, but it does not require never hits O(n²) is false.
sorting; it can operate on unsorted data. Binary search
32. Which measure of central tendency is most appropriate
is more complex yet requires sorted data. Therefore, the
assertion is correct, but the stated reason is incorrect for if a dataset has extreme outliers?
linear search. (A) Mean
(B) Median
29. Which sorting algorithm repeatedly divides the array (C) Mode
into halves, sorts each half, and merges them? (D) Range
(A) Bubble Sort  Ans
(B) Insertion Sort
(C) Quick Sort (B) Median
(D) Merge Sort The median, being the middle value in an ordered
list, is less sensitive to extreme outliers than the mean.
Ans Outliers can skew the mean significantly, while the
(D) Merge Sort median remains more robust. The mode indicates the
Merge Sort employs a divide-and-conquer approach, most frequent value, and the range only captures the
splitting the array into halves until single or small span between minimum and maximum.
segments remain, then merging them in sorted order.
33. What is variance in statistics?
This method achieves O(n log n) performance in the
worst case. Bubble Sort and Insertion Sort are O(n²) in (A) The middle value of a dataset
worst cases, while Quick Sort has variable performance. (B) The most occurring value in a dataset
(C) The average of the squared deviations from the
30. What does the term in-place mean in the context of mean
sorting algorithms? (D) The difference between the maximum and
(A) Sorting data while using minimal extra space minimum values
(B) Sorting data in the cloud  Ans
(C) Storing sorted data in a separate output file
(D) Changing the algorithm’s complexity from O(n²) to (C) The average of the squared deviations from the mean
O(1) Variance calculates how far each data point lies from
the mean, averaging the squared differences. A larger
Ans variance indicates wider spread, while a smaller one
(A) Sorting data while using minimal extra space means data is closely clustered. The standard deviation
An in-place sorting algorithm rearranges elements is the square root of this value, and other measures
within the given data structure, requiring only a (median, mode, range) capture different aspects.
constant or minimal amount of additional storage.
This approach is more memory-efficient, whereas out-

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


PRACTICE PAPER 02

34. Match each descriptive statistic with its description: results, functioning like a unique filter.
(A) Both (A) and (R) are true, and (R) is the correct
Column I Column II
explanation of (A).
1. Standard a. The most frequently (B) Both (A) and (R) are true, but (R) is not the correct
Deviation occurring number in the explanation.
dataset (C) (A) is true, (R) is false.
2. Mode b. The arithmetic average of all (D) (A) is false, (R) is true.
values
 Ans
3. Mean c. The amount of spread around
the mean, derived from (C) (A) is true, (R) is false.
variance’s square root While GROUP BY is typically used with aggregate
functions, MySQL syntax allows using GROUP BY
4. Range d. The difference between the
in queries even without them. However, it does not
largest and smallest values
function simply as a distinct filter. Using GROUP BY
Options: without aggregates can lead to nondeterministic results
(A) 1-c, 2-a, 3-b, 4-d unless you specify which columns to group and select
(B) 1-a, 2-b, 3-c, 4-d consistently.
(C) 1-d, 2-c, 3-a, 4-b
(D) 1-b, 2-d, 3-a, 4-c 37. Which statements are true regarding primary and
foreign keys in relational databases?
Ans
1. A primary key uniquely identifies each row in its
(A) 1-c, 2-a, 3-b, 4-d own table.
Standard Deviation (1-c) measures data spread around 2. A table can have multiple primary keys
the mean. Mode (2-a) is the most frequent value. Mean simultaneously.
(3-b) is the sum of all values divided by the count. 3. A foreign key references a column in another table.
Range (4-d) captures the difference between the highest 4. A foreign key always points to multiple rows in the
and lowest. Matching these terms clarifies fundamental referenced table.
descriptive statistics usage. (A) 1 and 3 only
(B) 1, 2, and 4 only
35. How does the median differ from the mean in assessing
(C) 2 and 4 only
central tendency?
(D) 1, 3, and 4 only
(A) The median always equals the mean in every dataset
(B) The median is highly affected by outliers, while the  Ans
mean is not (A) 1 and 3 only
(C) The median is the central value when data is sorted, The primary key ensures uniqueness in its table
while the mean is the arithmetic average (statement 1), and a foreign key references a column
(D) The mean always gives integer values, while the (often a primary key) in another table (statement 3). A
median gives fractions table can have exactly one primary key at a time, though
Ans it might be a composite. A foreign key may reference one
or more rows but does not always reference multiples.
(C) The median is the central value when data is sorted,
while the mean is the arithmetic average 38. Match each Python file mode or function with its
The median splits a sorted dataset so half the values lie description:
below it and half above. The mean, in contrast, sums all
values then divides by the total count. Outliers can pull Column I Column II
the mean significantly, whereas the median can remain 1. a a. Creates a new file for writing,
more stable. Both measures provide useful but different fails if file exists
perspectives. 2. x b. Opens a file for appending,
creates if it does not exist
36. Assertion (A) : In MySQL, the GROUP BY clause can be
3. close() c. Writes and reads, truncates file
used without any aggregate functions.
if it exists
Reason (R) : GROUP BY purely ensures distinct row

Downloaded from www.mcqgpt.com


page 24 CUET UG Computer Science

4. w+ d. Terminates the connection to Direction :Carefully read the case study provided and then
an open file thoroughly answer the subsequent five questions.
TechNova University migrated its student registration
Options:
system to a robust database architecture to cope with
(A) 1-a, 2-d, 3-c, 4-b
increased enrollment. Each department maintained
(B) 1-b, 2-a, 3-d, 4-c
unique tables for courses and prerequisites, leading to
(C) 1-b, 2-c, 3-a, 4-d
complex data relationships. By introducing a single,
(D) 1-d, 2-b, 3-c, 4-a
centralized schema, administrators established strict
Ans primary and foreign key constraints. This change allowed
(B) 1-b, 2-a, 3-d, 4-c department heads to cross-reference course details for
Mode a (1-b) appends and creates a file if none exists. scheduling without duplicating records. A specialized table
Mode x (2-a) insists on creating a new file, failing if it tracked prerequisite chains, ensuring new registrations
already exists. The close() function (3-d) ends interaction met course requirements. The SQL engine enforced data
with an open file, releasing system resources. Mode w+ consistency, rejecting invalid entries automatically. A new
(4-c) opens for reading and writing, truncating existing reporting module generated real-time enrollment stats,
content. aiding timely decisions. Faculty praised the improved
integrity checks, while students benefited from a unified
39. Which network security concept uses a set of rules to portal showing all available electives. Overall, the system’s
allow or block traffic based on IP addresses or ports? reliability enhanced transparency and streamlined the
(A) Firewall registration workflow. This consistent platform reduced
(B) Adware administrative workload significantly.
(C) Worm
(D) Spam filter 41. Which structural adjustment helped departments avoid
duplicating course data?
Ans (A) Using separate databases for each department
(A) Firewall (B) Introducing a single, centralized schema
A firewall monitors and controls incoming and (C) Allowing each department to store identical tables
outgoing network traffic by applying security policies (D) Removing all foreign keys to simplify relationships
to IP addresses, ports, or protocols. Adware displays  Ans
unwanted ads, worms self-replicate through vulnerable
systems, and spam filters specifically target unsolicited (B) Introducing a single, centralized schema
emails. Firewalls serve as a perimeter defense By merging departmental data into one unified database
mechanism in many networks and hosts. design, TechNova prevented redundant entries across
departments. This single schema enforced shared
40. Which method best safeguards a database from SQL references for courses and prerequisites, eliminating
injection attacks? conflicts. Rather than each department storing its own
(A) Concatenating user inputs directly into the SQL table duplicates, all courses were integrated, maintaining
query consistency and significantly reducing duplication
(B) Using parameterized queries or prepared hazards.
statements
(C) Disabling all user inputs 42. How did the prerequisite table improve course
(D) Relying on client-side JavaScript for validation registration?
(A) It removed the need to check course requirements
Ans (B) It tracked prerequisite chains to enforce valid
(B) Using parameterized queries or prepared statements enrollment
Parameterized queries keep user inputs separate (C) It assigned random prerequisites to each student
from the query structure, preventing malicious SQL (D) It replaced the primary key in all tables
fragments from altering command logic. Concatenating  Ans
user strings is risky, and solely depending on client-side
checks is insufficient because attackers can bypass them. (B) It tracked prerequisite chains to enforce valid
Prepared statements ensure robust server-side input enrollment
handling, effectively mitigating injection risks.

Downloaded from www.mcqgpt.com


PRACTICE PAPER 02

The prerequisite table recorded which courses (A) They were forced to enroll without seeing electives
depended on others, ensuring no student registered for (B) They could only view courses from one department
an advanced subject without the required background. (C) They had a single interface listing all electives and
When a registration command was executed, the requirements
system verified this chain. Invalid enrollments were (D) They had no access to prerequisite checks
rejected, promoting academic standards and preventing  Ans
unprepared students from joining advanced classes
prematurely. (C) They had a single interface listing all electives and
requirements
43. What was one direct result of enforcing foreign key A consolidated platform showed every elective
constraints at TechNova University? from all departments, along with prerequisites. This
(A) Automatic acceptance of all invalid entries eliminated confusion caused by scattered course data
(B) Students could register without departmental and empowered students to plan their academic paths
approval holistically. Transparency regarding prerequisites and
(C) Improved data consistency and rejection of scheduling simplified decision-making, enhancing the
incorrect references user experience and reducing errors in course selection.
(D) Departments lost the ability to share tables
Direction :Carefully read the case study provided and then
Ans thoroughly answer the subsequent five questions.
(C) Improved data consistency and rejection of incorrect GridCom Solutions built a Python tool to analyze
references network performance metrics for clients with multiple
Foreign key constraints ensure that any referenced branch offices. They stored logs as binary files, each
record exists in the parent table. This design eliminates containing serialized Python objects detailing packet loss,
orphan records, enforces valid relationships, and helps latency, and jitter measured daily. Network engineers
the database reject erroneous entries automatically. wrote custom exceptions to flag anomalies like extreme
At TechNova, referencing a non-existent course or latency spikes, prompting immediate alerts. The tool
an invalid student ID triggered an error, upholding ran scheduled tasks to read these files, parse objects,
integrity across related tables. and create graphical summaries. Using try-except-
finally ensured that files closed even if an error surfaced
44. Which feature made it easier for departments to see partway, safeguarding data integrity. A mismatch in file
real-time enrollment numbers? structure triggered a ValueError, prompting the system
(A) Manual data reconciliation each night to log it for later review. Over months, the approach
(B) A specialized script that exported CSVs once a helped technicians track performance trends accurately,
week refine bandwidth allocations, and troubleshoot problem
(C) The new reporting module that generated live segments in real time. Client satisfaction rose as diagnoses
statistics became faster and more precise.
(D) The removal of all constraints so queries ran faster
46. Why did GridCom Solutions choose binary files for
Ans
storing network metrics?
(C) The new reporting module that generated live (A) Because text files cannot handle numeric data
statistics (B) Because binary files preserve serialized Python
TechNova’s reporting module gathered current objects efficiently
registration data from the centralized schema. Instead (C) To ensure only large corporations could read the
of waiting for manual synchronization, users accessed data
up-to-date enrollment counts on demand. Such real- (D) To prevent reading the logs from Python
time insights helped administrators manage course
capacity, scheduling, and resource allocation effectively,  Ans
avoiding guesswork and reactive decision-making in a (B) Because binary files preserve serialized Python
rapidly changing environment. objects efficiently
Storing metrics as serialized Python objects in binary
45. How did students benefit from this unified portal for files prevents data loss from formatting or encoding
course enrollment? conflicts. The tool can directly load objects with minimal

Downloaded from www.mcqgpt.com


page 26 CUET UG Computer Science

parsing, retaining structure for parameters like latency engineers to diagnose the mismatch and correct file
or jitter. This streamlined approach improves efficiency generation processes.
and consistency compared to text-based logs, which
50. Which outcome best describes how clients benefited
need additional parsing logic.
from these detailed performance metrics?
47. How did custom exceptions assist in maintaining (A) Slower problem resolution and frequent
network quality? misdiagnoses
(A) They disabled all anomaly detection (B) Complete elimination of latency in all networks
(B) They triggered immediate alerts for critical issues (C) Faster troubleshooting and targeted bandwidth
(C) They forced logs to remain unreadable adjustments
(D) They bypassed error handling automatically (D) Inability to view historical trends
Ans  Ans
(B) They triggered immediate alerts for critical issues (C) Faster troubleshooting and targeted bandwidth
By defining specialized exceptions to detect extreme adjustments
latency spikes or abnormal packet loss, the tool With accurate daily metrics on packet loss, latency, and
promptly alerted engineers. This proactive notice let jitter, engineers could pinpoint congested segments
teams address possible configuration errors or network and allocate resources optimally. Rapid anomaly alerts
congestion swiftly. Rather than filtering issues only in meant faster intervention. Historical trends illuminated
logs, custom exceptions escalated critical events in real recurring issues, guiding long-term improvements.
time, preserving service quality. Overall, clients saw better service reliability and more
proactive problem-solving, boosting confidence in
48. Why was try-except-finally crucial for handling file GridCom’s solutions.
operations in this Python tool?
(A) It delayed file closing until the end of the year  **************
(B) It guaranteed that files closed even if errors occurred
(C) It prevented reading binary data
(D) It produced random merges of data
Ans
(B) It guaranteed that files closed even if errors occurred
The try block runs the primary logic, while except catches
specific errors that might arise when reading or parsing
metrics. The finally block executes regardless, closing
the file to avoid resource leaks or corrupted writes. This
pattern safeguards data integrity and ensures the system
remains stable under unexpected conditions.

49. What happened when the Python tool encountered a


file structure mismatch (e.g., missing fields)?
(A) The system ignored the file and deleted all data
(B) A ValueError was raised and logged for review
(C) All logs were accepted without question
(D) The entire Python program crashed irrecoverably
Ans
(B) A ValueError was raised and logged for review
In the event of mismatched data structures, a ValueError
signaled the discrepancy. The code caught this
exception, recording relevant details in a log for further
analysis. This approach prevented abrupt termination
and ensured partial data remained usable, enabling

Downloaded from www.mcqgpt.com


PRACTICE PAPER 03

PRACTICE PAPER 03

1. Which of the following best describes the primary key union. By focusing on shared entries, it helps refine
in a relational database? query results and isolate data satisfying both conditions.
(A) A field used for text manipulation Consequently, it ensures consistent data subsets.
(B) A field that uniquely identifies each record
4. Why is using the SELECT-FROM-WHERE structure in
(C) A field for aggregated numeric calculations
(D) A field for storing duplicate values SQL essential for retrieving data effectively?
(A) It forces usage of advanced functions
Ans (B) It enforces mandatory sorting
(B) A field that uniquely identifies each record (C) It structures queries with clarity
The primary key is a unique identifier for each tuple in (D) It hides columns automatically
a relation, preventing duplication. It ensures that every  Ans
row in the table can be accessed or referenced uniquely.
By maintaining uniqueness and non-null constraints, it (C) It structures queries with clarity
forms the cornerstone of relational database integrity The SELECT-FROM-WHERE structure organizes data
and effective data retrieval for overall consistency. retrieval by specifying required columns, relevant tables,
and filtering criteria. This standard approach fosters
2. Define the term foreign key in relational database readability, maintainability, and accuracy, allowing
design. queries to be logically formulated. By delineating what,
(A) A key that increases query speed where, and how to extract data, it reduces ambiguities
(B) A field used to store encrypted data and leads to comprehensible and efficient database
(C) A field referencing a primary key in another table operations.
(D) A field for storing only text values
5. Which of the following is NOT a Data Manipulation
Ans Language (DML) command in SQL?
(C) A field referencing a primary key in another table (A) INSERT
A foreign key is a relational database field matching the (B) SELECT
primary key of another table, creating a relationship. (C) UPDATE
It enforces referential integrity by ensuring that linked (D) DROP
records remain consistent across tables. This connection  Ans
helps maintain structured data, allowing queries to
combine information accurately and prevent invalid (D) DROP
references or data anomalies. DML commands focus on modifying data within
existing database structures, whereas DROP is a Data
3. Which relational algebra operation returns all rows that Definition Language command used to remove entire
appear in both of two relations? tables or databases. INSERT, SELECT, and UPDATE
(A) Union manipulate data records, but DROP eliminates the
(B) Intersection schema object itself, making it distinct from pure data
(C) Projection manipulation operations.
(D) Selection
6. How does using a primary key differ from using an
Ans alternate key in relational design?
(B) Intersection (A) Both can have null values
Intersection in relational algebra yields only those (B) Primary key identifies records, alternate key
tuples that are common to both relations. It filters out duplicates them
rows not appearing in both sets, which is distinct from (C) Primary key is chosen as main identifier, alternate

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


page 28 CUET UG Computer Science

key is a candidate key not selected (C) It reduces anomalies and duplicates
(D) They are identical in function Database normalization organizes tables to minimize
Ans redundant data and avoid inconsistencies. By structuring
fields to follow specific forms (1NF, 2NF, 3NF, etc.),
(C) Primary key is chosen as main identifier, alternate normalization combats update, insertion, and deletion
key is a candidate key not selected anomalies. These controlled relationships prevent
Multiple candidate keys might qualify to uniquely duplication and improve integrity, making queries more
identify rows, but only one becomes the primary key. efficient and data maintenance more reliable.
Those not chosen serve as alternate keys. Although
they share uniqueness, the primary key is the official 10. Which of the following commands will NOT remove
identifier. Alternate keys remain potential references any rows from a table directly?
if the primary key changes, ensuring flexible table (A) DELETE
relationships. (B) UPDATE
(C) TRUNCATE
7. Which SQL function is best for converting a string to (D) DROP
uppercase?
(A) MID()  Ans
(B) LCASE() (B) UPDATE
(C) UCASE() UPDATE modifies existing rows based on defined criteria
(D) LENGTH() but does not remove them. DELETE and TRUNCATE
Ans eliminate rows (with TRUNCATE removing all records
quickly), whereas DROP eliminates the table structure
(C) UCASE() entirely. UPDATE only changes field values, preserving
UCASE(), also known as UPPER() in some SQL dialects, rows, making it distinct from removal operations.
changes every character of the string to uppercase. While
LCASE() transforms text to lowercase, MID() extracts a 11. Define a tuple in the context of relational databases.
substring, and LENGTH() calculates character count. (A) A column heading
UCASE() is specifically intended for converting letters (B) A single row in a table
to uppercase, aiding in uniform text formatting. (C) A combined foreign key structure
(D) A specialized type of query
8. Which operator in MySQL returns records that meet at
least one of multiple conditions?  Ans
(A) AND (B) A single row in a table
(B) OR In relational database terminology, a tuple represents a
(C) NOT single row within a relation (table). Each tuple consists
(D) XOR of specific attribute values that collectively describe an
Ans entity instance. By storing related data in these rows,
relational databases facilitate structured querying, data
(B) OR manipulation, and adherence to defined constraints.
In MySQL, OR is used in the WHERE clause to match
rows that satisfy at least one condition among multiple 12. Which keyword in SQL is used to remove duplicate
specified conditions. If any condition evaluates to results from a query output?
true, the row is selected. Conversely, AND requires all (A) UNIQUE
conditions to be true, while NOT negates a condition, (B) DISTINCT
and XOR is less commonly used. (C) EXCEPT
(D) REDUCE
9. Why is normalization important in database design?
(A) It increases data redundancy  Ans
(B) It merges unrelated tables (B) DISTINCT
(C) It reduces anomalies and duplicates DISTINCT ensures that a query returns only unique
(D) It limits indexing rows by eliminating any duplicates in the result set. This
Ans is particularly helpful when a column might contain
repeated values. Without DISTINCT, the query output

Downloaded from www.mcqgpt.com


PRACTICE PAPER 03

would show all entries matching the criteria, including manipulates data contents. SELECT is a DQL (Data
repetitions. Query Language) command for data retrieval.

13. In MySQL, how does the WHERE clause differ from the 16. Why is a Cartesian product in relational algebra seldom
HAVING clause? used alone in database queries?
(A) WHERE filters rows before grouping, HAVING (A) It automatically deletes rows
filters groups after aggregation (B) It often results in excessively large intermediate
(B) They are interchangeable clauses tables
(C) WHERE is used only with JOINs, HAVING only (C) It sorts data irreversibly
with ORDER BY (D) It merges columns incorrectly
(D) WHERE applies to text, HAVING to numbers  Ans
Ans (B) It often results in excessively large intermediate
(A) WHERE filters rows before grouping, HAVING tables
filters groups after aggregation A Cartesian product combines every row from one
WHERE limits rows prior to grouping operations like relation with every row from another, rapidly expanding
GROUP BY, whereas HAVING narrows results after the data set. This unfiltered combination is typically
those aggregates are calculated. This distinction helps refined with join conditions to avoid unwieldy results.
refine data sets at different processing stages. WHERE Using Cartesian products alone can produce extraneous
excludes nonmatching rows early, while HAVING tuples that degrade performance and obscure
applies to summarized group results, allowing targeted meaningful data relationships.
filtering of aggregate values.
17. Which of these is NOT a valid data type in MySQL?
14. Which MySQL function returns the current date and (A) VARCHAR
time? (B) INT
(A) DATE() (C) RECORDSET
(B) NOW() (D) DATE
(C) DAYNAME()  Ans
(D) MONTH()
(C) RECORDSET
Ans MySQL supports various data types like VARCHAR
(B) NOW() for variable-length text, INT for integers, and DATE
NOW() provides the current date and time on the for calendar dates. RECORDSET is not a MySQL data
server where the MySQL instance runs. DATE() type; it’s a concept in other database frameworks or
extracts only the date portion from a datetime value, environments, not recognized in standard MySQL type
while DAYNAME() returns the weekday name, and definitions.
MONTH() yields the month component. NOW()
18. Which MySQL clause is best for sorting records in
is primarily used for timestamp-related queries and
logging. ascending or descending order?
(A) GROUP BY
15. Which of the following is an example of a DDL (Data (B) HAVING
Definition Language) command in SQL? (C) ORDER BY
(A) INSERT (D) DISTINCT
(B) UPDATE  Ans
(C) CREATE
(D) SELECT (C) ORDER BY
ORDER BY arranges the query output in ascending or
Ans descending order based on specified columns. GROUP
(C) CREATE BY clusters rows by shared values, HAVING filters
DDL commands define and modify the structure of aggregated results, and DISTINCT removes duplicates.
database objects, such as tables, indexes, or schemas. ORDER BY remains the principal clause for imposing a
CREATE, DROP, and ALTER belong to DDL. In sorting sequence on the retrieved data.
contrast, INSERT and UPDATE belong to DML, which

Downloaded from www.mcqgpt.com


page 30 CUET UG Computer Science

19. Which network topology uses a central hub or switch to (D) A domain name on the web
connect all nodes?  Ans
(A) Ring
(B) Star (B) A physical address assigned to network interfaces
(C) Bus A MAC (Media Access Control) address is a hardware
(D) Mesh identifier unique to each network interface card.
Typically represented as hexadecimal pairs, it operates
Ans at Layer 2 of the OSI model. It remains constant, unlike
(B) Star IP addresses, which can change.
In a star topology, each node connects to a central hub,
23. How does a switch differ from a hub in a network?
switch, or router. This layout simplifies troubleshooting
because a single cable failure usually isolates only the (A) A switch broadcasts data to all ports, a hub does not
affected node. Although it may require more cable (B) A switch intelligently forwards data to specific
than some alternatives, star topologies offer ease of ports, a hub blindly broadcasts
maintenance and network management. (C) A switch is wireless only, a hub is wired only
(D) They function identically
20. Which device amplifies a signal to extend its range on  Ans
a network?
(A) Hub (B) A switch intelligently forwards data to specific ports,
(B) Switch a hub blindly broadcasts
(C) Repeater Switches examine incoming data packets to determine
(D) Gateway their destination port, improving network efficiency.
Hubs, by contrast, repeat incoming signals to
Ans every connected port, causing unnecessary traffic.
(C) Repeater Consequently, switches reduce collisions and
A repeater regenerates or amplifies signals across congestion, making them well-suited for modern
network segments, compensating for signal degradation network infrastructures.
over distance. Hubs broadcast data to all connected
24. Which of the following is NOT a characteristic of a
ports, switches forward frames intelligently, and
gateways enable communication between different Wide Area Network (WAN)?
protocols. Repeaters specifically address weakening (A) Covers a large geographical area
signals to preserve data integrity. (B) Uses local connections only
(C) Often employs public telecommunication links
21. Why is an IP address necessary for devices on a network? (D) Connects multiple smaller networks
(A) It prevents hardware conflicts  Ans
(B) It physically secures the device
(C) It uniquely identifies the device’s network location (B) Uses local connections only
(D) It ensures unlimited bandwidth WANs span broad regions or even global distances,
linking multiple local networks. They typically rely on
Ans leased telecommunication lines or satellites, enabling
(C) It uniquely identifies the device’s network location wide coverage. Local connections are more typical of
IP addresses provide logical identification and location LANs, which are confined to a single site like a building
addressing for devices, allowing data packets to be or campus.
routed accurately across networks. Without unique IP
25. Place the following network innovations in chronological
assignments, network communications would fail to
distinguish sender or recipient devices. IP addresses order of development:
facilitate structured data flow, serving as a core element 1. ARPANET
of modern networking. 2. Ethernet
3. World Wide Web
22. Define MAC address. 4. Wi-Fi
(A) A logical identifier that changes frequently (A) 1-2-3-4
(B) A physical address assigned to network interfaces (B) 2-1-3-4
(C) A router’s local IP (C) 1-3-2-4

Downloaded from www.mcqgpt.com


PRACTICE PAPER 03

(D) 2-3-1-4 2. w b. append


Ans 3. a c. write
(A) 1-2-3-4 4. rb d. read binary
ARPANET originated in the late 1960s. Ethernet Options:
emerged in the 1970s. The World Wide Web debuted (A) 1-c, 2-a, 3-b, 4-d
around 1989–1990, and Wi-Fi (802.11 standards) (B) 1-d, 2-b, 3-c, 4-a
followed in the late 1990s. Thus, the order is ARPANET, (C) 1-b, 2-c, 3-d, 4-a
Ethernet, WWW, then Wi-Fi. (D) 1-a, 2-c, 3-b, 4-d
26. Arrange these Python versions from earliest to latest:  Ans
1. Python 2.0 (A) 1-a, 2-c, 3-b, 4-d
2. Python 3.0 ‘r’ opens a file for reading, ‘w’ for writing (overwriting if
3. Python 3.6 present), ‘a’ appends data, and ‘rb’ reads in binary mode.
4. Python 3.9 Selecting the correct mode ensures proper handling of
(A) 1-2-3-4 text or binary data.
(B) 1-3-4-2
(C) 2-1-3-4 29. Match these network devices to their descriptions:
(D) 2-3-1-4
Column I Column II
Ans 1. Router a. routes data
(A) 1-2-3-4 2. Repeater b. extends signal
Python 2.0 launched in 2000, Python 3.0 in 2008, Python 3. Gateway c. merges different protocols
3.6 in 2016, and Python 3.9 in 2020. This chronological
4. Switch d. directs packets
order reflects major updates and backward-incompatible
changes introduced by version 3.0. Options:
(A) 1-a, 2-b, 3-c, 4-d
27. Match the following SQL clauses with their functions: (B) 1-d, 2-b, 3-c, 4-a
Column I Column II (C) 1-b, 2-c, 3-d, 4-a
(D) 1-a, 2-d, 3-b, 4-c
1. SELECT a. displays columns
 Ans
2. WHERE b. filters rows
3. GROUP BY c. groups results (A) 1-a, 2-b, 3-c, 4-d
A router directs data between networks, a repeater
4. ORDER BY d. sorts rows
amplifies signals, a gateway enables communication
Options: between differing protocols, and a switch sends
(A) 1-c, 2-a, 3-b, 4-d frames to the correct port based on MAC addresses.
(B) 1-a, 2-b, 3-c, 4-d Understanding these functions is key to network design.
(C) 1-b, 2-c, 3-d, 4-a
(D) 1-a, 2-d, 3-b, 4-c 30. Match the following Python exceptions to their typical
Ans
causes:

(B) 1-a, 2-b, 3-c, 4-d Column I Column II


In SQL, SELECT specifies which columns to retrieve, 1. ZeroDivisionError a. dividing by zero
WHERE restricts rows, GROUP BY groups rows by 2. FileNotFoundError b. missing file
common values, and ORDER BY sorts results. This 3. ValueError c. invalid argument
progression clarifies how data is selected, filtered,
4. KeyError d. invalid dictionary key
grouped, and arranged.
Options:
28. Match Python file modes with their primary purpose: (A) 1-a, 2-b, 3-c, 4-d
Column I Column II (B) 1-d, 2-b, 3-c, 4-a
(C) 1-b, 2-c, 3-d, 4-a
1. ‘r’ a. read
(D) 1-a, 2-d, 3-b, 4-c

Downloaded from www.mcqgpt.com


page 32 CUET UG Computer Science

Ans 3. It can take multiple passes to fully sort the list


(A) 1-a, 2-b, 3-c, 4-d 4. It compares only the first two elements
ZeroDivisionError arises from dividing by zero, (A) 1 and 3
FileNotFoundError when a file path is unavailable, (B) 2 and 4
ValueError if a function gets an argument of incorrect (C) 1, 3, and 4
type, and KeyError when a key is absent in a dictionary. (D) 1, 2, 3, and 4
 Ans
31. Match the following MySQL functions to their usage:
Column I Column II (A) 1 and 3
Bubble sort checks adjacent pairs, swapping them if
1. MOD() a. remainder
needed, and may require several passes. Its average
2. LENGTH() b. string length complexity is O(n²), not O(1). It examines pairs
3. DAY() c. day from date throughout the list, not merely the first two. Only
4. AVG() d. average statements 1 and 3 accurately describe bubble sort.
Options:
34. Which of the following statements about queues are
(A) 1-a, 2-b, 3-c, 4-d
correct?
(B) 1-d, 2-b, 3-c, 4-a
1. They follow LIFO ordering
(C) 1-b, 2-c, 3-d, 4-a
2. They follow FIFO ordering
(D) 1-a, 2-d, 3-b, 4-c
3. Insertion is called ENQUEUE
Ans 4. Removal is called DEQUEUE
(A) 1-a, 2-b, 3-c, 4-d 5. They store data contiguously in memory always
MOD() yields a remainder, LENGTH() measures string (A) 1, 3, and 4
length, DAY() extracts the day part from a date, and (B) 2, 3, and 4
AVG() calculates the average of numeric values. Each (C) 2, 3, 4, and 5
function is specialized for a distinct operation, enriching (D) 1, 2, and 3
SQL queries.  Ans
32. Which of the following statements about Python (B) 2, 3, and 4
exceptions are true? A queue employs FIFO ordering. Enqueue refers to
1. They disrupt normal program flow adding an item, while Dequeue removes it. Stacks
2. They must always be caught with a try-except block employ LIFO, and a queue need not store its data
3. They can be raised intentionally contiguously; linked implementations are common.
4. They cannot occur in built-in functions Therefore, statements 2, 3, and 4 match queue behavior.
(A) 1 and 3 are true
35. Which statements about binary search are correct?
(B) 2 and 4 are true
1. It requires sorted data
(C) 1, 2, and 3 are true
2. It compares the target with the middle element
(D) 1, 2, 3, and 4 are true
3. It always runs in O(n) time
Ans 4. It repeatedly discards half of the search space
(A) 1 and 3 are true (A) 1, 2, and 4
Exceptions interrupt normal execution but can be (B) 2 and 3
raised intentionally via the raise statement if a condition (C) 1 and 3
demands it. Although try-except is a common approach, (D) 1, 2, 3, and 4
it is not mandatory in all cases, and built-in functions  Ans
can indeed trigger exceptions. Therefore, statements 1
(A) 1, 2, and 4
and 3 hold valid.
Binary search assumes a sorted array, checks the target
33. Identify the true statements about bubble sort: against the middle, and discards half the array each
1. It repeatedly swaps adjacent elements if they are in iteration, yielding O(log n) performance. It does not
wrong order run in O(n) under normal conditions, so statement 3
2. It works in O(1) time complexity on average is false.

Downloaded from www.mcqgpt.com


PRACTICE PAPER 03

36. Assertion (A) : A stack is used to evaluate postfix uniquely suited to preserving and retrieving complex
expressions. Python objects in binary form.
Reason (R) : Stacks operate on the principle of FIFO.
39. Which function in Python returns the length of a list?
(A) Both Assertion and Reason are true, and Reason is
the correct explanation (A) size()
(B) Both Assertion and Reason are true, but Reason is (B) length()
not the correct explanation (C) count()
(C) Assertion is true, but Reason is false (D) len()
(D) Assertion is false, but Reason is true  Ans
Ans (D) len()
(C) Assertion is true, but Reason is false The built-in len() function returns the number of items
Postfix (Reverse Polish) expressions are naturally in an iterable such as a list, tuple, or string. Python
evaluated using a stack, which uses LIFO. FIFO is does not offer a size() or length() function for this
characteristic of queues. Thus, while the assertion purpose, and count() is used differently (e.g., counting
is valid, the reason is incorrect, invalidating it as an occurrences in sequences).
explanation. 40. Why is variance important in understanding data sets?
37. Assertion (A) : Selection sort can find the minimum (A) It measures the sum of all data points
element during each pass. (B) It indicates how data points deviate from the mean
Reason (R) : Selection sort repeatedly swaps adjacent (C) It shows the oldest data point
out-of-order elements until fully sorted. (D) It directly identifies cause-effect relationships
(A) Both Assertion and Reason are true, and Reason is  Ans
the correct explanation (B) It indicates how data points deviate from the mean
(B) Both Assertion and Reason are true, but Reason is Variance shows how far values in a dataset are spread out
not the correct explanation from the average. A high variance suggests data is more
(C) Assertion is true, but Reason is false dispersed, whereas a low variance shows clustering
(D) Assertion is false, but Reason is true around the mean. This metric helps statisticians or
Ans analysts interpret data consistency and distribution.
(B) Both Assertion and Reason are true, but Reason is Direction :Carefully read the case study provided and then
not the correct explanation thoroughly answer the subsequent five questions.
Selection sort locates the smallest element each pass and In a school’s database system, an administrator wants to
places it correctly, but it does not rely on consecutive maintain records of students, teachers, and classes using
adjacent swaps (that is bubble sort’s method). The MySQL. The Students table includes fields like StudentID
assertion stands, yet the reason given describes a (primary key), Name, Age, and ClassID. The Classes
different algorithm, so it is not the correct justification. table holds ClassID (primary key), ClassName, and
38. Which Python module is commonly used for reading TeacherID. Teachers are stored in a separate table with
and writing binary files with object serialization? TeacherID (primary key), TeacherName, and Subject. The
(A) JSON administrator aims to ensure referential integrity so that
(B) pickle each Student record references a valid ClassID, and each
(C) csv Class references a valid TeacherID. Queries commonly
(D) os JOIN these tables to generate class rosters, display teacher
assignments, or produce statistical summaries of student
Ans performance. By carefully defining primary and foreign
(B) pickle keys, the database fosters accuracy, prevents anomalies,
The pickle module serializes Python objects into a byte and supports efficient retrieval of related information
stream and restores them later. JSON deals with text- across tables. Through these strategies, data redundancy
based data, csv manages comma-separated values, is minimized, and updates remain seamless.
and os interfaces with the operating system. pickle is
41. Which field primarily ensures that no two students
share the same identifier?

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


page 34 CUET UG Computer Science

(A) ClassID  Ans


(B) TeacherID (C) Defined foreign keys referencing TeacherID
(C) StudentID A foreign key constraint linking TeacherID in the Classes
(D) Subject table to the Teachers table ensures consistent updates.
Ans If TeacherID changes or is removed, the database
maintains synchronization or blocks invalid references,
(C) StudentID
minimizing update anomalies. This structural rule
StudentID is designated as the primary key in the
enforces dependable cross-table data.
Students table, so it must be unique. This guarantee
prevents duplicate student records and maintains 45. How does enforcing referential integrity benefit the
integrity. With each student’s row tied to a distinct system overall?
StudentID, retrieving or updating individual records (A) It slows data retrieval significantly
remains precise and conflict-free. (B) It allows multiple inconsistent entries
(C) It ensures valid cross-table references
42. Which key concept ensures that every record in Classes
(D) It hides teacher assignments from queries
references a valid Teacher entry?
(A) Redundancy  Ans
(B) Foreign key (C) It ensures valid cross-table references
(C) Superkey Referential integrity enforces logical consistency among
(D) Composite key related tables. Rows in child tables cannot reference
Ans nonexistent parent records. That standardization avoids
duplicates or orphan entries, improving data reliability
(B) Foreign key
for queries and updates. Preventing mismatched
The TeacherID in the Classes table is defined as a foreign
references greatly enhances overall database stability.
key pointing to the Teachers table. This relationship
upholds referential integrity, making sure Classes cannot Direction :Carefully read the case study provided and then
reference a nonexistent teacher. Hence, orphaned or thoroughly answer the subsequent five questions.
mismatched records are avoided for consistent data In an expanding retail chain, administrators want a
links. robust network connecting multiple branch offices across
different cities. They plan to implement WAN technologies
43. Why might the administrator join Students and Classes
to link local LANs in each store. A dedicated router in
tables?
each branch manages data flow, while a central data
(A) To delete both tables
center houses servers. Security measures such as firewalls
(B) To manage user passwords
and encryption protect sensitive transactions, including
(C) To retrieve combined student-class information
customer payments and inventory updates. Regularly
(D) To rename fields automatically
scheduled backups occur over the network to prevent data
Ans loss, and a VPN (Virtual Private Network) is considered
(C) To retrieve combined student-class information for remote employee access. Branch managers can use
A JOIN connects rows from Students with their real-time sales dashboards hosted on the central servers to
matching rows in Classes using ClassID. This query make informed decisions. By combining efficient routing,
approach reveals which students belong to which secure communication, and reliable hardware, the retailer
classes, enabling the administrator to compile rosters or maintains smooth operations across diverse geographical
analyze enrollment patterns. Password management or locations. This configuration minimizes downtime and
table deletions do not involve these two tables’ typical streamlines enterprise-wide transactions. IT staff.
join usage.
46. What is the principal reason for implementing WAN
44. Which feature prevents anomalies when updating technologies in this retail chain scenario?
teacher assignments? (A) To isolate each branch entirely
(A) Primary key constraints only (B) To link local LANs across distant branches
(B) Proper indexing without foreign keys (C) To replace all LANs with a single large hub
(C) Defined foreign keys referencing TeacherID (D) To remove routers entirely
(D) Eliminating the Teachers table

Downloaded from www.mcqgpt.com


PRACTICE PAPER 03

Ans (C) It provides secure, encrypted connections for


(B) To link local LANs across distant branches remote workers
WAN technologies extend network connectivity beyond A VPN forms a private, encrypted communication
a single physical location, enabling each branch’s LAN channel over public networks. Remote employees can
to communicate with others. This design centralizes thus securely access internal resources without leaking
data access, promotes resource sharing, and streamlines sensitive data. Far from reducing security, a VPN
inter-branch transactions. Without WAN links, enhances it, ensuring external connections remain
distant offices would remain segregated and unable to restricted, authenticated, and safe.
coordinate efficiently.
50. How do regular backups over the network benefit this
47. Which device likely manages data flow at each branch? retailer?
(A) Firewall (A) They permanently lock data files
(B) Switch (B) They eliminate the need for routers
(C) Router (C) They ensure data recovery after hardware failures
(D) Repeater (D) They turn off encryption services
Ans  Ans
(C) Router (C) They ensure data recovery after hardware failures
Routers select optimal paths for data packets between Scheduled backups create protected copies of vital data,
networks, connecting LANs to WANs. Each store’s mitigating the risk of catastrophic losses when primary
router routes internal traffic externally. Switches hardware malfunctions. Because these backups often
distribute packets locally within a LAN, firewalls filter reside offsite or on different servers, any localized failure
traffic, and repeaters merely strengthen signals. Routing need not jeopardize essential information. Recovery
is essential to inter-branch communication across vast becomes faster, preserving sales records, inventory, and
distances. crucial operational data.

48. Which security measure helps protect sensitive  **************


transactions like payments?
(A) Clear text transmissions
(B) Encryption protocols
(C) Using hubs instead of switches
(D) Unsecured Wi-Fi connections
Ans
(B) Encryption protocols
Encryption encodes information, requiring decryption
keys to read it. This method thwarts eavesdroppers and
hackers who intercept sensitive data, such as payment
credentials. Combined with fire walls and secure
tunnels, encryption preserves confidentiality for critical
financial interactions across potentially unsecured
channels.

49. Why might a VPN be employed for remote staff?


(A) It reduces internet speeds drastically
(B) It grants insecure public access to all systems
(C) It provides secure, encrypted connections for
remote workers
(D) It prevents backups from running
Ans

Downloaded from www.mcqgpt.com


page 36 CUET UG Computer Science

PRACTICE PAPER 04

1. Which SQL command modifies existing table structures modifies strings, and ISNULL() is used to check for null
by adding or dropping columns? but does not return the first non-null value.
(A) SELECT
4. Why is the GROUP BY clause particularly useful in SQL
(B) ALTER TABLE
(C) GROUP BY queries?
(D) TRUNCATE (A) It duplicates rows
(B) It merges multiple databases
Ans (C) It aggregates rows based on shared column values
(B) ALTER TABLE (D) It ensures only one row is returned
ALTER TABLE belongs to DDL and changes the  Ans
structure of a table, such as by adding, dropping, or
modifying columns. SELECT only retrieves data, (C) It aggregates rows based on shared column values
GROUP BY aggregates, and TRUNCATE removes all GROUP BY clusters rows having identical values in
rows while preserving the table schema. ALTER TABLE specified columns. This grouping allows aggregate
is specifically for schema alterations. functions (e.g., SUM, COUNT, AVG) to summarize
those subsets. By focusing on shared attributes, GROUP
2. What is a candidate key in relational databases? BY offers granular insights into categorized data.
(A) A key with repeated values allowed
5. Which of the following would NOT be recognized as a
(B) A key that temporarily replaces a primary key
(C) A minimal set of attributes that can uniquely valid SQL arithmetic operator?
identify a row (A) +
(D) A key used exclusively for text fields (B) -
(C) &
Ans (D) *
(C) A minimal set of attributes that can uniquely  Ans
identify a row
Candidate keys are the smallest combinations of fields (C) &
that uniquely identify each record in a table. One Standard SQL arithmetic operators include +, -, *, and
candidate key is chosen as the primary key, while the /. Ampersand (&) may have specialized uses in certain
rest remain alternate keys. These key sets cannot contain database implementations for bitwise operations, but
extraneous attributes if they are to remain truly minimal. it is not part of basic SQL arithmetic. Hence, & is not
generally recognized as a straightforward arithmetic
3. Which function returns the first non-null value in operator.
MySQL among its arguments?
6. How does the MIN() function differ from the COUNT()
(A) CONCAT()
(B) COALESCE() function in SQL?
(C) REPLACE() (A) MIN() tallies rows, COUNT() finds the smallest
(D) ISNULL() value
(B) MIN() returns the smallest value, COUNT()
Ans calculates numeric totals
(B) COALESCE() (C) MIN() yields the smallest value, COUNT() tallies
COALESCE() examines arguments in order and returns rows
the first that is not null. This is especially useful to (D) They perform identical operations
substitute default values when some columns might  Ans
contain null. CONCAT() appends strings, REPLACE()

Downloaded from www.mcqgpt.com


PRACTICE PAPER 04

(C) MIN() yields the smallest value, COUNT() tallies filter or calculate values for the outer query. They serve
rows separate but complementary roles.
MIN(column) finds the lowest value in the chosen
10. Which command will NOT change the rows stored in
column, whereas COUNT(*) or COUNT(column)
returns the number of matching rows. Both are aggregate a table?
functions, but they measure different characteristics: (A) INSERT
minimal value vs. row count. (B) UPDATE
(C) DELETE
7. Which function is best to extract the month portion (D) SELECT
from a date in MySQL?  Ans
(A) MONTH()
(B) DAYNAME() (D) SELECT
(C) YEAR() SELECT purely reads data without altering any rows.
(D) CONCAT() INSERT adds new records, UPDATE changes existing
ones, and DELETE removes them. SELECT queries
Ans remain read-only operations, crucial for data retrieval
(A) MONTH() or reporting.
MONTH(date) isolates the month component as an
11. Define the term domain in the relational model.
integer. DAYNAME() yields the weekday’s name,
YEAR() isolates the year, and CONCAT() is unrelated (A) The range of valid values an attribute can have
to date slicing. MONTH() is the direct choice for (B) The default table name
extracting the month field from a date. (C) An unlimited set of possible keys
(D) The combined set of all tables in a database
8. Which SQL statement is used to remove an entire table  Ans
and its data from a database?
(A) DELETE (A) The range of valid values an attribute can have
(B) DROP TABLE A domain specifies permissible data for a given attribute
(C) TRUNCATE (e.g., integer only, specific text length). This constraint
(D) RENAME prevents invalid inputs and encourages consistent data
structures. Without well-defined domains, attribute
Ans values could become inconsistent and reduce data
(B) DROP TABLE quality.
DROP TABLE eliminates a table’s structure and its
12. Which SQL keyword arranges query results
data entirely. TRUNCATE clears all data but keeps
the schema, DELETE selectively removes rows, and alphabetically by a specified column?
RENAME modifies the table’s name without changing (A) DISTINCT
its data. (B) ROLLUP
(C) ORDER BY
9. How does a join differ from a subquery in SQL? (D) MERGE
(A) Joins combine rows from different tables,  Ans
subqueries nest a query within another query
(B) Subqueries always yield faster performance than (C) ORDER BY
joins ORDER BY sorts the output in ascending (alphabetical
(C) They are identical in structure and use for text) or descending order. DISTINCT eliminates
(D) Joins only work with numeric columns duplicates, ROLLUP generates multi-level aggregates,
and MERGE is not a standard sorting mechanism
Ans in SQL syntax. ORDER BY is the direct method for
(A) Joins combine rows from different tables, subqueries arranging output.
nest a query within another query
13. How do LANs differ from WANs?
Joins simultaneously merge data from multiple tables
in a single result set, often using matching columns. A (A) LANs cover large geographic areas; WANs cover
subquery is a query embedded in another, often used to small ones
(B) LANs connect widely dispersed offices; WANs only

Downloaded from www.mcqgpt.com


page 38 CUET UG Computer Science

link computers in one room (C) It standardizes network communication into


(C) LANs usually cover a limited local area; WANs structured layers
extend over broader regions The OSI model divides networking tasks into seven
(D) They are functionally the same layers, each responsible for particular functions. This
Ans layered approach fosters interoperability, guiding
vendors to develop compatible devices and protocols. It
(C) LANs usually cover a limited local area; WANs does not eliminate hardware or addresses but provides a
extend over broader regions universal framework to facilitate integration.
A LAN spans a relatively small area (like a home, lab, or
building), whereas a WAN may connect sites separated 17. Which of these is NOT typically considered a wireless
by significant distances. WANs thus demand more communication technology?
complex infrastructure, typically leased or long-distance (A) Bluetooth
links, to integrate geographically remote networks. (B) Ethernet
(C) Infrared
14. Which topology arranges nodes in a closed loop? (D) WLAN
(A) Bus
(B) Ring  Ans
(C) Star (B) Ethernet
(D) Tree Ethernet is a widely used wired technology over twisted
Ans pair or fiber cables. Bluetooth, infrared, and WLAN (Wi-
Fi) involve radio or light-based transmissions without
(B) Ring cables, thus classed as wireless. Ethernet remains the
A ring topology connects each node to exactly two standard for wired local networks.
others, forming a continuous loop. Data travels around
this loop until it reaches its destination. Bus uses a 18. Which network device best reduces collisions by
shared backbone cable, star has a central hub, and tree forwarding data only to the intended recipient port?
combines multiple stars in a hierarchical structure. (A) Hub
(B) Switch
15. Which device acts as an interface that translates different (C) Repeater
network protocols? (D) Modem
(A) Switch
(B) Hub  Ans
(C) Gateway (B) Switch
(D) Bridge Switches read MAC addresses and forward incoming
Ans data to the correct port, limiting unnecessary broadcasts.
Hubs simply repeat signals to all ports, causing more
(C) Gateway collisions. Repeaters regenerate signals, and modems
A gateway connects networks using dissimilar convert digital to analog and vice versa, so switches
architectures or protocols. Switches and hubs serve excel at collision reduction within LANs.
local network segments, and bridges interconnect
similar network segments. Gateways conduct protocol 19. Which addressing format is used at the Network layer of
conversions, enabling seamless data exchange across the OSI model for routing?
disparate systems. (A) MAC address
(B) IP address
16. Why is the OSI model important in networking? (C) Port number
(A) It physically replaces all hardware (D) Domain name
(B) It removes the need for IP addresses
(C) It standardizes network communication into  Ans
structured layers (B) IP address
(D) It ensures only large corporations can build IP addresses function at Layer 3 (Network layer),
networks guiding packet routing. MAC addresses apply at Layer 2
Ans (Data Link). Port numbers belong to the Transport layer
(Layer 4), and domain names operate in the application

Downloaded from www.mcqgpt.com


PRACTICE PAPER 04

layer with DNS. IP addresses are the fundamental unit (C) Worms can spread automatically, viruses often
of network-level identification. need user action
(D) They are the same threat with different names
20. Which protocol is primarily responsible for transferring
web pages?  Ans
(A) FTP (C) Worms can spread automatically, viruses often need
(B) SMTP user action
(C) HTTP Worms typically propagate independently across
(D) POP3 networks, while viruses embed in files or executables and
Ans generally need user intervention to trigger replication.
Both can be malicious, but their infection vectors differ:
(C) HTTP worms exploit vulnerabilities directly, whereas viruses
HTTP (Hypertext Transfer Protocol) underpins the attach to host programs or documents.
World Wide Web, enabling browsers to request and
receive web pages from servers. FTP deals with file 24. Which of the following does NOT typically characterize
transfers, SMTP with sending email, and POP3 with spyware?
retrieving email from mail servers. (A) Secretly collects user data
(B) Displays unwanted advertisements
21. Why are domain names used instead of raw IP addresses? (C) Informs the user clearly of its activity
(A) They ensure unlimited bandwidth (D) Sometimes transmits data to third parties
(B) They physically secure computers
(C) They provide human-readable identifiers  Ans
(D) They eliminate the need for routers (C) Informs the user clearly of its activity
Ans Spyware functions surreptitiously, gathering data or
monitoring user behavior without consent. It may deliver
(C) They provide human-readable identifiers intrusive ads or forward stolen information elsewhere.
Domain names offer a memorable alternative to numeric Disclosing its presence openly would undermine its
IP addresses, boosting user convenience. DNS converts covert purpose, so it avoids alerting the user.
those names to IP addresses. This arrangement does not
remove routing necessities; it simplifies navigation and 25. Arrange these steps of exception handling in Python
fosters an intuitive Internet experience. from first to last:
1. Attempting risky code in try block
22. Define Trojan horse in the context of network security. 2. Catching exception in except block
(A) A harmless software patch 3. Executing code in finally block
(B) A malicious program disguised as legitimate 4. Handling code in else block if no exception occurs
software (A) 1-2-4-3
(C) A firewall program authorized by the system (B) 2-1-3-4
(D) A standard antivirus tool (C) 1-3-4-2
Ans (D) 4-1-2-3
(B) A malicious program disguised as legitimate  Ans
software (A) 1-2-4-3
A Trojan horse masquerades as trustworthy software First, the try block runs. If an exception is raised, the
but conceals harmful functions that let attackers access except block catches it; if none appears, the else block
or damage a system. Unlike viruses that replicate runs. Finally always executes last, whether an exception
themselves, Trojans rely on users to run them. They occurred or not. This sequence ensures thorough
commonly appear as enticing downloads or attachments, handling and cleanup.
jeopardizing security once installed.
26. Organize these steps for performing a binary search on
23. How does a worm differ from a virus in cyber threats? a sorted list:
(A) Worms require user action to replicate, viruses 1. Compare target with middle
spread automatically 2. If target is less, search left sublist
(B) Worms are harmless, viruses are always destructive 3. Set low and high pointers

Downloaded from www.mcqgpt.com


page 40 CUET UG Computer Science

4. If target is more, search right sublist get(key) returns a value or a default if the key isn’t found,
(A) 3-1-2-4 pop(key) removes and returns the key-value entry,
(B) 1-2-3-4 keys() provides a list-like view of all keys, and items()
(C) 3-2-1-4 provides (key, value) tuples. These methods streamline
(D) 2-3-1-4 dictionary manipulation.
Ans 29. Match the following file operations with their
(A) 3-1-2-4 descriptions in Python:
Binary search starts by setting low and high. Then it
Column I Column II
compares the target with the middle. If smaller, the
search continues in the left portion; if larger, the right. 1. open() a. opens file
Repeating narrows the range until the item is found or 2. read() b. reads file
deemed absent. 3. write() c. writes to file
4. close() d. closes file
27. Match these MySQL data types to typical uses:
Options:
Column I Column II (A) 1-a, 2-b, 3-c, 4-d
1. CHAR(n) a. fixed-length text (B) 1-d, 2-b, 3-c, 4-a
2. INT b. integer (C) 1-b, 2-c, 3-d, 4-a
3. DATE c. date value (D) 1-a, 2-d, 3-b, 4-c
4. DECIMAL(p,q) d. fixed-point numbers  Ans
Options: (A) 1-a, 2-b, 3-c, 4-d
(A) 1-a, 2-b, 3-c, 4-d open() initiates a file object, read() retrieves data,
(B) 1-d, 2-b, 3-c, 4-a write() appends or replaces existing file content, and
(C) 1-b, 2-c, 3-d, 4-a close() ends access to the file. Properly closing releases
(D) 1-a, 2-d, 3-b, 4-c resources and finalizes data storage.
Ans 30. Match these computer network security terms with
(A) 1-a, 2-b, 3-c, 4-d their descriptions:
CHAR(n) designates fixed-length text, INT handles
Column I Column II
integer data, DATE stores calendar dates, and
1. Firewall a. protective barrier
DECIMAL(p,q) represents exact numeric values with
specified precision. This configuration covers typical 2. Phishing b. fraudulent attempt to obtain
usage in MySQL table design. info
3. HTTPS c. encrypted web protocol
28. Match the Python dictionary methods with their
4. Spam d. unsolicited messages
outcomes:
Options:
Column I Column II (A) 1-a, 2-b, 3-c, 4-d
1. get(key) a. retrieve value safely (B) 1-d, 2-b, 3-c, 4-a
2. pop(key) b. remove entry (C) 1-b, 2-c, 3-d, 4-a
3. keys() c. return list of keys (D) 1-a, 2-d, 3-b, 4-c
4. items() d. return list of keys  Ans
Options: (A) 1-a, 2-b, 3-c, 4-d
(A) 1-a, 2-b, 3-c, 4-d A fire wall restricts unauthorized traffic, phishing lures
(B) 1-d, 2-b, 3-c, 4-a individuals to divulge private data, HTTPS provides
(C) 1-b, 2-c, 3-d, 4-a secure, encrypted web communication, and spam is
(D) 1-a, 2-d, 3-b, 4-c unwanted bulk messaging. Properly identifying these
concepts strengthens overall security knowledge.
Ans
(A) 1-a, 2-b, 3-c, 4-d

Downloaded from www.mcqgpt.com


PRACTICE PAPER 04

31. Match the following Python list methods with their (B) 2, 3
functions: Selection sort can select either the smallest element
for ascending order or the largest for descending, but
Column I Column II
it’s known for doing a single swap per pass. Its average
1. append() a. add element at end time is O(n²). Quicksort is typically faster in practice, so
2. extend() b. add elements from an iterable statement 4 is false, and statement 1 depends on sorting
3. insert() c. insert element at specific index direction.
4. pop() d. remove and return item at
34. Which of the following statements about MySQL JOINs
index
are correct?
Options: 1. INNER JOIN returns matching rows across tables
(A) 1-a, 2-b, 3-c, 4-d 2. LEFT JOIN returns all rows from the left table plus
(B) 1-d, 2-b, 3-c, 4-a matched ones from the right
(C) 1-b, 2-c, 3-d, 4-a 3. RIGHT JOIN returns only matched rows from both
(D) 1-a, 2-d, 3-b, 4-c tables
Ans 4. FULL JOIN includes all rows from both tables with
matches or no matches
(A) 1-a, 2-b, 3-c, 4-d
5. CROSS JOIN merges data based on a related
append(x) places x at the list’s end, extend(iterable)
column
iterates through elements to add them all, insert(i, x)
(A) 1, 2, 4
places x at index i, and pop(i) removes and returns the
(B) 1, 2, 4, 5
item at index i (defaulting to the last if unspecified).
(C) 1, 2, 3, 5
These are fundamental list operations.
(D) 2, 3, 4
32. Which statements about a stack are correct?  Ans
1. Topmost element is accessed last
(A) 1, 2, 4
2. Last element pushed is the first to be popped
INNER JOIN gives rows that match in both tables,
3. It follows FIFO
LEFT JOIN keeps all rows from the left table plus
4. pop() removes the last pushed item
matched from the right, and FULL JOIN includes all
(A) 1 and 4
rows from both, matched or unmatched. RIGHT JOIN
(B) 2 and 4
is analogous to LEFT JOIN from the other side. CROSS
(C) 1, 2, and 4
JOIN produces a Cartesian product, not a match on
(D) 2, 3, and 4
related columns.
Ans
35. Which statements about linear search are valid?
(C) 1, 2, and 4
1. It sequentially checks each element
A stack employs LIFO, where the topmost (most recent)
2. It requires sorted data
item is accessed last and popped first. FIFO defines
3. It has O(n) worst-case complexity
queues, not stacks. Hence 1 (top accessed last), 2 (last
4. It stops immediately upon finding a match
pushed is first popped), and 4 (pop removes last pushed)
(A) 1, 3, and 4
describe stack behavior accurately.
(B) 1, 2, and 3
33. Which statements about selection sort are true? (C) 2, 3
1. It selects the largest element in each pass (D) 1 and 2
2. It typically performs one swap per pass  Ans
3. It has an average complexity of O(n²)
(A) 1, 3, and 4
4. It is faster than quicksort on average
Linear search moves element by element, from start to
(A) 1, 2, 3
finish, so it is O(n) in the worst case. Data does not have
(B) 2, 3
to be sorted, and once it finds the target, it can terminate
(C) 2, 3, 4
instantly. Statements 1, 3, and 4 hold true for linear
(D) 1, 2, 4
search.
Ans

Downloaded from www.mcqgpt.com


page 42 CUET UG Computer Science

36. Assertion (A) : An index can speed up SELECT queries. (A) sys
Reason (R) : Indexes replicate entire tables multiple (B) math
times. (C) csv
(A) Both Assertion and Reason are true, and Reason is (D) random
the correct explanation  Ans
(B) Both Assertion and Reason are true, but Reason is
not the correct explanation (C) csv
(C) Assertion is true, but Reason is false Python’s built-in csv module provides reader and writer
(D) Assertion is false, but Reason is true objects to handle comma-separated values, enabling
structured import and export of tabular data. The
Ans other listed modules serve different purposes (system
(C) Assertion is true, but Reason is false interaction, math operations, or random number
Indexes can greatly accelerate data retrieval by generation).
referencing key columns, but they do not replicate entire
40. Why is standard deviation important in data analysis?
tables. Instead, an index creates a smaller, more efficient
structure, allowing quicker lookups. The reason given is (A) It represents the mode of a data set
incorrect, even though the assertion itself is valid. (B) It displays the highest value in the set
(C) It measures data spread relative to the mean
37. Assertion (A) : A queue uses first-in-first-out ordering. (D) It only applies to categorical variables
Reason (R) : Elements are removed from the front and  Ans
inserted at the rear.
(A) Both Assertion and Reason are true, and Reason is (C) It measures data spread relative to the mean
the correct explanation Standard deviation reveals how closely data points
(B) Both Assertion and Reason are true, but Reason is cluster around the mean or how dispersed they are. A
not the correct explanation larger value indicates broader variability, whereas a
(C) Assertion is true, but Reason is false smaller number signals tight grouping. It’s fundamental
(D) Assertion is false, but Reason is true to statistical insights about consistency and outliers
within a dataset.
Ans
(A) Both Assertion and Reason are true, and Reason is Direction :Carefully read the case study provided and then
the correct explanation thoroughly answer the subsequent five questions.
A queue indeed follows FIFO. Items join at the rear and In a college attendance system, a Python program
leave from the front, meaning the earliest insertion is maintains a stack of daily attendance logs for quick
the earliest removal. The reason accurately explains why checks. Each day’s log is pushed onto the stack, containing
a queue implements FIFO. details such as date, subject, and present students’ roll
numbers. Faculty members can pop the latest log to
38. Which Python statement is used to manually raise an correct or review recent attendance records. If an error
exception? is found, the updated record is pushed again. The system
(A) except helps maintain an orderly record, ensuring that the most
(B) assert current attendance data is readily accessible. The stack
(C) raise approach suits daily logs because it preserves recent data
(D) pass on top, simplifying last-minute revisions. By using this
Ans LIFO structure, administrators reduce confusion and keep
older logs intact below. This design also allows easy data
(C) raise migration and archiving when needed. Consequently,
The raise statement allows developers to generate attendance handling becomes efficient and traceable for
exceptions programmatically when specific conditions academic audits.
occur. except clauses handle exceptions, assert tests
expressions for debugging, and pass does nothing. So 41. Why is a stack an appropriate structure for daily
raise is explicit for triggering an exception. attendance logs?
(A) It stores all logs in sorted order by date
39. Which Python module is typically used for reading and (B) It follows FIFO
writing CSV files?

Downloaded from www.mcqgpt.com


PRACTICE PAPER 04

(C) It keeps the most recent log on top for easy revisions The LIFO property of a stack allows newly inserted
(D) It requires random access to older logs frequently attendance logs to sit on top, enabling fast modifications
Ans when errors arise. Once corrected, faculty push the
updated version back. Older records remain unaffected
(C) It keeps the most recent log on top for easy revisions unless specifically accessed, simplifying immediate fixes
A stack is a LIFO structure, so the newest entry (daily without reorganizing everything.
attendance) sits on top. If that data needs changes,
popping and re-pushing the log is straightforward. 45. How does the system handle data migration or archiving
This avoids random-access complexities, as older data when logs accumulate?
remains below until specifically accessed. (A) By sequentially popping older logs from the bottom
(B) By converting the stack into a queue
42. What happens when a faculty member pops a log? (C) By selectively removing top logs once they’re no
(A) The entire stack is deleted longer needed
(B) The last inserted attendance record is removed (D) By overwriting all logs automatically
from the top
(C) All older logs are re-ordered automatically  Ans
(D) The system merges logs from different days (C) By selectively removing top logs once they’re no
Ans longer needed
In a stack, removal occurs from the top. Administrators
(B) The last inserted attendance record is removed from pop the latest logs for archiving or migration, preserving
the top older ones beneath until they reach them through
Popping from a stack removes only the top element, successive pops. This design eliminates accidental
aligning with LIFO. Faculty can then inspect or correct overwrites of older data and ensures controlled, step-
that specific log. No reordering of lower elements by-step record handling.
occurs, and logs from other days remain intact unless
popped later in sequence. Direction :Carefully read the case study provided and then
thoroughly answer the subsequent five questions.
43. Why might older logs remain untouched at lower levels A small startup hosts its data on a local server and
of the stack? wants to securely expand access to remote teams. The
(A) They are automatically sorted by name company decides to establish a Virtual Private Network
(B) The system permanently locks them (VPN) so employees can securely log in from different
(C) LIFO access focuses on the topmost element locations. To safeguard credentials, they enable multi-
(D) The queue prevents random access factor authentication and configure the firewall to permit
Ans VPN traffic only. Additionally, intrusion detection
(C) LIFO access focuses on the topmost element software monitors suspicious activities. The startup
Since a stack’s removal and inspection occur at the top, also uses encryption protocols like SSL/TLS for sensitive
previously inserted logs stay beneath unless those above web-based applications, ensuring that data remains
are popped first. This prevents older entries from being confidential in transit. Regular penetration tests are
displaced or altered inadvertently, maintaining reliable conducted to evaluate any vulnerabilities. If an anomaly
historical data below recent records. is detected, administrators block the source IP temporarily
and investigate further. By blending encryption,
44. Which advantage does this stack system provide for authentication, and proactive monitoring, the startup
last-minute record adjustments? upholds robust security for distributed workflow and
(A) It hides errors permanently resource sharing. This integrated approach fosters trust
(B) It discards older attendance data and prevents data breaches.
(C) It places the newest logs at the top for quick
46. Why did the startup implement a VPN for remote
correction
(D) It prevents new data from being added teams?
(A) To broadcast data to unauthorized users
Ans (B) To circumvent security checks
(C) It places the newest logs at the top for quick (C) To provide a secure, encrypted channel for remote
correction access

Downloaded from www.mcqgpt.com


page 44 CUET UG Computer Science

(D) To discourage remote collaboration Penetration tests simulate potential intrusions,


Ans identifying flaws in security controls. This proactive
approach helps fix issues early, reducing the likelihood
(C) To provide a secure, encrypted channel for remote of successful breaches. Regularly probing the system’s
access defenses guides continuous improvement of security
A VPN ensures that offsite employees can reach internal measures and oversight.
resources through an encrypted tunnel. This approach
deters eavesdropping or tampering over public networks. 50. Which action is likely taken if the intrusion detection
Far from discouraging collaboration, the VPN promotes system flags an anomaly?
safe, flexible connectivity for dispersed staff. (A) Ignore the event to prevent false positives
(B) Block the source IP and investigate further
47. How does multi-factor authentication enhance security? (C) Immediately shut down the entire network
(A) By removing password requirements (D) Publish all logs publicly
(B) By requiring more than one proof of identity
(C) By allowing public logins  Ans
(D) By replacing firewalls (B) Block the source IP and investigate further
Ans Security policies often specify temporarily blocking
suspicious IPs to halt potential threats. Administrators
(B) By requiring more than one proof of identity then analyze logs to confirm whether malicious activity
Multi-factor authentication (MFA) combines something transpired. This immediate but contained response
users know (like a password) with something they safeguards systems while enabling deeper investigation
have (e.g., one-time token) or something they are of the triggered alert.
(biometrics). These extra layers deter unauthorized
access if any single factor, such as a password, gets  **************
exposed.

48. Which measure helps detect suspicious network


behavior in real time?
(A) Disabling firewall logs
(B) Intrusion detection software
(C) Public Wi-Fi connections
(D) Outdated antivirus definitions
Ans
(B) Intrusion detection software
Intrusion detection systems flag irregular traffic patterns
or potential attacks. By monitoring packets in real time,
they notify administrators of anomalies. Disabling
logs or using outdated antivirus solutions weakens
protection, and public Wi-Fi is unrelated to real-time
threat identification.

49. Why are regular penetration tests conducted?


(A) To automatically rewrite secure code
(B) To reveal vulnerabilities before attackers exploit
them
(C) To remove encryption from the VPN
(D) To ensure employees do not log in remotely
Ans
(B) To reveal vulnerabilities before attackers exploit
them

Downloaded from www.mcqgpt.com


PRACTICE PAPER 05

PRACTICE PAPER 05

1. Which of the following best defines a database in but rather narrows the columns. This helps optimize
relational data management? data retrieval by focusing only on the relevant fields
(A) A random pile of unstructured data needed for an operation.
(B) A structured collection of related records
4. Which of the following is not an advantage of using
(C) A directory for storing multimedia files
(D) A set of programming instructions Structured Query Language (SQL)?
(A) Consistency in database operations
Ans (B) Capability to easily integrate with multiple DBMS
(B) A structured collection of related records (C) Random creation of data without structure
A database is systematically organized to store and (D) Standardization across various platforms
manage related data. It enforces relationships, ensures  Ans
minimal redundancy, and makes it easier to perform
queries. By grouping related records under defined fields, (C) Random creation of data without structure
a database prevents data chaos and provides efficient SQL enforces structured, logical data manipulation. It
retrieval and manipulation for various applications and cannot arbitrarily create disorganized data. It promotes
analyses. standardization and facilitates integration with multiple
systems, ensuring consistent and well-defined database
2. Which key is used to uniquely identify each tuple in a operations. Random or unstructured data creation is
relational table? not supported within the inherent principles of SQL.
(A) Foreign key
5. Which statement correctly contrasts the Cartesian
(B) Primary key
(C) Candidate key Product and a Join in relational operations?
(D) Alternate key (A) Both omit matching rows
(B) Cartesian product only finds matching rows
Ans (C) Join returns all rows regardless of matching
(B) Primary key (D) Join applies a matching condition, while Cartesian
The primary key is a specific candidate key selected product returns all row combinations
to uniquely identify rows in a table. It cannot contain  Ans
NULL values and must be unique. This mechanism helps
preserve data integrity, ensuring each record remains (D) Join applies a matching condition, while Cartesian
distinguishable and preventing duplicate entries from product returns all row combinations
polluting the data in the table. A Cartesian product pairs every row from one table
with every row of another, producing all possible
3. In relational algebra, which operation is used to retrieve combinations. A Join specifically aligns rows based on
certain attributes while discarding others? defined conditions. By matching attributes, the Join
(A) Selection (σ) restricts the result set, unlike the unrestricted Cartesian
(B) Projection (π) product.
(C) Union
6. When designing an efficient MySQL database, which
(D) Cartesian product (×)
practice is generally considered the best approach?
Ans (A) Using as many redundant tables as possible
(B) Projection (π) (B) Avoiding primary keys for simplicity
Projection (π) chooses particular columns (attributes) (C) Normalizing tables to reduce redundancy
from a relation, thereby reducing the schema of the (D) Selecting random field names for uniqueness
result. It does not remove rows based on any condition  Ans

Downloaded from www.mcqgpt.com


page 46 CUET UG Computer Science

(C) Normalizing tables to reduce redundancy 1. r a. Opens file for writing, creates
Database normalization organizes attributes into logical file if it doesn’t exist
groupings to minimize duplications and anomalies. This
2. rb b. Opens file for reading in
practice ensures efficient storage, simpler data updates,
binary mode
and consistent data integrity. Redundant tables or
unclear naming conventions complicate maintenance 3. w c. Opens file for reading (default
and reduce overall database performance. mode)
4. wb d. Opens file for writing in
7. Arrange the following steps for creating a MySQL binary mode, creates file if
database in the correct chronological order: absent
1. Specify the desired database name
Options:
2. Establish a connection to the MySQL server
(A) 1-b, 2-c, 3-a, 4-d
3. Use the CREATE DATABASE command
(B) 1-c, 2-b, 3-d, 4-a
4. Check the newly created database
(C) 1-c, 2-b, 3-a, 4-d
(A) 1 → 2 → 3 → 4
(D) 1-d, 2-a, 3-b, 4-c
(B) 2 → 1 → 3 → 4
(C) 2 → 3 → 1 → 4  Ans
(D) 1 → 4 → 2 → 3 (C) 1-c, 2-b, 3-a, 4-d
Ans In Python, r is read mode by default, rb is read in binary,
w writes (creating the file if needed), and wb writes in
(B) 2 → 1 → 3 → 4
binary. These modes handle files differently, especially
First, you establish a connection to the MySQL server.
regarding how data is accessed, stored, or appended.
Next, you decide the name for your new database.
Then you run the CREATE DATABASE command to 10. Match the Relational Keys in Column A with their
create it. Finally, you verify the newly created database Definition in Column B:
using appropriate MySQL commands such as SHOW
DATABASES or USE statements. Column A Column B
1. Primary Key a. Can accept repeated
8. Order these historical developments in networking values, points to
evolution: primary key of another
1. ARPANET table
2. Introduction of Ethernet 2. Foreign Key b. Chosen candidate
3. Emergence of World Wide Web key used to uniquely
4. Widespread adoption of Wi-Fi identify records
(A) 1 → 2 → 3 → 4
3. Candidate Key c. Uniquely identifies
(B) 2 → 1 → 4 → 3
rows but not chosen as
(C) 1 → 3 → 2 → 4
primary key
(D) 2 → 4 → 1 → 3
4. Alternate Key d. Minimal set of
Ans attributes uniquely
(A) 1 → 2 → 3 → 4 identifying each tuple
The U.S. ARPANET project started in the late 1960s, Options:
followed by Ethernet’s invention in the 1970s. The (A) 1-b, 2-a, 3-d, 4-c
World Wide Web came into prominence in the early (B) 1-d, 2-c, 3-a, 4-b
1990s, and Wi-Fi began to see mainstream adoption in (C) 1-b, 2-d, 3-a, 4-c
the late 1990s and early 2000s. (D) 1-a, 2-b, 3-c, 4-d
9. Match the following Python File Modes in Column A  Ans
with their Descriptions in Column B: (A) 1-b, 2-a, 3-d, 4-c
Column A Column B A primary key (b) is the chosen candidate key. A foreign
key (a) references a primary key in another table. A
candidate key (d) uniquely identifies each row. An

Downloaded from www.mcqgpt.com


PRACTICE PAPER 05

alternate key (c) is a candidate key not selected as the descending. WHERE (a) filters rows before grouping or
primary key. aggregation, limiting which rows get processed.

11. Match the following Data Communication Terms in 13. Match the following Exception Handling Terms in
Column A with their Meaning in Column B: Column A with their Description in Column B:
Column A Column B Column A Column B
1. Bandwidth a. Device converting digital 1. try a. Block containing code to
signals to analog and back handle exceptions
2. Modem b. Pathway capacity for data 2. except b. Block always executed,
transfer rate regardless of exception
3. Switch c. Directs data to correct 3. finally c. Block where exceptions
destination port in a network might be raised
4. Router d. Connects multiple devices, 4. raise d. Keyword to manually
forwarding data based on trigger an exception
MAC Options:
Options: (A) 1-c, 2-a, 3-b, 4-d
(A) 1-b, 2-a, 3-d, 4-c (B) 1-a, 2-c, 3-d, 4-b
(B) 1-a, 2-b, 3-c, 4-d (C) 1-b, 2-d, 3-a, 4-c
(C) 1-c, 2-d, 3-b, 4-a (D) 1-c, 2-d, 3-a, 4-b
(D) 1-d, 2-c, 3-a, 4-b  Ans
Ans (A) 1-c, 2-a, 3-b, 4-d
(A) 1-b, 2-a, 3-d, 4-c In Python, try (c) designates the code block where
Bandwidth (b) is the channel capacity. A modem (a) exceptions could occur. except (a) catches exceptions.
converts between analog and digital signals. A switch finally (b) executes whether an exception happened
(d) forwards frames based on MAC addresses. A router or not. raise (d) explicitly triggers an exception for
(c) routes packets to specific networks or subnets, using handling specific conditions in the code.
IP addresses to determine best paths.
14. Consider the following statements about binary search:
12. Match the SQL Clauses/Statements in Column A with 1. The list must be sorted before searching.
their Function in Column B: 2. It repeatedly divides the list in halves.
3. It compares the target with every element.
Column A Column B
4. Worst-case performance is O(log n).
1. GROUP BY a. Limits records fetched Which combination of statements is correct?
based on a condition (A) 1, 2, 4 only
2. HAVING b. Filters grouped records (B) 2, 3, 4 only
3. ORDER BY c. Sorts query output (C) 1, 3 only
4. WHERE d. Aggregates rows based (D) 1, 2, 3, 4
on common values  Ans
Options: (A) 1, 2, 4 only
(A) 1-d, 2-b, 3-c, 4-a Binary search requires a sorted list, repeatedly halves the
(B) 1-b, 2-d, 3-a, 4-c search space, and has a worst-case complexity of O(log
(C) 1-a, 2-c, 3-b, 4-d n). It does not compare the target with every element;
(D) 1-c, 2-a, 3-d, 4-b that is characteristic of linear search. Thus statements 1,
Ans 2, and 4 are correct.
(A) 1-d, 2-b, 3-c, 4-a 15. Evaluate the following statements about data files:
GROUP BY (d) groups rows by shared values in specified 1. A text file stores data in human-readable characters.
columns. HAVING (b) applies conditions on grouped 2. A binary file typically stores data in special formats.
data. ORDER BY (c) sorts results, typically ascending or 3. Opening a file in r mode overwrites its content.

Downloaded from www.mcqgpt.com


page 48 CUET UG Computer Science

4. Opening a file in w mode overwrites existing data. Bubble sort uses adjacent comparisons. Insertion sort
Which statements are correct? builds a sorted list by inserting each element into its
(A) 1, 2, and 4 only proper place. Selection sort typically swaps once per
(B) 2, 3, and 4 only pass, choosing the smallest element in the unsorted
(C) 1 and 2 only segment. Selection sort generally operates in O(n²) time
(D) 1, 2, 3, and 4 in average cases.
Ans 18. Consider these statements related to Python exceptions:
(A) 1, 2, and 4 only 1. All exceptions must be explicitly declared at the
Text files are human-readable, while binary files store beginning of a file.
data in non-textual formats. Opening a file in r mode 2. You can define custom exceptions with class
does not overwrite content; it only reads. Opening in definitions.
w mode overwrites existing data or creates a new file. 3. The `finally` block executes whether an exception
Therefore, statements 1, 2, and 4 are correct. occurs or not.
4. The `except` block will catch designated exceptions
16. Review these statements about computer networks: in a try block.
1. LAN is limited to a small geographic area. Which combination is correct?
2. WAN spans large areas, often countrywide or (A) 1, 3 only
global. (B) 2, 3, 4 only
3. A hub is a network device that intelligently routes (C) 1, 4 only
data. (D) 2, 3 only
4. A switch can segment a network by forwarding
based on MAC addresses.  Ans
Which set is correct? (B) 2, 3, 4 only
(A) 1, 2, 4 only Python does not require exceptions to be declared
(B) 1, 3, 4 only at the beginning of the file. You can define your own
(C) 2, 3 only exceptions with custom classes, and `finally` executes
(D) 1, 2, 3, 4 unconditionally. The `except` block captures specified
Ans exceptions raised in the try block. Hence statements 2,
3, and 4 are correct.
(A) 1, 2, 4 only
LAN covers a small local area, WAN can extend globally, 19. Assertion (A) : A firewall monitors incoming and
and a switch forwards data based on MAC addresses. outgoing network traffic based on security rules.
A hub simply broadcasts signals to all ports without Reason (R) : Firewalls cannot be configured to block
intelligent routing; that is done by switches or routers. specific IP addresses.
Statements 1, 2, and 4 are accurate. (A) Both A and R are true, and R is the correct
explanation of A.
17. Analyze these statements about sorting: (B) Both A and R are true, but R is not the correct
1. Bubble sort compares adjacent elements repeatedly. explanation of A.
2. Insertion sort inserts each element into the correct (C) A is true, but R is false.
position in a growing sorted list. (D) A is false, but R is true.
3. Selection sort can swap an element only at the end
of each pass.  Ans
4. Selection sort’s complexity is typically O(n²). (C) A is true, but R is false.
Which combination is correct? Firewalls do examine traffic based on rules, which
(A) 1, 2, 4 only often include blocking certain IP addresses or ports.
(B) 2, 3 only Therefore, the reason stating that firewalls cannot block
(C) 1, 3, 4 only specific IP addresses is false. Firewalls are configurable
(D) 1, 2, 3, 4 to block specific IPs, ports, or protocols.
Ans 20. Assertion (A) : In queues, the front pointer identifies
(D) 1, 2, 3, 4 where elements are removed.

Downloaded from www.mcqgpt.com


PRACTICE PAPER 05

Reason (R) : Queues follow a Last-In, First-Out (C) KeyError


principle. (D) TypeError
(A) Both A and R are true, and R is the correct  Ans
explanation of A.
(B) Both A and R are true, but R is not the correct (B) IndexError
explanation of A. IndexError occurs if you try accessing a list, tuple, or
(C) A is true, but R is false. string index that is out of range. ValueError typically
(D) A is false, but R is true. arises when an operation receives a valid type but
invalid value. KeyError applies to dictionary lookups
Ans for non-existent keys, while TypeError indicates an
(C) A is true, but R is false. incompatible operation with a given type.
In a queue, deletions happen from the front pointer.
24. Which data structure efficiently evaluates Postfix
However, queues use the First-In, First-Out (FIFO)
mechanism, not LIFO. Therefore, the assertion about expressions by pushing and popping operands?
the front pointer is correct, while stating that queues (A) Stack
follow LIFO is false. (B) Queue
(C) List
21. Which MySQL function returns the total number of (D) Tree
rows, including those with NULL values, when used  Ans
with (*)?
(A) SUM() (A) Stack
(B) COUNT() In Postfix evaluation, operands are pushed onto the
(C) AVG() stack. When an operator is encountered, the required
(D) POWER() operands are popped and evaluated, and the result is
pushed back. This last-in, first-out behavior of the stack
Ans makes it ideal for expression evaluation and parenthesis
(B) COUNT() handling.
The COUNT(*) function returns the count of all rows
25. Which of the following is not considered a preventive
in a result set, ignoring any exclusion of NULL values. It
provides the total row count of the table or query result. measure against malicious software in network security?
Functions like SUM() or AVG() deal with numeric (A) Installing and updating antivirus tools
calculations, not row tallies. (B) Maintaining software firewalls
(C) Avoiding software patches
22. Which statement in SQL is used to remove all rows from (D) Using HTTPS for secure connections
an existing table but keep its structure?  Ans
(A) DROP TABLE
(B) ALTER TABLE (C) Avoiding software patches
(C) TRUNCATE TABLE Neglecting patches and updates leaves systems
(D) DELETE FROM vulnerable to known exploits. Installing antivirus
programs, enabling firewalls, and using secure protocols
Ans (like HTTPS) are valid preventative approaches.
(C) TRUNCATE TABLE Skipping patches is detrimental because it ignores fixes
TRUNCATE TABLE deletes all rows while preserving for vulnerabilities that attackers often target.
the table’s structure and its columns and constraints.
26. Which best describes the role of a router in a WAN?
DROP TABLE removes the entire table and its structure.
DELETE FROM removes rows but logs each deletion, (A) It simply repeats signals to all connected devices
whereas TRUNCATE is typically faster and resets (B) It forwards data packets between networks,
identity columns in many systems. choosing optimal paths
(C) It combines multiple signals into a single
23. In Python, which exception is raised when a sequence transmission
subscript is out of valid range? (D) It encrypts data automatically for all transmissions
(A) ValueError  Ans
(B) IndexError

Downloaded from www.mcqgpt.com


page 50 CUET UG Computer Science

(B) It forwards data packets between networks, choosing easily compromised, and disabling firewalls lowers
optimal paths defenses. Merely renaming the SSID without encryption
A router examines packets’ destination IP addresses and does not provide real security protection.
decides the most efficient path across interconnected
30. In Python, what happens if an exception is raised inside
networks. Unlike a hub or switch, a router can connect
different networks (e.g., LAN to WAN) and base a try block but there is no matching except block?
routing decisions on network protocols, not just signal (A) The program resolves the exception automatically
repetition. (B) The program terminates unless a finally block re-
throws it
27. Which queue variant allows insertion from both front (C) The program immediately terminates after the
and rear? exception
(A) Simple Queue (D) The exception is silently ignored
(B) Circular Queue  Ans
(C) Priority Queue
(D) Deque (C) The program immediately terminates after the
exception
Ans If no matching except clause is found, the default
(D) Deque behavior is for Python to terminate execution and
A double-ended queue (deque) is a linear data structure print a traceback of the unhandled exception. A finally
permitting insertion and deletion from both ends. This block still executes, but it cannot fix the missing except
flexibility differs from a regular queue (FIFO), which scenario, so the program ends unless the exception is
typically inserts at the rear and removes from the front. otherwise handled.
Deques are useful in scenarios requiring bidirectional
31. Which of the following sorting algorithms finds the
queue operations.
minimum element in each pass and places it at the
28. What does the ROUND(number, digits) function do in beginning of the unsorted part?
MySQL if digits is set to 2? (A) Insertion Sort
(A) Rounds the number to 2 decimal places (B) Bubble Sort
(B) Produces integer division (C) Selection Sort
(C) Truncates all decimal digits (D) Merge Sort
(D) Returns NULL if number is negative  Ans
Ans (C) Selection Sort
(A) Rounds the number to 2 decimal places Selection Sort locates the smallest element in the
MySQL’s ROUND function with a specific digits unsorted portion and swaps it with the first unsorted
parameter adjusts the number to that many decimal position, progressively building a sorted sublist at the
places. For instance, ROUND(123.4567, 2) yields array’s start. Bubble Sort repeatedly compares adjacent
123.46. It does not truncate beyond ignoring extra elements, Insertion Sort inserts elements into a sorted
decimals nor does it conditionally return NULL for sublist, and Merge Sort employs divide-and-conquer.
negative values.
32. Which is not a valid data type in MySQL?
29. Which of the following is generally the best approach to (A) INT
safeguard wireless networks? (B) VARCHAR
(A) Use no encryption but change the default SSID (C) BINARY_FLOAT
(B) Enable WEP encryption only (D) DATE
(C) Enable WPA2 or WPA3 security  Ans
(D) Disable the firewall when connected to Wi-Fi
(C) BINARY_FLOAT
Ans MySQL commonly supports INT, VARCHAR, DATE,
(C) Enable WPA2 or WPA3 security and other data types. However, BINARY_FLOAT is
WPA2 and WPA3 are robust wireless security standards specific to some other database systems (like Oracle).
providing better encryption, making eavesdropping or MySQL may support FLOAT, DOUBLE, DECIMAL,
unauthorized access more difficult. WEP is outdated,

Downloaded from www.mcqgpt.com


PRACTICE PAPER 05

but BINARY_FLOAT is not a recognized built-in type 36. Which statement best differentiates a Switch from a
in standard MySQL distributions. Router in networking?
(A) Switches operate at the IP layer, while routers work
33. Which function in MySQL returns the current date and at the MAC layer
time? (B) Switches operate at the data link layer, while routers
(A) DATE() operate at the network layer
(B) NOW() (C) Both operate at the application layer
(C) DAYNAME() (D) Both function only at the physical layer
(D) MONTHNAME()
 Ans
Ans
(B) Switches operate at the data link layer, while routers
(B) NOW() operate at the network layer
NOW() retrieves the current date and time in MySQL. Switches use MAC addresses at the data link layer to
DATE() extracts the date portion from a datetime, forward frames. Routers operate at the network layer,
DAYNAME() returns the weekday name for a given relying on IP addresses to direct packets across subnets
date, and MONTHNAME() returns the month name. or networks. This division of labor ensures efficient local
Thus, NOW() is the comprehensive function for both traffic handling versus broader network routing.
date and time.
37. Which Python module is commonly used for reading
34. Which statement correctly describes a foreign key in a and writing binary files with object serialization?
relational model? (A) csv
(A) It is a key that uniquely identifies records within its (B) os
own table (C) math
(B) It can only reference columns of type TEXT (D) pickle
(C) It references a primary key in another table to
establish relationships  Ans
(D) It cannot be used to enforce referential integrity (D) pickle
Ans The `pickle` module serializes and deserializes Python
objects to and from binary files. It’s often used to
(C) It references a primary key in another table to preserve program objects across sessions. The `csv`
establish relationships module handles comma-separated text files, `os`
A foreign key enforces referential integrity by tying a provides operating-system-level functionality, and
column in one table to the primary key of another. It `math` handles mathematical functions.
ensures valid links between related rows and prevents
orphaned records or mismatched data across relational 38. Which measure of central tendency sums all data values
tables. and divides by the count?
(A) Mean
35. Which structure uses FIFO (First-In, First-Out) for data (B) Median
handling? (C) Mode
(A) Stack (D) Standard Deviation
(B) Queue
(C) Deque  Ans
(D) Binary Tree (A) Mean
Ans The mean is computed by adding up all data points and
dividing by the number of those data points. Median is
(B) Queue the middle value when data is sorted, mode is the most
A queue processes elements in the order they arrive. The frequent value, and standard deviation measures data
first inserted item is the first one removed. This helps dispersion around the mean.
model real-world lines or waitlists where individuals
exit in the same order they entered. By contrast, a stack 39. Which best describes intrusion in network security?
uses LIFO, and a deque allows insertion/removal at both (A) Authorized access to system resources
ends. (B) Unauthorized attempts to access, manipulate, or
disable networks

Downloaded from www.mcqgpt.com


page 52 CUET UG Computer Science

(C) Routine software update for system efficiency  Ans


(D) Manual reconfiguration of network topologies (C) Foreign Key
Ans The foreign key in the Borrower table references the Book
table’s primary key to maintain referential integrity. This
(B) Unauthorized attempts to access, manipulate, or
relationship ensures no invalid BookID values can be
disable networks
used in the Borrower table, thereby enforcing consistent
Intrusion refers to malicious, non-approved activities
and meaningful relationships between both tables.
aiming to breach security, steal data, or cause disruptions.
Typical legitimate operations, like authorized logins 42. Which security measure would be most critical to
or official network reconfigurations, do not qualify prevent unauthorized access to the library’s database?
as intrusions. Intruders exploit weaknesses to gain (A) Using only default usernames
unauthorized control of resources. (B) Role-based privileges and strong authentication
(C) Disabling user credentials altogether
40. Which is the best strategy to handle file operations in
(D) Permitting open guest logins
Python to prevent resource leaks?
(A) Open files but never close them  Ans
(B) Store file references in global variables (B) Role-based privileges and strong authentication
(C) Use a `with` statement to automatically close files Assigning database roles with appropriate permissions
(D) Close files only if an error occurs and enforcing robust authentication (such as distinct
Ans usernames and complex passwords) is essential. This
practice guards against unauthorized modifications
(C) Use a `with` statement to automatically close files
and data exposures. Default or open login credentials
The `with` context manager in Python ensures files are
severely compromise database safety.
closed automatically once the block ends. This approach
prevents resource leaks and simplifies code by removing 43. Which SQL operation can combine records from both
the need to manually close files, even if exceptions arise. Book and Borrower tables based on matching BookID?
Other options risk unclosed file handles. (A) UNION
(B) JOIN
Direction :Carefully read the case study provided and then
(C) MINUS
thoroughly answer the subsequent five questions.
(D) INTERSECT
Pranav is working on a library management system that
tracks books, authors, and borrowers. He wants to design  Ans
relational tables using MySQL, ensuring each book has a (B) JOIN
unique identifier (BookID) as the primary key. Borrowers A JOIN unifies rows from two or more tables based
are issued an ID that references this BookID as a foreign on shared attributes, typically a primary key and a
key to track who has borrowed which title. Pranav uses corresponding foreign key. In this case, matching
SQL joins to combine Book and Borrower data for BookID values from the Book and Borrower tables are
comprehensive reports. He also aims to implement fine- joined, creating a result set containing information from
grained security measures to prevent unauthorized both entities.
database access, including role-based privileges and
strong user authentication. Additionally, backups and 44. To maintain continuity in case of system failures, which
transaction logs are maintained to recover from data loss. method helps Pranav recover data?
The library system must handle concurrency so multiple (A) Ignoring transaction logs
librarians can manage books simultaneously without (B) Regular backups and transaction logs
data conflicts. (C) Deleting logs to free space frequently
(D) Storing data only in memory
41. Which key is used in the Borrower table to reference the
 Ans
Book table’s primary key?
(A) Alternate Key (B) Regular backups and transaction logs
(B) Candidate Key Backups capture snapshots of data at specific intervals,
(C) Foreign Key while transaction logs track changes incrementally.
(D) Composite Key Together, they allow restoration to a consistent state

Downloaded from www.mcqgpt.com


PRACTICE PAPER 05

following hardware crashes or other failures. Neglecting 47. Which Python mechanism ensures that file operations
logs or relying solely on memory endangers data handle exceptions gracefully?
integrity. (A) The `while` loop
(B) The `if-else` structure
45. Which concurrency concern is most relevant for (C) The `try-except` block
multiple librarians editing book details? (D) The `range` function
(A) Data duplication within the primary key
(B) Race conditions leading to inconsistent updates  Ans
(C) Maintaining identical user sessions for everyone (C) The `try-except` block
(D) Creating unlimited read-only accounts The `try-except` structure in Python allows you to wrap
Ans file operations in a protective block. If an error such as
a missing file occurs, the corresponding `except` clause
(B) Race conditions leading to inconsistent updates catches and handles it. This prevents abrupt termination,
Concurrency control addresses the possibility of prompting graceful recovery and error messaging.
simultaneous edits overwriting one another. Proper
measures, such as locking or transaction isolation levels, 48. Which data structure ensures each enrollment request is
avoid conflicts that cause partial or conflicting updates. processed in the order it is received?
Race conditions are central concurrency concerns, (A) Stack
ensuring consistent, accurate data. (B) Queue
(C) Deque
Direction :Carefully read the case study provided and then (D) Tree
thoroughly answer the subsequent five questions.
Sanya is learning Python to automate administrative  Ans
tasks for a student enrollment system. She needs to (B) Queue
parse large text files containing student records, convert A queue processes items on a first-in, first-out basis.
them into structured data, and insert these details into a Enrollment requests that arrive first are handled first,
MySQL database. She must handle exceptions gracefully ensuring fairness and sequential order. A stack reverses
when files are missing or corrupted, using a `try-except` order (LIFO), a deque permits operations at both ends,
block and custom error messages. Sanya also uses a queue and a tree does not strictly manage insertion order in a
to process bulk enrollment requests in the order they FIFO manner.
arrive. For optimal efficiency, she plans to implement
binary search for quickly verifying student IDs in a sorted 49. Which algorithm would Sanya use to quickly confirm if
list. Data privacy is important, so she enforces secure a student ID exists in a large, sorted list?
network protocols and sets up a firewall. Sanya’s next step (A) Linear Search
is to analyze system logs to detect unauthorized attempts (B) Hash Search
that might compromise student information. (C) Binary Search
(D) Bubble Sort
46. Which file approach would Sanya likely use if records are  Ans
stored in plain characters, easy to read in a text editor?
(A) Binary File (C) Binary Search
(B) Text File Binary search splits a sorted list repeatedly, checking the
(C) Encrypted File midpoint to either continue left or right. This approach
(D) Image File operates in O(log n) time, outperforming linear search,
which checks every element. Sorting is a prerequisite
Ans for binary search, but once sorted, lookups become far
(B) Text File more efficient.
Text files store data using ASCII or Unicode characters,
50. Which network security measure can Sanya use to
making them human-readable and easily edited. Sanya
is parsing large text files, so they are neither binary nor protect student data from unauthorized external threats?
inherently encrypted. They can be opened and modified (A) Strictly use open Wi-Fi connections
with standard text editors, facilitating inspection. (B) Disable all forms of encryption
(C) Configure a firewall to block malicious traffic
(D) Share database credentials publicly

Downloaded from www.mcqgpt.com


page 54 CUET UG Computer Science

Ans
(C) Configure a firewall to block malicious traffic
A firewall inspects inbound and outbound data packets,
filtering harmful or suspicious traffic from reaching the
system. By configuring rules, Sanya can protect sensitive
student data from unauthorized access. Disabling
encryption or sharing credentials publicly compromises
security, while open Wi-Fi is also risky.

 **************

Downloaded from www.mcqgpt.com


PRACTICE PAPER 06

PRACTICE PAPER 06

1. Which term describes a minimal set of attributes Selection helps narrow down data to those records
that uniquely identifies a tuple in a relation without satisfying certain predicates.
redundancy?
4. Which of the following is not a valid DML (Data
(A) Composite Key
(B) Candidate Key Manipulation Language) command in SQL?
(C) Foreign Key (A) INSERT
(D) Super Key (B) UPDATE
(C) DELETE
Ans (D) CREATE
(B) Candidate Key  Ans
A candidate key is a minimal set of attributes that can
uniquely determine a tuple in a relation. It contains no (D) CREATE
unnecessary attributes, and from among the candidate CREATE is part of the Data Definition Language
keys, one is chosen as the primary key. Other candidate (DDL) used to create database objects like tables.
keys become alternate keys. INSERT, UPDATE, and DELETE belong to the Data
Manipulation Language (DML), focusing on changing
2. Which command in MySQL changes the structure of an data within existing tables rather than defining or
existing table, such as adding a new column? altering structures.
(A) SELECT
5. Which statement contrasts a primary key with an
(B) ALTER TABLE
(C) UPDATE alternate key?
(D) TRUNCATE TABLE (A) Both can remain NULL in some rows
(B) A primary key is a chosen candidate key, while an
Ans alternate key is a candidate key not chosen
(B) ALTER TABLE (C) Alternate keys must be composed of multiple
ALTER TABLE modifies an existing table’s structure, columns, while a primary key is single-column
allowing addition or removal of columns, and changes only
to column data types or constraints. SELECT is for data (D) They are identical in meaning and usage
retrieval, UPDATE is for altering rows, and TRUNCATE  Ans
TABLE clears all data but keeps structure intact.
(B) A primary key is a chosen candidate key, while an
3. In relational algebra, which operation corresponds alternate key is a candidate key not chosen
to selecting rows from a table that meet a specific Among candidate keys in a table, one key is designated
condition? as the primary key. Any remaining candidate keys
(A) Projection become alternate keys. This distinction ensures only one
(B) Selection official primary key, but alternate keys can still uniquely
(C) Union identify rows if needed.
(D) Intersection
6. What is generally the best approach to handle
Ans concurrency in SQL databases?
(B) Selection (σ) (A) Disable transactions for speed
Selection (σ) filters rows based on a specified condition, (B) Use transaction isolation levels and locks
returning only the tuples that fulfill the condition. (C) Permit all concurrent writes freely without control
Projection (π) picks columns, while union and (D) Only allow a single user connection
intersection combine rows from multiple relations.  Ans

Downloaded from www.mcqgpt.com


page 56 CUET UG Computer Science

(B) Use transaction isolation levels and locks 3. ROUND() c. Returns current system
Transaction isolation levels, combined with appropriate date and time
locking mechanisms, prevent conflicting data writes
4. NOW() d. Rounds a numeric
and maintain data consistency. Disabling transactions
value to specified
or allowing unregulated writes causes data conflicts.
decimals
Limiting to one user is impractical, so concurrency
controls are the optimal balance between safety and Options:
performance. (A) 1-b, 2-a, 3-d, 4-c
(B) 1-a, 2-b, 3-c, 4-d
7. Arrange these steps in correct order for Python (C) 1-b, 2-c, 3-a, 4-d
exception handling: (D) 1-d, 2-b, 3-a, 4-c
1. Code that might raise an exception
 Ans
(A) 4 → 1 → 2 → 3
(B) 1 → 4 → 2 → 3 (A) 1-b, 2-a, 3-d, 4-c
(C) 2 → 4 → 1 → 3 LCASE() / LOWER() (b) converts to lowercase. MOD()
(D) 1 → 2 → 3 → 4 (a) yields a remainder. ROUND() (d) rounds numbers.
NOW() (c) fetches current date and time. These built-in
Ans
SQL functions facilitate text manipulation, arithmetic,
(A) 4 → 1 → 2 → 3 and date/time retrieval.
In Python, you write try to start the block (4), place the
code that may fail (1), specify except blocks (2), and 10. Match the following Network Topologies in Column A
optionally use a finally block (3) that runs regardless. with their Characteristic in Column B:
This sequence ensures errors can be caught and final Column A Column B
steps always executed.
1. Bus a. Every node connected
8. Order these processes involved in the flow of data from to every other node
one networked device to another: 2. Star b. Single backbone cable,
1. Data encapsulation with protocols terminators at ends
2. Routing to the destination network 3. Ring c. Central hub or switch
3. Physical transmission across medium in the middle
4. Application interprets received data 4. Mesh d. Each node connected
(A) 1 → 2 → 3 → 4 in a closed loop
(B) 1 → 3 → 2 → 4
Options:
(C) 3 → 1 → 2 → 4
(A) 1-a, 2-b, 3-c, 4-d
(D) 4 → 3 → 2 → 1
(B) 1-b, 2-c, 3-d, 4-a
Ans (C) 1-c, 2-a, 3-b, 4-d
(A) 1 → 2 → 3 → 4 (D) 1-b, 2-d, 3-a, 4-c
First, data is encapsulated with the necessary protocol  Ans
headers. Next, the router determines the path to the
(B) 1-b, 2-c, 3-d, 4-a
destination. Then the bits are physically transmitted
In a bus topology (b), all devices connect to one
over cables or wireless. Finally, the receiving application
backbone cable with terminators. A star (c) has a central
interprets and processes the data.
hub. A ring (d) arranges nodes in a loop. Mesh (a)
9. Match the SQL Functions in Column A with their connects every node to every other node directly.
Purpose in Column B:
11. Match the Python Stack Operations in Column A with
Column A Column B their Description in Column B:
1. LCASE() / a. Returns remainder of
Column A Column B
LOWER() division
1. PUSH() a. Remove the top element
2. MOD() b. Converts a string to
lowercase

Downloaded from www.mcqgpt.com


PRACTICE PAPER 06

2. POP() b. Insert an element onto 2. DELETE (Dequeue) b. Add an element at the


the top rear
3. Peek() c. Check if stack is empty 3. Front pointer c. Points to next
4. Empty() d. Return the top element removal position
without removing 4. Rear pointer d. Points to next
Options: insertion position
(A) 1-a, 2-b, 3-c, 4-d Options:
(B) 1-b, 2-a, 3-d, 4-c (A) 1-b, 2-a, 3-c, 4-d
(C) 1-b, 2-c, 3-a, 4-d (B) 1-a, 2-b, 3-d, 4-c
(D) 1-d, 2-b, 3-c, 4-a (C) 1-c, 2-d, 3-b, 4-a
(D) 1-d, 2-c, 3-a, 4-b
Ans
 Ans
(B) 1-b, 2-a, 3-d, 4-c
PUSH() (b) puts a new element on top of the stack, (A) 1-b, 2-a, 3-c, 4-d
POP() (a) removes the top element, Peek() (d) reveals In a queue, INSERT/Enqueue (b) adds an element to
the top element without removal, and isEmpty() (c) the rear, DELETE/Dequeue (a) removes from the front,
returns true if no elements are in the stack. This covers the front pointer (c) references the position of the next
basic stack operations in Python. removal, and the rear pointer (d) references where the
next insertion will occur.
12. Match each Network Device in Column A with its
Function in Column B: 14. Consider these statements about searching algorithms:
1. Linear search checks all elements sequentially
Column A Column B 2. Binary search requires a sorted list
1. Repeater a. Routes data packets across 3. Binary search worst-case is O(n)
different networks 4. Linear search worst-case is O(n)
2. Hub b. Regenerates and amplifies 5. Binary search typically performs comparisons by
signals halving the search space
3. Switch c. Broadcasts received signals Which combination is correct?
to all ports (A) 1, 2, 4, 5 only
(B) 1, 3, 4 only
4. Router d. Forwards data selectively
(C) 2, 3, 5 only
based on MAC
(D) 1, 2, 3, 5
Options:
 Ans
(A) 1-c, 2-b, 3-d, 4-a
(B) 1-b, 2-c, 3-d, 4-a (A) 1, 2, 4, 5 only
(C) 1-d, 2-a, 3-b, 4-c Linear search (1) checks sequentially, with worst-case
(D) 1-b, 2-d, 3-a, 4-c O(n) (4). Binary search (2) requires a sorted list, and
it performs halving comparisons (5). Its worst-case is
Ans
O(log n), not O(n). Hence statements 1, 2, 4, and 5 are
(B) 1-b, 2-c, 3-d, 4-a correct.
A repeater (b) amplifies signals, a hub (c) broadcasts to
all connected ports, a switch (d) forwards frames based 15. Evaluate the following about MySQL aggregate
on MAC addresses, and a router (a) connects distinct functions:
networks by routing packets based on IP addresses. 1. MIN() finds the smallest value in a column
2. MAX() finds the largest value in a column
13. Match the Queue Operations in Column A with their 3. SUM() adds all numeric values in a column
Description in Column B: 4. COUNT() can count rows even if they have NULL
Column A Column B in columns when using (*)
1. INSERT (Enqueue) a. Remove an element 5. AVG() returns the middle value among numeric
from the front entries
Which statements are correct?

Downloaded from www.mcqgpt.com


page 58 CUET UG Computer Science

(A) 1, 2, 3, 4 only Stacks follow LIFO ordering (so statement 1 is incorrect),


(B) 1, 2, 4, 5 only and a deque is not just another name for a stack. The
(C) 1, 2, 3, 5 only top pointer (2) identifies where insertion and deletion
(D) 1, 2, 3, 4, 5 occur, infix to postfix conversion often involves a stack
Ans (3), and the last pushed element is popped first (4).

(A) 1, 2, 3, 4 only 18. Analyze these statements about exceptions in Python:


MIN() and MAX() retrieve minimum and maximum 1. A syntax error will be caught by an except block at
values, SUM() sums all numeric entries, and COUNT(*) runtime
counts rows, including those with NULL. However, 2. ZeroDivisionError is a built-in exception
AVG() calculates the arithmetic mean, not the middle 3. try-except blocks help handle runtime errors
value (which is the median). Therefore 1, 2, 3, and 4 are gracefully
correct. 4. A custom exception can be created by subclassing
Exception
16. Check these statements about the bus topology in 5. IndentationError is a runtime exception that can be
computer networks: handled
1. Each device is directly connected to every other Which are correct?
device (A) 1, 2, 3 only
2. One main cable acts as a backbone (B) 2, 3, 4 only
3. Data collisions can occur (C) 2, 4, 5 only
4. Terminators are needed at both ends (D) 1, 5 only
5. It uses multiple centralized hubs
Which combination is correct for a bus topology?  Ans
(A) 2, 3, 4 only (B) 2, 3, 4 only
(B) 1, 4, 5 only SyntaxError and IndentationError occur before
(C) 2, 3, 5 only runtime, so they are not caught in a standard try-except
(D) 1, 3 only block. ZeroDivisionError (2) is a built-in exception,
Ans try-except (3) handles runtime errors, and custom
exceptions (4) can be created by subclassing Exception.
(A) 2, 3, 4 only Therefore, statements 2, 3, and 4 are valid.
In a bus topology, all devices share one main cable,
requiring terminators at both ends, and collisions can 19. Assertion (A) : In MySQL, ORDER BY arranges rows
occur if multiple devices transmit simultaneously. based on specified column(s).
Devices are not each directly connected to every other, Reason (R) : Sorting is only valid in numeric columns
and it does not rely on multiple hubs. and cannot be done on text columns.
(A) Both A and R are true, and R is the correct
17. Review these statements about the Stack data structure: explanation of A.
1. It is based on FIFO ordering (B) Both A and R are true, but R is not the correct
2. The top pointer indicates where PUSH and POP explanation of A.
happen (C) A is true, but R is false.
3. Infix to Postfix conversion uses a stack (D) A is false, but R is true.
4. The last item pushed is the first item popped
5. Deque is another name for Stack  Ans
Which are accurate for Stacks? (C) A is true, but R is false.
(A) 1, 5 only MySQL’s ORDER BY arranges rows in ascending or
(B) 2, 3, 4 only descending order based on the specified column(s). This
(C) 3, 5 only can apply to numeric, text, or date columns. Therefore,
(D) 1, 2, 4 only the assertion is correct, but the reason is incorrect
Ans because sorting is definitely allowed on text columns.

(B) 2, 3, 4 only 20. Assertion (A) : Deletion from a queue occurs at the
front pointer.

Downloaded from www.mcqgpt.com


PRACTICE PAPER 06

Reason (R) : In a queue, elements can be inserted and (B) Jump Search
removed from the same end. (C) Sequential Search (Linear Search)
(A) Both A and R are true, and R is the correct (D) Interpolation Search
explanation of A.  Ans
(B) Both A and R are true, but R is not the correct
explanation of A. (C) Sequential Search (Linear Search)
(C) A is true, but R is false. Linear or sequential search checks each element one by
(D) A is false, but R is true. one until the target is found or the entire structure is
exhausted. Although straightforward, it can be time-
Ans consuming for large lists, making more sophisticated
(C) A is true, but R is false. algorithms like binary search preferable for sorted data.
A queue deletes elements from the front pointer,
24. In a Star topology, what happens if the central hub fails?
adhering to FIFO. However, standard queues insert and
remove from opposite ends: insertion at the rear and (A) Only half the nodes lose communication
removal at the front. Hence, R stating both operations (B) All network communication stops
occur at the same end is false. (C) The network reconfigures into a ring topology
(D) No effect on communication
21. Which statement accurately describes the purpose of a  Ans
gateway in a network?
(A) It simply repeats signals within the same subnet (B) All network communication stops
(B) It connects networks using different protocols or In a star topology, every node connects to a central hub
architectures or switch. If that central device fails, there is no alternate
(C) It only filters broadcast traffic path for data to travel, causing the entire network to lose
(D) It is synonymous with a hub for local connections connectivity, because all data routes through the center
point.
Ans
25. Which of the following is not a recommended security
(B) It connects networks using different protocols or
architectures practice?
A gateway functions at higher layers, enabling data (A) Updating antivirus software regularly
communication between networks that might not (B) Clicking on suspicious email links
share the same protocol or architecture. Unlike simpler (C) Using firewalls to monitor traffic
devices like hubs or switches, gateways can translate (D) Maintaining strong, unique passwords
between different formats and facilitate cross-network  Ans
interactions. (B) Clicking on suspicious email links
22. Which Python statement is used to create a user-defined Clicking on suspicious links is a common cause of
exception? malware and phishing attacks. Updating antivirus
(A) except MyError: software, configuring firewalls, and using robust
(B) class MyError(Exception): passwords are sound security measures. Users should
(C) raise SyntaxError always avoid risky links in unsolicited or suspicious
(D) def MyError(): emails to protect systems from compromise.

Ans 26. Which file operation mode in Python appends data at


(B) class MyError(Exception): the end of an existing text file?
You define a custom exception in Python by creating a (A) r
new class derived from the built-in Exception class. This (B) w
custom class can then be raised in code using the `raise` (C) a
keyword. The other options either handle an existing (D) wb
exception or define a function, not a new exception type.  Ans

23. Which searching technique scans each element in a list (C) a


until it finds the target or reaches the end? Opening a file in a mode allows writing data to the end
(A) Binary Search of the file without overwriting existing content. r is

Downloaded from www.mcqgpt.com


page 60 CUET UG Computer Science

read-only, w overwrites existing data or creates a file if (A) print()


missing, and wb writes in binary mode. (B) pickle.dump()
(C) open()
27. Which function in MySQL returns the current day (D) len()
name (e.g., Monday)?
(A) DAY()  Ans
(B) DAYNAME() (B) pickle.dump()
(C) DAYOFWEEK() The `pickle.dump()` function writes a Python object
(D) MONTHNAME() (like lists or custom classes) into a binary file using a
Ans specified file handle. This process, known as serialization,
converts in-memory objects into a transferable byte
(B) DAYNAME() stream. Conversely, `pickle.load()` reverses this process,
DAYNAME() extracts the weekday name from a given recreating the object in memory.
date value, returning strings like Monday or Tuesday.
DAY() returns the day of the month as a numeric 31. Which sorting technique compares adjacent elements
value, DAYOFWEEK() returns a numeric index for the and swaps them if they are out of order, iterating
weekday, and MONTHNAME() returns the name of the multiple times?
month. (A) Insertion Sort
(B) Selection Sort
28. Which statement best describes the term domain in (C) Quick Sort
relational databases? (D) Bubble Sort
(A) A single row in a table
(B) The set of permissible values an attribute can take  Ans
(C) A set difference of two relations (D) Bubble Sort
(D) The foreign key reference Bubble Sort passes through the list repeatedly,
Ans comparing adjacent elements and swapping if needed.
Each pass bubbles up larger elements toward the end.
(B) The set of permissible values an attribute can take Insertion Sort directly places elements in a sorted
In relational databases, each attribute is associated with portion, Selection Sort finds minimums for each pass,
a domain, which is the pool of valid values that column and Quick Sort uses a partitioning approach.
can hold. This ensures consistent and proper data
input. A row is a tuple, not a domain, and references or 32. Which of the following is not a threat to network
differences describe relational operations, not domains. security?
(A) Virus
29. Which is generally the best way to optimize queries for (B) Worm
large datasets in MySQL? (C) Trojan horse
(A) Avoid using indexes (D) Debugger
(B) Use indexes on frequently queried columns
(C) Store all data in one single table  Ans
(D) Use subqueries for every retrieval (D) Debugger
Ans Debuggers are legitimate tools used for testing and
troubleshooting software. Viruses, worms, and Trojan
(B) Use indexes on frequently queried columns horses are malicious threats capable of damaging or
Indexes make data retrieval faster by allowing the exploiting systems. A debugger, when used properly,
database to find rows more efficiently. Indexing does not pose a security threat but rather aids in
columns that appear often in WHERE clauses or joins diagnosing and fixing issues.
significantly improves performance. Using no indexes
or cramming all data into a single table typically 33. Which queue variant addresses the problem of wasted
degrades performance, and unnecessary subqueries can space that occurs in a simple linear queue?
also slow execution. (A) Circular Queue
(B) Priority Queue
30. Which function in Python can serialize complex objects (C) Stack
into byte streams for storage in a binary file? (D) Deque

Downloaded from www.mcqgpt.com


PRACTICE PAPER 06

Ans (B) A stack removes the most recently added element,


(A) Circular Queue while a queue removes the least recently added element
A circular queue reuses vacated slots by treating the Stacks use Last-In, First-Out, removing the topmost
queue as circular, allowing the rear pointer to wrap (most recent) item. Queues use First-In, First-Out,
around. This prevents the false full scenario found in removing items from the front. Both can handle diverse
linear queues where front moves forward but cannot data types, and they are not interchangeable due to their
reuse freed positions once it has passed them. distinct insertion/removal orders.

34. Why is data interpretation using mean, median, and 37. Which MySQL function extracts the month number
standard deviation important? from a date?
(A) It replaces the need for raw data collection (A) MONTH()
(B) It allows no insights into data distribution (B) MONTHNAME()
(C) It helps summarize and understand data variability (C) DAY()
(D) It invalidates data analysis (D) YEAR()
Ans  Ans
(C) It helps summarize and understand data variability (A) MONTH()
Statistical measures like mean, median, and standard The MONTH() function returns a numeric month
deviation reveal central tendencies and dispersion within (1 to 12) from a valid date. MONTHNAME() returns
the data. They condense large sets into interpretable the textual month name, DAY() extracts the day of the
metrics, enabling quick insights into typical values and month, and YEAR() extracts the four-digit year value.
the spread of observations. They do not eliminate the These functions help dissect date fields in queries.
need for raw data but complement it.
38. Which of the following is a type of switching technique
35. In Python, which statement is used to deliberately in data communication?
generate an exception? (A) Circuit Switching
(A) continue (B) Loopback Switching
(B) pass (C) MAC Switching
(C) raise (D) Data Repetition Switching
(D) return  Ans
Ans (A) Circuit Switching
(C) raise Common switching techniques include circuit
The `raise` statement explicitly triggers an exception switching, packet switching, and message switching.
in Python, allowing developers to create or propagate Circuit switching establishes a dedicated path for the
errors intentionally. The other statements are not duration of a communication session. Loopback and
associated with producing exceptions. `continue` data repetition switching are not standard recognized
and `pass` control flow in loops or placeholders, and switching methods, and MAC is an address concept, not
`return` exits a function. a switching technique.

36. Which statement best differentiates a stack from a 39. Which scenario describes an eavesdropping attack in
queue? network security?
(A) Both remove elements from the front (A) Injecting malicious code into a server
(B) A stack removes the most recently added element, (B) Flooding a network to cause Denial of Service
while a queue removes the least recently added (C) Secretly intercepting and reading transmitted data
element (D) Physically damaging network cables
(C) A queue can only hold numeric data, while a stack  Ans
can hold any data type
(C) Secretly intercepting and reading transmitted data
(D) There is no difference; they are interchangeable
Eavesdropping attacks involve unauthorized monitoring
Ans of data traveling across a network. Attackers listen to
traffic seeking confidential information. Injecting code
is more akin to an injection or Trojan scenario, flooding

Downloaded from www.mcqgpt.com


page 62 CUET UG Computer Science

is a DoS, and damaging cables is physical sabotage, not restricting operations is impractical, while dropping
eavesdropping. tables for updates is destructive and not a concurrency
solution.
40. What is the best measure to prevent dictionary attacks
on user passwords? 42. Which stack-based feature is Raghav likely using to
(A) Using extremely short passwords for convenience support user undo/redo actions in the Python interface?
(B) Storing passwords in plain text on the server (A) FIFO queue
(C) Enforcing minimum complexity rules and salting/ (B) LIFO stack
hashing (C) Circular queue
(D) Publishing all user credentials for transparency (D) Priority queue
Ans  Ans
(C) Enforcing minimum complexity rules and salting/ (B) LIFO stack
hashing Undo/redo operations typically rely on a Last-In, First-
Strong password complexity, combined with salted and Out structure. The most recent action is the first to be
hashed storage, prevents straightforward dictionary or reversed (undo). Once undone, reapplying it (redo) also
brute-force attacks. Short, simple passwords are easily follows LIFO logic. Queues, whether simple or circular,
guessed, and storing credentials in plain text or publicly do not naturally handle undo/redo sequences.
is extremely insecure, providing attackers a direct
43. Which of the following SQL functions would help
pathway to sensitive accounts.
Raghav find the average student score?
Direction :Carefully read the case study provided and then (A) MIN()
thoroughly answer the subsequent five questions. (B) MAX()
Raghav manages a computer lab where students practice (C) AVG()
SQL queries on a school database. He stores each student’s (D) COUNT()
progress in a MySQL table that tracks completed topics,  Ans
scores, and timestamps. Users log in through a Python
interface, which logs attempts in a text file. Raghav (C) AVG()
implemented a stack to record user navigation for undo/ AVG() computes the arithmetic mean of numeric values
redo actions in the interface. Concurrency arises as in a given column. MIN() returns the lowest score,
multiple students access the same data simultaneously, MAX() returns the highest, and COUNT() gives the
so Raghav configured MySQL with transaction isolation number of rows. For measuring average performance,
levels to maintain data integrity. He also set up a AVG() is the relevant aggregate function.
local network with a firewall to prevent unauthorized 44. Which statement best describes the role of a firewall in
intrusions. To understand trends, Raghav applies basic Raghav’s local network?
statistical functions like AVG() and COUNT() on student (A) It amplifies signals across a wide area
scores, aiming to identify improvement areas and better (B) It performs environment cooling
allocate resources. (C) It inspects and filters incoming/outgoing data
41. Which MySQL feature ensures data consistency when (D) It automatically repairs corrupted files
multiple students modify the same table concurrently?  Ans
(A) No concurrency controls (C) It inspects and filters incoming/outgoing data
(B) Transaction isolation levels A firewall monitors data packets entering or leaving
(C) Dropping the table for updates a network, blocking those deemed suspicious or
(D) Only read operations allowed unauthorized. It doesn’t handle physical amplification,
Ans cooling the environment, or file repairs. Firewalls are
(B) Transaction isolation levels network security barriers that protect systems from
Transaction isolation levels define how and when external threats.
changes become visible to concurrent transactions. 45. To store user login attempts in a text file from Python,
This mechanism preserves data consistency amid which mode is most suitable if Raghav wants to keep
simultaneous updates. Disabling concurrency or appending?

Downloaded from www.mcqgpt.com


PRACTICE PAPER 06

(A) r (D) `print` function


(B) w  Ans
(C) a
(D) w+ (B) `try-except`
The `try-except` block catches and manages errors that
Ans occur while reading or cleaning the files, preventing
(C) a the entire program from crashing. `with open` safely
The a mode appends new data to the end of an existing handles file closing, `for` loops iterate, and `print`
file without erasing prior content. r is read-only, w outputs information, but they do not directly trap
overwrites the file, and w+ opens for reading and anomalies like try-except does.
writing but also overwrites content. Hence a is ideal for
48. Which topology is Neha using for specialized monitoring
continuous logging.
devices to ensure continuous data flow?
Direction :Carefully read the case study provided and then (A) Star
thoroughly answer the subsequent five questions. (B) Bus
Neha is tasked with analyzing daily data communication (C) Ring
logs in a large organization. She receives raw text files (D) Mesh
listing IP addresses, timestamps, and suspected intrusion  Ans
entries. Neha first cleans and formats the data into a
consistent structure, then uses Python’s `try-except` (C) Ring
blocks to handle any anomalies in the files. She imports In a ring topology, each device is connected in a closed
them into a MySQL table for long-term storage and runs loop, passing data in one direction (or both directions
SELECT queries with aggregate functions to see daily in dual-ring). This can provide a predictable data
counts of potential threats. She sets up a ring topology path. Neha specifically set up a ring topology for those
for connecting certain specialized monitoring devices, specialized monitoring devices for continuous flow.
ensuring a steady, continuous data flow. Finally, strong 49. Which measure enhances wireless security in Neha’s
security measures, including WPA2 encryption and setup?
updated antivirus software, are enforced to maintain (A) Using WEP encryption
data privacy. By systematically examining the logs, Neha (B) Disabling password authentication
uncovers patterns of suspicious activities. (C) Implementing WPA2 encryption
46. Which MySQL feature helps Neha count the daily (D) Sharing the network key openly
number of potential threats?  Ans
(A) TRUNCATE TABLE (C) Implementing WPA2 encryption
(B) HAVING clause WPA2 is more robust than WEP, offering strong
(C) COUNT(*) aggregate function encryption for wireless communications. Disabling
(D) DROP TABLE passwords or broadcasting the network key is insecure.
Ans Hence WPA2 is a widely accepted standard that secures
(C) COUNT(*) aggregate function Wi-Fi communication, protecting sensitive logs and
Neha can apply COUNT(_) in her SELECT queries organizational data from interception.
to determine how many logs match the criteria for 50. When Neha imports logs into MySQL, what is her
suspected threats each day. TRUNCATE TABLE and probable reason for applying a consistent structure to
DROP TABLE remove data or table structures, and the raw data first?
HAVING filters grouped data, but the direct counting is (A) To eliminate the need for queries
achieved via COUNT(_). (B) To ensure uniform columns and valid entries
47. Which Python structure is Neha using to handle (C) To make the files unusable by others
anomalies in raw text files? (D) To store them as random text blocks
(A) `with open`  Ans
(B) `try-except` (B) To ensure uniform columns and valid entries
(C) `for` loop

Downloaded from www.mcqgpt.com


page 64 CUET UG Computer Science

Consistent structuring of data ensures each row matches


expected columns and correct data types in the MySQL
table. This practice prevents errors, facilitates accurate
querying, and enhances data integrity. Random or non-
uniform text blocks are not conducive to meaningful
analysis in relational databases.

 **************

Downloaded from www.mcqgpt.com


PRACTICE PAPER 07

PRACTICE PAPER 07

1. What is a primary key in a relational database? entire groups after they have been formed, effectively
(A) An attribute that can only store numeric values making it a second-level condition on grouped data.
(B) A unique identifier for each record
4. Which topology simplifies fault isolation but tends to
(C) A placeholder for missing data
(D) A composite of non-unique columns require more cabling?
(A) Bus
Ans (B) Star
(B) A unique identifier for each record (C) Ring
A primary key is a unique identifier, meaning it (D) Mesh
cannot repeat across rows in a table. It ensures that  Ans
each record is distinctly identifiable. This constraint
prevents duplication and maintains data integrity, (B) Star
making it a critical concept in relational database design In a star topology, each device connects through a
for consistency and accuracy across different data central hub or switch, making it easier to isolate faults
management tasks. because each link is independent. However, it usually
needs more cabling than other topologies, increasing
2. Which SQL command removes all rows from a table but cost. Its simplicity in detecting network failures is
retains its structure? balanced by higher hardware expenses and complexity.
(A) DROP TABLE
5. Which of the following is NOT a standard Python file
(B) TRUNCATE
(C) DELETE access mode?
(D) ALTER TABLE (A) r+
(B) a+
Ans (C) x+
(B) TRUNCATE (D) w+
TRUNCATE is a Data Definition Language command  Ans
that quickly deletes all records from a table but preserves
its schema. It is typically faster than DELETE when (C) x+
removing every row, because it deallocates data pages Python commonly supports ‘r+’, ‘w+’, and ‘a+’ for
directly. This approach is practical for resetting a table read-update, write-update, and append-update modes.
while maintaining its structural design and integrity. Although ‘x’ is used to open a file exclusively for creation,
‘x+’ is not recognized as a typical mode in most Python
3. Which clause in MySQL is applied to rows before versions. This underscores the importance of using valid
grouping occurs? modes and ensuring correctness when handling files.
(A) WHERE
6. Arrange the steps for pushing an element onto a stack
(B) HAVING
(C) GROUP BY in correct order:
(D) ORDER BY 1. Increment top pointer
2. Place the new element at the top position
Ans 3. Check for stack overflow
(A) WHERE 4. Input the new element
The WHERE clause filters rows before the GROUP BY (A) 3,4,1,2
operation, deciding which rows actually form groups. (B) 3,1,4,2
Rows that fail the WHERE condition never become part (C) 4,3,1,2
of any group. By contrast, the HAVING clause filters (D) 1,2,3,4

Downloaded from www.mcqgpt.com


page 66 CUET UG Computer Science

Ans  Ans
(A) 3,4,1,2 (A) Bubble Sort
Before placing a new element, you check for overflow Bubble Sort repeatedly traverses the array, comparing
to ensure the stack isn’t full. Then you input the data and swapping neighboring items when they are
to push. Afterward, you increment the top pointer misordered. This cycle continues until no swaps occur,
to allocate space for the incoming item. Finally, the indicating a sorted array. Though simple, it is notably
element goes to the updated top location, completing slower than more advanced algorithms. Its direct
the push process successfully. mechanism makes it easy to understand but inefficient
for large datasets overall.
7. Assertion (A) : A queue uses First-In-First-Out (FIFO)
order. 10. Which measure of central tendency is most sensitive to
Reason (R) : A queue removes items from the end and outliers?
inserts at the front. (A) Mean
(A) Both A and R are true, and R is the correct (B) Median
explanation. (C) Mode
(B) Both A and R are true, but R is not the correct (D) Harmonic mean
explanation.  Ans
(C) A is true, R is false.
(D) A is false, R is true. (A) Mean
The mean incorporates all data points equally, so an
Ans extremely large or small value shifts it disproportionately.
(C) A is true, R is false In contrast, the median is determined by position, and
A queue enforces FIFO by removing elements from the the mode reflects the most frequent value. Consequently,
front and inserting them at the rear, ensuring earlier large or anomalous observations heavily impact the
enqueued items exit first. The assertion is correct, but mean, making it more sensitive to outliers than other
the reason is reversed, describing the opposite positions measures.
for insertion and removal. Hence, the statement about
11. Match each SQL statement in Column A with its
order is true, whereas its rationale is false.
primary function in Column B:
8. Which data structure offers efficient searching by Column A Column B
halving the search space repeatedly? 1. CREATE P. Modifies existing
(A) Stack TABLE records
(B) Queue
2. SELECT Q. Removes an entire
(C) Linked List
table
(D) Binary Search Tree
3. UPDATE R. Builds a new table
Ans
4. DROP TABLE S. Retrieves data
(D) Binary Search Tree Options:
A binary search tree allows O(log n) average-time (A) 1→R, 2→S, 3→P, 4→Q
lookups, provided it is balanced. Each comparison (B) 1→S, 2→R, 3→Q, 4→P
narrows the search to a left or right subtree, effectively (C) 1→Q, 2→P, 3→S, 4→R
halving the space. This structure significantly (D) 1→P, 2→Q, 3→R, 4→S
outperforms linear searches, especially for larger
 Ans
datasets, since it pinpoints targets faster by leveraging
hierarchical ordering of data. (A) 1→R, 2→S, 3→P, 4→Q
CREATE TABLE (1) establishes a new table structure
9. Which sorting method compares adjacent elements and (R), SELECT (2) fetches or retrieves data (S), UPDATE
swaps them if they are out of order? (3) modifies existing table entries (P), and DROP
(A) Bubble Sort TABLE (4) eliminates the table itself (Q). Each statement
(B) Selection Sort belongs to different SQL categories but collectively
(C) Insertion Sort manages table creation, data querying, modification,
(D) Merge Sort and removal.

Downloaded from www.mcqgpt.com


PRACTICE PAPER 07

12. Which of the following are valid Python file access efficiently and ensures data reaches correct destinations
modes? across diverse networks.
1. r+
15. Which data structure is best for implementing a First-
2. w++
3. a+ In-First-Out buffer system?
4. x (A) Stack
(A) 1 and 2 only (B) Queue
(B) 1, 3, and 4 (C) BST
(C) 2 and 4 only (D) Linked list (circular)
(D) 1 and 3 only  Ans
Ans (B) Queue
(B) 1, 3, and 4 A queue is ideal for FIFO operations because it ensures
Mode ‘r+’ opens a file for both reading and writing, that the earliest inserted item is the earliest one removed.
‘a+’ allows reading and appending, and ‘x’ creates a In buffering scenarios, items arrive in order and must
file exclusively if it does not already exist. The double- be served in the same order. Thus, inserting at one end
plus variant ‘w++’ is not a standard mode. Python’s (rear) and removing from the other (front) preserves
flexibility with file modes ensures precise operations the sequence.
when modifying existing files or creating new ones. 16. Which MySQL clause helps filter aggregated results
13. Which concept represents the time complexity after grouping?
classification for algorithms? (A) WHERE
(A) Big-O notation (B) HAVING
(B) ASCII code (C) ORDER BY
(C) ASCII value (D) UNION
(D) Left outer join  Ans
Ans (B) HAVING
(A) Big-O notation HAVING operates on groups formed by GROUP BY,
Big-O notation categorizes an algorithm’s performance filtering entire groups that don’t satisfy a specified
based on input size growth. It captures worst-case or condition. In contrast, WHERE is applied before rows
average-case scenarios (such as O(n^2) or O(log n)) to are grouped. For instance, you might group records
evaluate efficiency. Programmers use Big-O to compare by department and then use HAVING to exclude
and choose optimal solutions. This theoretical measure departments whose total sales do not exceed a certain
helps forecast behavior under varying sizes, informing threshold.
suitable data structure choices. 17. Match each networking term (Column A) with its
14. Which network device routes data packets between description (Column B):
different networks and directs traffic? Column A Column B
(A) Hub 1. MAC Address P. A unique physical
(B) Switch identifier for a network
(C) Router interface
(D) Repeater
2. IP Address Q. Enables data
Ans transmission between
(C) Router different networks
A router examines incoming data packets, determining 3. Switch R. Logical address for
where they should travel based on IP addresses. Unlike device identification on
a switch, which operates at the local network level, a network
a router connects multiple networks and can apply 4. Gateway S. Forwards data to
routing protocols. This pivotal function directs traffic correct devices within
a LAN

Downloaded from www.mcqgpt.com


page 68 CUET UG Computer Science

Options: letter casing is invalid, making the reason incorrect


(A) 1→P, 2→R, 3→S, 4→Q under normal SQL usage.
(B) 1→R, 2→P, 3→Q, 4→S
20. Which exception type in Python is raised when a built-
(C) 1→P, 2→R, 3→Q, 4→S
(D) 1→S, 2→Q, 3→P, 4→R in operation receives an argument with the correct type
but an inappropriate value?
Ans (A) TypeError
(A) 1→P, 2→R, 3→S, 4→Q (B) ValueError
A Media Access Control (MAC) address (1) is a (C) IndexError
hardware-specific identifier (P), an IP address (2) (D) KeyError
uniquely identifies a device on a network (R), a switch  Ans
(3) directs data within a local network (S), and a gateway
(4) transfers data across dissimilar networks (Q). Each (B) ValueError
device relies on distinct addressing layers. ValueError appears when a function’s parameter is valid
in type but unacceptable in content, such as converting
18. Which structure is more efficient for quick random a non-numeric string to an integer. By contrast,
access, but potentially costly for insertions in the TypeError is triggered if the argument’s data type itself
middle? is incompatible. Python differentiates these errors to
(A) Array clarify whether the data type or its content is wrong.
(B) Linked List
21. Arrange the following steps of an exception handling
(C) Stack
(D) Queue mechanism in the correct order:
1. Code in the try block executes
Ans 2. Exception occurs
(A) Array 3. except block catches the error
An array provides constant-time access to any element 4. Program flow continues in the except block
via its index, making random lookups quick. However, (A) 1,2,3,4
inserting or deleting elements mid-array shifts (B) 1,3,4,2
subsequent items, leading to higher time complexity. (C) 2,1,3,4
Linked lists, by contrast, allow faster insertions anywhere (D) 1,4,2,3
but require sequential traversal for access, highlighting  Ans
distinct trade-offs in data structure design.
(A) 1,2,3,4
19. Assertion (A) : The NOW() function in MySQL returns First, the try block runs normally (1). If an error
the current date and time. arises (2), Python looks for a matching except clause
Reason (R) : The ROUND() function in MySQL (3). Execution then moves into that except block (4).
modifies character cases. This flow ensures the program handles the exception
(A) Both A and R are true, and R is the correct gracefully without immediate termination, letting you
explanation. define a fallback procedure for unexpected conditions.
(B) Both A and R are true, but R is not the correct
22. Match each Python built-in exception (Column A) with
explanation.
(C) A is true, R is false. its typical cause (Column B):
(D) A is false, R is true. Column A Column B
Ans 1. Zero Division Error P. Nonexistent item
(C) A is true, R is false requested in a
NOW() indeed provides the present date and time, dictionary
whereas ROUND() adjusts numeric values to specified 2. Index Error Q. Division by zero is
precision. Modifying character cases typically involves attempted
UCASE() or LCASE(). Therefore, the assertion about 3. Key Error R. Referencing a list
NOW() is correct, but the claim that ROUND() changes element out of
range

Downloaded from www.mcqgpt.com


PRACTICE PAPER 07

4. Import Error S. Failure to import a 2. It merges two relations horizontally


specified module 3. It projects columns
4. It is a unary operation
Options:
(A) 1 and 2
(A) 1→Q, 2→R, 3→P, 4→S
(B) 2 and 3
(B) 1→R, 2→Q, 3→S, 4→P
(C) 1 and 4
(C) 1→S, 2→P, 3→Q, 4→R
(D) 1, 3, and 4
(D) 1→P, 2→S, 3→R, 4→Q
 Ans
Ans
(C) 1 and 4
(A) 1→Q, 2→R, 3→P, 4→S
The SELECT operation in relational algebra (sometimes
Zero Division Error (1) arises from attempting to divide
called σ) filters rows meeting a certain condition and
by zero (Q). Index Error (2) occurs if a list index is out
is unary, applying to one relation. It does not combine
of range (R). A Key Error (3) manifests when requesting
multiple relations horizontally (that would be a
an absent dictionary key (P). Finally, Import Error (4)
JOIN or Cartesian product) nor limit columns (that’s
triggers if Python cannot find or load the specified
PROJECTION). Thus, (1) and (4) correctly describe
module (S). Each handles distinct scenarios.
SELECT.
23. Which searching technique inspects each element
26. Which function in MySQL returns only the year part
sequentially until a match is found?
from a given date?
(A) Linear Search
(A) DAY()
(B) Binary Search
(B) MONTH()
(C) Hash Search
(C) YEAR()
(D) Depth Search
(D) NOW()
Ans
 Ans
(A) Linear Search
(C) YEAR()
Linear search starts from the first element and moves
The YEAR() function extracts the year component
one by one until it detects the required item or reaches
from a date or datetime value, discarding other parts
the end. Although simpler to implement, it is slower
like month or day. For instance, YEAR(‘2025-03-06’)
for large data sets. Binary search, in contrast, splits the
returns 2025. It is especially useful when performing
array repeatedly, achieving faster results if the collection
aggregations or comparisons based solely on years,
is sorted.
simplifying queries in calendar-based data analytics or
24. Which data structure best suits an undo feature in many time-series operations.
software applications?
27. Which network topology arranges nodes in a closed
(A) Stack
loop, where each device has exactly two neighbors?
(B) Queue
(A) Bus
(C) Deque
(B) Star
(D) Sorted list
(C) Ring
Ans (D) Tree
(A) Stack  Ans
An undo operation typically needs Last-In-First-Out
(C) Ring
retrieval, making a stack ideal. Every new action is
In a ring topology, each node connects to exactly two
pushed onto the stack, and undo pops the latest action.
others, forming a circular data path. Data travels from
Queues, on the other hand, remove items in the earliest-
one node to the next in sequence. If one link breaks,
in, earliest-out manner. Deques permit flexible ends but
the ring can be disrupted unless a dual-ring or bypass
do not inherently prioritize most recent operations.
mechanism is in place. This topology can simplify
25. Which statements are true for relational algebra’s token-based communication.
SELECT operation?
28. Which is NOT a feature of Bubble Sort?
1. It restricts rows based on a condition
(A) It compares adjacent pairs of elements

Downloaded from www.mcqgpt.com


page 70 CUET UG Computer Science

(B) It is efficient for large, unsorted datasets 31. Which statements about Python’s pickle module are
(C) It repeatedly passes through the list accurate?
(D) It can detect a sorted list before completing all 1. It serializes Python objects
passes 2. It stores data in human-readable text format
Ans 3. It can deserialize back into Python objects
4. It is used exclusively for JSON
(B) It is efficient for large, unsorted datasets 5. It works with binary file handling
Bubble Sort compares neighboring items, swapping (A) 1, 3, and 5
them if they’re misordered, and can terminate early (B) 1, 2, and 4
if no swaps occur in a pass (indicating completion). (C) 2, 3, and 5
However, it is generally inefficient for sizable, randomly (D) 1, 4, and 5
ordered data. Time complexity worsens significantly as
dataset size increases, making advanced methods like  Ans
Merge Sort more suitable. (A) 1, 3, and 5
Pickle serializes Python objects (1) into a binary
29. Assertion (A) : The HAVING clause in SQL filters representation, which is not human-readable
records individually before grouping. (disqualifying statement 2). It can also recreate objects
Reason (R) : HAVING works on group results, typically (3) from that serialized data. JSON usage (4) is separate
used alongside GROUP BY. from pickle’s binary format. Consequently, it works with
(A) Both A and R are true, and R is the correct binary file operations (5), making (1), (3), and (5) the
explanation. correct statements.
(B) Both A and R are true, but R is not the correct
explanation. 32. Which Python exception arises if you attempt to access
(C) A is true, R is false. a list index beyond its valid range?
(D) A is false, R is true. (A) NameError
Ans (B) IndexError
(C) OverflowError
(D) A is false, R is true (D) IOError
HAVING applies conditions to aggregated group
results after GROUP BY. The assertion is false because  Ans
it states HAVING filters rows before grouping, which is (B) IndexError
actually the WHERE clause’s job. The reason is correct: IndexError is thrown when code requests a list element
HAVING is used after grouping, removing entire groups at a position outside the available indices. For example,
that fail specified conditions, often used with aggregate accessing my_list[10] in a list of length 5 triggers
functions. IndexError. This alerts the programmer that the index
is invalid, preventing silent failures or unpredictable
30. Which structure is more suitable for breadth-first behavior during list manipulations in Python.
traversal tasks, such as simulating a print queue?
(A) Stack 33. Which function returns the length of a string in MySQL?
(B) Queue (A) LENGTH()
(C) Linked List (B) MOD()
(D) Tree (C) INSTR()
Ans (D) MID()

(B) Queue  Ans


A queue adheres to FIFO, which ensures the earliest item (A) LENGTH()
is handled first. Breadth-first traversal in trees or graphs LENGTH() gives the total number of bytes in a string.
similarly processes nodes level by level, enqueuing For ASCII-based data, LENGTH() corresponds to the
adjacent nodes. Stacks would reverse processing order, character count. However, with multi-byte characters,
making them more suitable for depth-first tasks. Queues it may differ from the displayed character count.
therefore naturally fit breadth-first routines like print Nevertheless, among these functions, LENGTH() is
scheduling.

Downloaded from www.mcqgpt.com


PRACTICE PAPER 07

explicitly designed to measure the size of a string in  Ans


bytes or characters. (C) Manages queue-based operations natively
A stack, operating Last-In-First-Out, is ideal for
34. Match each Python file mode (Column A) with its
expression parsing, function-call management, and
description (Column B):
conversions of notation. It efficiently stores operands
Column A Column B and operators. By contrast, queue operations require
1. r P. Write only, overwriting First-In-First-Out. Stack doesn’t handle queue-like
existing content insertion and removal from opposite ends, so (C) is not
2. w Q. Create exclusively, fail if an advantage of a stack in expression evaluation.
file exists 37. Which searching method splits the array in half
3. a R. Read-only mode repeatedly, requiring the dataset to be sorted first?
4. x S. Append at end, create if (A) Linear Search
needed (B) Binary Search
Options: (C) Depth-First Search
(A) 1→P, 2→R, 3→S, 4→Q (D) Hash Search
(B) 1→R, 2→P, 3→S, 4→Q  Ans
(C) 1→R, 2→S, 3→Q, 4→P (B) Binary Search
(D) 1→S, 2→P, 3→R, 4→Q Binary Search requires a sorted array. It compares
Ans the target against the middle element, discards one
(B) 1→R, 2→P, 3→S, 4→Q half of the array, and recurses on the remaining half.
Mode ‘r’ (1) opens a file for reading (R), ‘w’ (2) writes This significantly reduces the number of comparisons
and erases prior content if the file exists (P), ‘a’ (3) compared to linear search. If the dataset is unsorted,
appends new data at the file’s end (S), and ‘x’ (4) creates Binary Search fails or yields incorrect results.
a file but raises an error if the file already exists (Q). Each 38. Match each network concept (Column A) with its
handles unique scenarios. primary function (Column B):
35. Which MySQL function returns the remainder after Column A Column B
division? 1. Repeater P. Amplifies or
(A) POWER() regenerates signals
(B) MOD()
2. Hub Q. Broadcasts data to all
(C) ABS()
ports
(D) TRIM()
3. Switch R. Directs data within a
Ans single network segment
(B) MOD() 4. Router S. Chooses best path for
MOD(dividend, divisor) gives the remainder after an data between networks
integer division. For instance, MOD(17, 5) equals 2.
Options:
This helps perform tasks like distributing items evenly
(A) 1→Q, 2→P, 3→S, 4→R
or determining leftover quantities. POWER() computes
(B) 1→P, 2→Q, 3→R, 4→S
exponentiation, ABS() finds the absolute value, and
(C) 1→S, 2→R, 3→Q, 4→P
TRIM() handles string whitespace, so MOD() is
(D) 1→R, 2→S, 3→P, 4→Q
uniquely designed for remainder operations.
 Ans
36. Which of these is NOT an advantage of using a Stack for
(B) 1→P, 2→Q, 3→R, 4→S
expression evaluation?
A repeater (1) restores weak signals (P), a hub (2) sends
(A) Simplifies conversion of infix to postfix
incoming frames to all ports (Q), a switch (3) forwards
(B) Handles recursive function calls
data only to the intended recipient within a network (R),
(C) Manages queue-based operations natively
and a router (4) routes data across different networks
(D) Stores operands and operators temporarily

Downloaded from www.mcqgpt.com


page 72 CUET UG Computer Science

(S). Each device operates at distinct layers to manage availability. She also applies normal forms to minimize
traffic flow. anomalies. Through careful table design, Priya fosters
efficient data retrieval and maintains accurate records of
39. Which statements are true about DDL commands in borrowing activities. To ensure reliability, she occasionally
SQL? performs backup and recovery tests using MySQL utilities.
1. They create or modify table structures
2. They query data from tables 41. Which attribute ensures each book entry remains
3. They include CREATE, ALTER, DROP uniquely identifiable?
4. They handle transaction control like COMMIT (A) Foreign key
(A) 1 and 2 (B) Primary key
(B) 1 and 3 (C) INDEX
(C) 2 and 4 (D) CHECK constraint
(D) 1, 3, and 4  Ans
Ans (B) Primary key
(B) 1 and 3 A primary key uniquely tags each row, guaranteeing no
Data Definition Language (DDL) commands, such duplication across book records. In Priya’s books table,
as CREATE, ALTER, and DROP, define or modify book_id is the primary key, letting the system identify
database schema elements (1 and 3). Querying tables each entry independently. Unlike indexes or foreign
uses SELECT, a DQL command, and COMMIT belongs keys, the primary key enforces uniqueness by default
to transaction control statements (TCL). DDL changes and underpins reliable linking with other related tables.
structures, not the data itself, ensuring the integrity and
42. Why did Priya add indexes to certain columns, such as
layout of the database.
title?
40. Which measure describes how data varies around the (A) To create extra duplicates
mean? (B) To speed up searches
(A) Mean (C) To remove constraints
(B) Mode (D) To export data
(C) Standard Deviation  Ans
(D) Median
(B) To speed up searches
Ans Indexes function like reference maps, helping MySQL
(C) Standard Deviation locate rows swiftly by bypassing full-table scans. Since
Standard Deviation shows the average distance of title is frequently used in lookups, indexing that column
data points from the mean, reflecting how spread can dramatically improve query performance. Although
out or clustered they are. A large value indicates wide indexes consume storage space, their benefit lies in
variability, whereas a small value suggests the data is quicker data retrieval, especially in libraries where
tightly packed around the average. It’s a fundamental searching by title is common.
metric for analyzing dispersion in statistics.
43. Which type of constraint prevents empty entries for
Direction :Carefully read the case study provided and then critical fields like title?
thoroughly answer the subsequent five questions. (A) UNIQUE
Priya manages a small library database using MySQL. She (B) FOREIGN KEY
created separate tables for books, authors, and borrowers. (C) NOT NULL
The books table includes fields like book_id (primary (D) DEFAULT
key), title, and publication_date. By applying foreign  Ans
keys, she links each book to its author in the authors
table. Additionally, Priya sets NOT NULL and UNIQUE (C) NOT NULL
constraints to keep data consistent and avoid duplicates. NOT NULL disallows leaving essential columns
She uses indexes on frequently searched columns—like blank, ensuring that each book record includes a valid
title—to accelerate lookups. When borrowers check title. Empty or missing fields degrade data quality by
out books, Priya updates the records promptly to reflect hampering searches and leading to incomplete entries.
By enforcing NOT NULL, Priya secures meaningful

Downloaded from www.mcqgpt.com


PRACTICE PAPER 07

content in critical columns, sustaining consistent unifies robust file handling with efficient data structures.
recordkeeping and reliable database queries.
46. Why does Arun use try-except blocks in his file
44. What is the main advantage of enforcing normal forms operations?
in Priya’s schema? (A) To speed up CPU cycles
(A) Additional redundancy (B) To automatically fix data errors
(B) Simplified data anomalies (C) To handle runtime issues without halting the
(C) Less duplication and improved consistency program
(D) Random table structures (D) To overwrite existing files unconditionally
Ans  Ans
(C) Less duplication and improved consistency (C) To handle runtime issues without halting the
Normalization systematically organizes data into well- program
structured tables, minimizing repeated information and The try-except construct catches errors like missing
inconsistency. By decomposing large tables into focused files or read/write failures, preventing immediate
ones linked by keys, anomalies like update or insertion program termination. Arun’s application can then
errors are significantly reduced. Priya’s adherence to display meaningful messages or create new files if
normal forms thus maintains data integrity, making the needed. This approach protects user data from abrupt
schema cleaner and more manageable over time. crashes, ensuring stable operation and allowing graceful
handling of problems during file input/output routines.
45. Which best describes Priya’s reason for performing
backup and recovery tests? 47. Which data structure does Arun use to process
(A) To deliberately lose data subscription requests in order of arrival?
(B) To disregard data corruption (A) Stack
(C) To validate readiness for data loss events (B) Queue
(D) To slow down the database (C) Dictionary
Ans (D) Tree

(C) To validate readiness for data loss events  Ans


Regular backup and recovery drills confirm that Priya (B) Queue
can restore critical information if a hardware failure or Queues follow the FIFO principle: the first request
accidental deletion occurs. These tests validate whether that arrives is the first to be served. This fairness is
her restoration procedures work effectively. Without crucial for processing membership subscriptions, as
verification, backups could be incomplete or corrupted, no later request jumps ahead. By inserting at the rear
offering a false sense of security. Proper testing and removing from the front, Arun’s queue ensures a
safeguards the library’s precious records. predictable, orderly flow of incoming tasks.

Direction :Carefully read the case study provided and then 48. How do custom exceptions help Arun guide users to
thoroughly answer the subsequent five questions. correct file format errors?
Arun built a Python application to handle membership (A) By hiding all error details
data for a school’s sports club. He keeps personal details (B) By automatically deleting corrupted files
in text files, while subscription payments and renewal (C) By providing domain-specific error messages
logs are stored in binary files for quicker access. To (D) By preventing any code execution
prevent unexpected crashes, he employs try-except blocks  Ans
whenever reading or writing these files. If a file is missing,
the program automatically prompts the user to create it. (C) By providing domain-specific error messages
By using custom exceptions, Arun identifies specific file Custom exceptions let Arun separate general Python
format errors, guiding users to correct them. He also issues from membership-related format problems.
implemented a queue structure to track subscription When his program encounters malformed data, it raises
requests, ensuring the earliest applicant is processed first. a tailored exception that clearly describes the situation.
For advanced analysis, he occasionally stacks the most This specificity allows him to prompt users about
recent activities in memory for instant lookups. This setup corrective steps, such as reformatting the file, without
resorting to vague or generic error text.

Downloaded from www.mcqgpt.com


page 74 CUET UG Computer Science

49. Why might Arun store recent activities in a stack


structure?
(A) It efficiently processes FIFO tasks
(B) It reverses record order, losing old information
(C) It provides Last-In-First-Out access for quick
lookups
(D) It merges all data sets
Ans
(C) It provides Last-In-First-Out access for quick
lookups
A stack allows immediate handling of the most
recently added data, beneficial for checking the latest
membership updates or logs. Items pushed last are the
first retrieved, aiding swift reviews of current activities.
This complements the queue approach for older tasks,
ensuring both fresh and queued items remain well-
managed.

50. How does robust file handling contribute to Arun’s


application?
(A) It automatically fixes logical mistakes
(B) It corrupts data for testing
(C) It preserves data integrity during reads and writes
(D) It eliminates user input
Ans
(C) It preserves data integrity during reads and writes
Safe file handling methods reduce risks of partial saves
or accidental overwrites. By carefully opening, reading,
writing, and closing files, Arun prevents data corruption.
Combined with appropriate exception handling,
this approach fosters a dependable system that can
handle unexpected conditions without discarding or
compromising critical membership and payment data.

 **************

Downloaded from www.mcqgpt.com


PRACTICE PAPER 08

PRACTICE PAPER 08

1. Which key in a relational table can reference the primary failing the specified criterion. In contrast, WHERE
key of another table? filters individual rows before grouping happens. Thus,
(A) Alternate Key if you want to refine which sums or counts are included,
(B) Foreign Key you attach conditions in HAVING instead of WHERE.
(C) Candidate Key
4. Which network topology provides redundant paths at
(D) Composite Key
the cost of more cabling and complexity?
Ans (A) Star
(B) Foreign Key (B) Bus
A foreign key enforces referential integrity by linking (C) Mesh
one table’s column to another table’s primary key. This (D) Ring
relationship ensures valid references across tables,  Ans
preventing orphaned records. Unlike alternate or
candidate keys, foreign keys specifically connect distinct (C) Mesh
relations, allowing data consistency and meaningful In a mesh topology, each node can connect to multiple
cross-referencing within the database’s relational other nodes, yielding redundant communication routes
framework. that enhance reliability. If one path fails, traffic can be
rerouted through alternate links. The primary drawback
2. Which SQL command permanently deletes both the is higher cabling demands and network complexity,
table data and its structure? which often suits specialized or critical environments
(A) DELETE needing robust fault tolerance.
(B) DROP TABLE
5. Which is NOT a valid Python exception category?
(C) TRUNCATE
(D) UPDATE (A) ValueError
(B) OSError
Ans (C) KeyError
(B) DROP TABLE (D) FormatError
DROP TABLE eliminates the table entirely, including its  Ans
data and definition. TRUNCATE only clears data while
preserving structure, and DELETE removes rows but (D) FormatError
leaves both structure and constraints. DROP TABLE Python includes ValueError for improper values,
is thus the most drastic removal method, effectively OSError for operating system problems like file
discarding all associated objects like indexes or triggers handling, and KeyError for missing dictionary entries.
linked to that table. However, there is no built-in FormatError exception.
Developers usually raise ValueError or TypeError
3. In MySQL, which clause filters groups after aggregation? for formatting issues. Understanding actual built-in
(A) WHERE exceptions helps produce clearer error messages and
(B) SELECT catch specific problems effectively.
(C) HAVING
6. Arrange the steps for popping an element from a stack:
(D) ORDER BY
1. Check if stack is empty
Ans 2. Retrieve the top element
(C) HAVING 3. Decrement the top pointer
The HAVING clause applies a condition to aggregated 4. Return the removed element
groups formed by GROUP BY, discarding entire groups (A) 4,3,2,1

Downloaded from www.mcqgpt.com


page 76 CUET UG Computer Science

(B) 1,2,3,4  Ans


(C) 1,2,4,3 (B) Selection Sort
(D) 1,3,2,4 Selection Sort locates the minimum element in each
Ans pass and swaps it into its correct position at the start. The
algorithm then continues with the rest of the unsorted
(B) 1,2,3,4
array. It requires fewer swaps than Bubble Sort, but its
First, verify the stack isn’t empty (1). Next, access the
overall time complexity remains O(n²), making it slower
top element (2). Then move the top pointer down one
for large data sets.
position (3). Finally, return the removed element (4) as
the result of the pop operation. This sequence ensures no 10. Which measure describes how spread out data points
invalid removals and preserves correct stack behavior. are from the mean?
(A) Mean
7. Assertion (A) : A queue removes data from its front.
(B) Mode
Reason (R) : Queues follow Last-In-First-Out ordering.
(C) Standard Deviation
(A) Both A and R are true, and R is the correct
(D) Median
explanation.
(B) Both A and R are true, but R is not the correct  Ans
explanation. (C) Standard Deviation
(C) A is true, R is false. Standard Deviation calculates the average distance of
(D) A is false, R is true. each data point from the mean. A larger value indicates
Ans a broader spread, whereas a smaller figure means data
is tightly packed. Unlike mean, mode, or median, this
(C) A is true, R is false
measure explicitly tracks data dispersion, highlighting
A queue operates on a First-In-First-Out principle,
how varied or clustered the dataset is overall.
meaning removal is from the front. The assertion is
correct because the front is where elements exit. The 11. Match the SQL components in Column A with their
reason is false because FIFO, not LIFO, governs queue functions in Column B:
order. Hence, although the queue does remove from the
front, it does not follow LIFO. Column A Column B
1. ALTER TABLE P. Removes table definition
8. Which data structure typically offers O(log n) search and data
time if balanced? 2. INSERT Q. Modifies table structure
(A) Array
3. SELECT R. Retrieves data from
(B) Binary Search Tree
database
(C) Linked List
(D) Queue 4. DROP TABLE S. Adds new rows into a
table
Ans
Options:
(B) Binary Search Tree (A) 1→Q, 2→S, 3→R, 4→P
A balanced binary search tree—like an AVL or Red- (B) 1→S, 2→P, 3→Q, 4→R
Black Tree—maintains O(log n) search time by keeping (C) 1→R, 2→S, 3→Q, 4→P
the tree height minimized. This arrangement halves the (D) 1→P, 2→Q, 3→S, 4→R
search space at each comparison. Arrays and linked
 Ans
lists suffer linear searches in the worst case, while
queues revolve around FIFO operations rather than fast (A) 1→Q, 2→S, 3→R, 4→P
lookups. ALTER TABLE (1) changes a table’s structure (Q),
INSERT (2) adds new records (S), SELECT (3) extracts
9. Which sorting method repeatedly finds the smallest data (R), and DROP TABLE (4) deletes both structure
element and places it at the beginning of the list? and contents (P). Each command targets a different
(A) Bubble Sort aspect of database management, ranging from structural
(B) Selection Sort modifications to row insertion and data retrieval or
(C) Insertion Sort removal.
(D) Quick Sort

Downloaded from www.mcqgpt.com


PRACTICE PAPER 08

12. Which statements are true about Python’s open() 15. Which data structure is best for implementing a call
function? stack in most programming languages?
1. It can open files in read or write mode (A) Queue
2. It automatically closes files (B) Stack
3. It supports text and binary modes (C) Circular Linked List
4. It raises an exception if the file fails to open (D) Binary Search Tree
(A) 1, 2, and 3  Ans
(B) 1, 3, and 4
(C) 2, 3, and 4 (B) Stack
(D) 1, 2, and 4 Function calls follow Last-In-First-Out semantics. The
most recently called function is the first to complete
Ans and return. This ordering naturally suits stack behavior,
(B) 1, 3, and 4 pushing call frames onto the top and popping them after
Python’s open() can open files in read or write mode execution. Queues do not respect this LIFO mechanism,
(1), supports text (default) and binary modes (3), and and trees or linked lists lack direct LIFO enforcement.
raises exceptions if it cannot access the file (4). However,
16. Which MySQL clause arranges query results in
it does not auto-close files unless used with a context
manager (with statement). Hence, statement 2 is not ascending or descending order?
inherently correct. (A) WHERE
(B) ORDER BY
13. Which notation describes the upper bound of an (C) GROUP BY
algorithm’s running time? (D) HAVING
(A) Ω (Omega) notation  Ans
(B) Big-O notation
(C) Big-Theta notation (B) ORDER BY
(D) Asymptotic difference ORDER BY sorts the result set in ascending (ASC)
or descending (DESC) order based on one or more
Ans columns. It’s typically appended at the end of the
(B) Big-O notation SELECT statement. GROUP BY arranges rows by
Big-O notation focuses on worst-case scenarios, groups, HAVING filters those groups, and WHERE
illustrating how runtime or space consumption scales screens individual rows before grouping or ordering
with input size. For instance, O(n²) denotes that runtime occurs.
grows proportionally to the square of n. Ω covers lower
17. Match each network type (Column A) with its typical
bounds, while Θ covers tight bounds. Big-O remains
the standard for expressing upper-limit performance scope (Column B):
constraints. Column A Column B
14. Which device splits a network into separate collision 1. LAN P. Covers large geographic
domains but not necessarily into separate networks? areas, connecting multiple
(A) Repeater cities or countries
(B) Hub 2. WAN Q. Connects devices in a
(C) Switch small, personal range (e.g.,
(D) Router Bluetooth)
Ans 3. MAN R. Spans a city or metropolitan
area
(C) Switch
4. PAN S. Covers a limited area like a
A switch operates at the Data Link layer (Layer 2) and
home, office, or campus
segments the network into distinct collision domains,
reducing data collisions. However, it does not inherently Options:
separate broadcast domains. Routers (Layer 3) divide (A) 1→P, 2→S, 3→Q, 4→R
networks at the IP level. Hubs amplify collisions, and (B) 1→S, 2→P, 3→R, 4→Q
repeaters merely boost signals without domain isolation. (C) 1→Q, 2→R, 3→S, 4→P

Downloaded from www.mcqgpt.com


page 78 CUET UG Computer Science

(D) 1→R, 2→Q, 3→P, 4→S  Ans

Ans (A) OverflowError


OverflowError emerges when numeric computations
(B) 1→S, 2→P, 3→R, 4→Q
exceed the representable range of floating-point
A Local Area Network (LAN) (1) covers a small area
numbers. For instance, raising a large number to an
(S), a Wide Area Network (WAN) (2) extends over vast
extreme exponent can trigger an overflow in Python.
regions or nations (P), a Metropolitan Area Network
This differs from ZeroDivisionError (divide by zero),
(MAN) (3) spans a city (R), and a Personal Area
TypeError (wrong data type), or MemoryError
Network (PAN) (4) revolves around a very close range
(inadequate memory), each addressing unique failure
like Bluetooth (Q).
conditions.
18. Which data structure is more suitable for inserting and
21. Arrange the steps in performing a binary search on a
deleting at arbitrary positions without shifting elements?
sorted array:
(A) Array
1. Compare target with middle element
(B) Linked List
2. If target is smaller, search left subarray
(C) Stack
3. If target is larger, search right subarray
(D) Queue
4. Repeat on subarray until found or range is empty
Ans (A) 2,3,1,4
(B) Linked List (B) 1,2,3,4
Linked lists store each element as a node that points to (C) 1,3,2,4
the next, letting you insert or remove nodes by adjusting (D) 2,1,3,4
references instead of shifting entire segments in  Ans
memory. Arrays require moving elements to maintain
(B) 1,2,3,4
continuity, which can be costly. Linked lists thus excel at
Begin by comparing the target to the mid element (1).
frequent inserts in arbitrary positions.
If the target is less, narrow the search to the left portion
19. Assertion (A) : In Python, KeyError arises if you access (2). If greater, the right subarray is chosen (3). Then
a non-existent key in a dictionary. repeat this halving strategy (4). This ordered approach
Reason (R) : IndexError and KeyError are the same systematically reduces the problem size, enabling O(log
exception class. n) efficiency.
(A) Both A and R are true, and R is the correct
22. Match each built-in function (Column A) with its
explanation.
MySQL category (Column B):
(B) Both A and R are true, but R is not the correct
explanation. Column A Column B
(C) A is true, R is false. 1. ROUND() P. Text function
(D) A is false, R is true. 2. COUNT() Q. Date function
Ans 3. MID() R. Math function
(C) A is true, R is false 4. DAY() S. Aggregate function
KeyError indeed occurs when a requested dictionary Options:
key isn’t found. IndexError arises when a list or array (A) 1→P, 2→R, 3→S, 4→Q
index is out of bounds. Although both signal invalid (B) 1→R, 2→S, 3→P, 4→Q
lookups, they are distinct exception classes. Hence, the (C) 1→Q, 2→P, 3→R, 4→S
assertion stands correct, whereas the reason incorrectly (D) 1→S, 2→P, 3→Q, 4→R
lumps them into one exception type.
 Ans
20. Which Python error appears when a floating-point (B) 1→R, 2→S, 3→P, 4→Q
operation produces a magnitude too large to handle? ROUND() (1) is a math function (R) that adjusts
(A) OverflowError decimal places. COUNT() (2) is an aggregate (S) tallies
(B) ZeroDivisionError rows. MID() (3), also called SUBSTR or SUBSTRING, is
(C) TypeError
(D) MemoryError

Downloaded from www.mcqgpt.com


PRACTICE PAPER 08

a text function (P), extracting a substring. DAY() (4) is a JOIN or SELECT operation. Therefore, (1), (3), and (4)
date function (Q) that returns the day portion of a date. define PROJECTION accurately.

23. Which search method is simpler but less efficient for 26. Which function returns the month name from a date in
large, unsorted data sets? MySQL?
(A) Binary Search (A) MONTH()
(B) Linear Search (B) MONTHNAME()
(C) Depth-First Search (C) DAYNAME()
(D) Interpolation Search (D) YEAR()
Ans  Ans
(B) Linear Search (B) MONTHNAME()
Linear search compares each element in turn until MONTHNAME() extracts the textual month name
it finds a match or exhausts the list. Though easy to (e.g., ‘March’) from a date field. By contrast, MONTH()
implement and requiring no sorting, it grows more yields a numeric value (3 for March), DAYNAME()
time-consuming for large data sets. Techniques like returns the weekday name, and YEAR() gives the four-
binary or interpolation search can be far faster when the digit year. MONTHNAME() is particularly helpful
collection is structured or sorted. for generating user-friendly reports, labels, or logs
requiring readable month designations.
24. Which data structure naturally implements recursion
call frames in most programming languages? 27. Which topology links all devices to a single central
(A) Queue cable?
(B) Stack (A) Bus
(C) Tree (B) Star
(D) Heap (C) Mesh
Ans (D) Tree

(B) Stack  Ans


Function calls push new call frames onto the call stack, (A) Bus
storing return addresses and local variables. When A bus topology relies on a single backbone cable shared
the function completes, its frame pops, resuming the by every node. Data collisions can occur if multiple
previous context. This Last-In-First-Out behavior devices transmit simultaneously, so techniques like
matches recursion precisely, making stack usage integral CSMA/CD are used to manage traffic. Although easy to
to function calling, returning, and nested invocation set up, bus networks lack redundancy and are vulnerable
patterns across common programming languages. to cable faults disrupting the entire layout.

25. Which statements accurately describe relational 28. Which is NOT a property of Selection Sort?
algebra’s PROJECTION operation? (A) Finds minimum and places it at sorted region’s end
1. It selects certain columns of a relation (B) Performs fewer swaps than Bubble Sort
2. It merges rows based on conditions (C) Has an O(n²) time complexity
3. It is denoted by the Greek letter π (D) Suitable for small datasets, but slower for large ones
4. It is a unary operation  Ans
(A) 1, 2, and 3
(B) 1, 3, and 4 (A) Finds minimum and places it at sorted region’s end
(C) 2, 3, and 4 Selection Sort repeatedly locates the smallest element in
(D) 1 and 2 only the unsorted portion and moves it to the sorted portion’s
beginning, not the end. It does feature fewer total swaps
Ans than Bubble Sort, though it remains O(n²). Hence, (A)
(B) 1, 3, and 4 is incorrect, because the minimal element is placed at
PROJECTION picks specific attributes (columns) from the start of the sorted segment.
a relation (statement 1) and is written symbolically as
29. Assertion (A) : Grouping data by columns in MySQL
π (3). It operates on one relation (4), making it unary.
Merging rows based on a condition (2) is more akin to a uses GROUP BY.

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


page 80 CUET UG Computer Science

Reason (R) : ORDER BY sorts rows in ascending or incorrect). The finally clause (3) executes whether or
descending order by default. not an exception arises, ensuring cleanup code runs.
(A) Both A and R are true, and R is the correct Custom exceptions can be raised (4), and else (5) runs
explanation. exclusively if the try block produces no errors. Hence,
(B) Both A and R are true, but R is not the correct (1), (3), (4), (5) are correct.
explanation.
32. Which function in MySQL counts the number of rows
(C) A is true, R is false.
(D) A is false, R is true. returned by a query?
(A) SUM()
Ans (B) COUNT()
(B) Both A and R are true, but R is not the correct (C) MAX()
explanation (D) LENGTH()
GROUP BY clusters rows based on shared column  Ans
values, while ORDER BY arranges rows by specified
columns. Although both statements are accurate, (B) COUNT()
sorting data doesn’t explain grouping’s purpose, which COUNT() returns how many rows match a particular
is to produce aggregates per group. Thus, (B) applies: query condition. For instance, COUNT(*) tallies all
both are correct, but the reason does not explain the rows, whereas COUNT(column_name) omits NULL
assertion. entries in that column. SUM() aggregates numeric
values, MAX() finds the highest value, and LENGTH()
30. Which data structure is more appropriate for a printer measures string size, so COUNT() alone totals the
queue scenario? number of resulting rows.
(A) Stack
33. Which function in MySQL converts all letters of a given
(B) Queue
(C) Linked List string to uppercase?
(D) Heap (A) LCASE()
(B) UCASE()
Ans (C) MID()
(B) Queue (D) RTRIM()
Printers process jobs in the order they arrive, removing  Ans
the earliest submitted document first. A queue’s First-
In-First-Out paradigm naturally matches this approach. (B) UCASE()
By contrast, a stack retrieves the last item placed on top, UCASE(), also available as UPPER(), transforms
reversing the submission sequence. Hence, a queue best each character in a string to uppercase. For instance,
simulates a real-world printer job scheduling workflow. UCASE(‘abc’) yields ‘ABC’. LCASE() or LOWER() does
the inverse, MID() extracts substrings, and RTRIM()
31. Which statements about Python’s exception handling removes trailing whitespace. UCASE() helps normalize
are correct? text data for consistent comparisons or display in many
1. It uses try-except blocks database applications.
2. The except block only catches FileNotFoundError
34. Match each Python file handling method (Column A)
3. finally executes regardless of exceptions
4. Custom exceptions can be raised with its description (Column B):
5. else runs if no exception occurs Column A Column B
(A) 1, 3, 4, and 5 1. close() P. Writes a string to the
(B) 1, 2, 3, and 5 file
(C) 2, 4, and 5 only
2. readline() Q. Moves the file pointer
(D) 1, 2, and 4 only
to a specified position
Ans 3. write() R. Reads a single line from
(A) 1, 3, 4, and 5 the file
Python’s try-except blocks (1) capture various 4. seek() S. Terminates the file
exceptions, not just FileNotFoundError (making 2 interface

Downloaded from www.mcqgpt.com


PRACTICE PAPER 08

Options: (D) Exponential Search


(A) 1→P, 2→S, 3→Q, 4→R  Ans
(B) 1→S, 2→R, 3→P, 4→Q
(C) 1→R, 2→Q, 3→S, 4→P (B) Binary Search
(D) 1→Q, 2→P, 3→R, 4→S Binary Search requires sorted data, comparing the
target to the midpoint and discarding half of the array
Ans each time. This yields O(log n) performance. Linear
(B) 1→S, 2→R, 3→P, 4→Q search, in contrast, checks items sequentially; jump and
close() (1) closes the file interface (S), readline() (2) exponential searches also rely on sorted data but use
fetches one line of text (R), write() (3) appends string different partitioning strategies than simple halving.
data into the file (P), and seek() (4) repositions the file
38. Match each network device (Column A) with its
pointer (Q). Each action supports critical aspects of file
manipulation, from reading sequentially to altering the function (Column B):
current access point. Column A Column B
35. Which MySQL function returns the highest value in a 1. Router P. Translates digital
specified column? signals to analog and
(A) MIN() vice versa
(B) AVG() 2. Modem Q. Forwards data only to
(C) MAX() intended devices within
(D) COUNT() a LAN
Ans 3. Switch R. Interconnects networks
using different
(C) MAX() protocols
MAX() scans a column’s values and identifies the largest
4. Gateway S. Directs data packets
entry, while MIN() does the opposite. AVG() computes
based on IP addresses
the arithmetic mean, and COUNT() tallies rows or
non-null field occurrences. MAX() is particularly useful Options:
in queries requiring the most recent date, the greatest (A) 1→Q, 2→S, 3→P, 4→R
numeric figure, or top ranking in a set. (B) 1→S, 2→P, 3→Q, 4→R
(C) 1→R, 2→Q, 3→S, 4→P
36. Which attribute is NOT part of a queue’s primary (D) 1→P, 2→R, 3→Q, 4→S
operations?
 Ans
(A) ENQUEUE
(B) DEQUEUE (B) 1→S, 2→P, 3→Q, 4→R
(C) FRONT retrieval A router (1) routes data using IP addresses (S). A modem
(D) PEEK stack top (2) modulates and demodulates signals (P). A switch (3)
selectively forwards frames within a local network (Q).
Ans
A gateway (4) bridges networks operating on different
(D) PEEK stack top protocols (R). Each device addresses unique aspects of
A queue’s fundamental methods include ENQUEUE network connectivity and data transport.
(insertion at rear), DEQUEUE (removal from front),
and optionally checking the FRONT element. PEEK 39. Which statements about DML (Data Manipulation
stack top references stack-specific terminology, which is Language) commands are true?
LIFO. A queue retrieves the front element, not the top, 1. They modify data within tables
differentiating it from the stack approach of pushing 2. They create or drop tables
and popping at a top pointer. 3. They include INSERT, UPDATE, and DELETE
4. They handle transaction logic (COMMIT,
37. Which search method demands a sorted collection and ROLLBACK)
eliminates half the data space each iteration? (A) 1 and 3
(A) Linear Search (B) 2 and 4
(B) Binary Search (C) 1, 3, and 4
(C) Jump Search

Downloaded from www.mcqgpt.com


page 82 CUET UG Computer Science

(D) 2 and 3 only  Ans

Ans (B) Primary key


A primary key uniquely labels each record, preventing
(A) 1 and 3
duplicates. In Sneha’s items table, item_id fulfills this
DML commands (INSERT, UPDATE, DELETE) change
role, enabling reliable identification. Unlike an index
data stored in existing tables (1, 3). Creating or dropping
(which boosts searches) or a supplier key (which ties the
tables (2) belongs to DDL. Transaction statements like
item to a vendor), the primary key anchors the entire
COMMIT or ROLLBACK (4) are part of TCL. DML
record, guaranteeing uniqueness throughout the table.
focuses on row-level manipulations without altering
the structure, so (1) and (3) correctly define DML 42. Why does Sneha apply indexing on product names and
functionality. categories?
(A) To automatically delete old records
40. Which statistical measure indicates the middle value in
(B) To accelerate data lookups
an ordered dataset?
(C) To remove the need for primary keys
(A) Mean
(D) To hide columns from queries
(B) Median
(C) Mode  Ans
(D) Variance (B) To accelerate data lookups
Ans By creating indexes on frequently queried columns,
MySQL locates matching rows faster and avoids
(B) Median
scanning the entire table each time. Sneha’s store
The median splits sorted data such that half the
regularly searches products by name or category, so
observations lie above it and half below. Unlike the
indexes help expedite these operations. While indexes
mean, it remains relatively stable against outliers, and
demand extra storage, their performance benefit is
unlike the mode, it represents central tendency through
especially significant under constant lookups.
positional rank. Variance gauges spread, leaving the
median as the best single middle-value indicator. 43. Which clause filters aggregated results when Sneha
groups inventory items by category?
Direction :Carefully read the case study provided and then
(A) WHERE
thoroughly answer the subsequent five questions.
(B) HAVING
Sneha maintains a MySQL database to track inventory
(C) ORDER BY
in her family’s convenience store. She uses multiple
(D) SELECT
tables: items, suppliers, and orders. Each item has a
unique item_id as the primary key. Suppliers are linked  Ans
through foreign keys in the items table, ensuring correct (B) HAVING
vendor relationships. Sneha applies indexing on product HAVING refines results after GROUP BY, discarding
names and categories for swift searching, given frequent any groups that fail a specified aggregate condition. For
lookups. She also uses WHERE and GROUP BY clauses example, GROUP BY category HAVING COUNT(*)
to analyze stock by category, occasionally filtering results < 10 isolates categories with fewer than ten items. In
with HAVING for aggregated counts. Whenever orders contrast, WHERE screens rows before they’re grouped,
are placed, the orders table logs each transaction date, and ORDER BY sorts final output without eliminating
item_id, and supplier reference. To secure her data, she grouped data.
schedules regular backups and sets user permissions. With
these practices, Sneha quickly identifies low-stock items 44. What is the purpose of linking suppliers in the items
and coordinates timely restocking. table via a foreign key?
(A) To duplicate item data
41. Which key ensures each item remains distinctly (B) To ensure each item references a valid supplier
identified in Sneha’s items table? (C) To override user permissions
(A) Supplier key (D) To discard invalid entries automatically
(B) Primary key
 Ans
(C) Index key
(D) Composite key (B) To ensure each item references a valid supplier

Downloaded from www.mcqgpt.com


PRACTICE PAPER 08

A foreign key enforces referential integrity by By wrapping file operations in a try-except block, Karan
compelling the items table to map valid supplier intercepts FileNotFoundError. If the requested file is
identifiers. If a supplier row is removed, the database absent, his program notifies the user and can create
prevents orphaned items unless explicitly configured or redirect to the correct file. This proactive handling
for cascading. This design preserves correctness, maintains application stability, avoiding abrupt
guaranteeing any supplier_id in the items table matches termination and improving overall user experience
an existing, legitimate supplier record. when dealing with unexpected file paths.

45. Why does Sneha schedule regular backups of her 47. Which structure is ideal for retrieving the most recently
database? modified registration entry first?
(A) To intentionally corrupt data (A) Queue
(B) To reduce storage usage (B) Stack
(C) To restore information in case of losses (C) Linked List
(D) To eliminate transaction logs (D) Dictionary
Ans  Ans
(C) To restore information in case of losses (B) Stack
Scheduled backups protect against unexpected data A stack implements Last-In-First-Out access, which is
loss from hardware failures, software bugs, or user perfect for reversing recent changes promptly. Pushing
mistakes. By keeping current copies of her inventory new modifications onto the stack lets Karan pop them
records, Sneha can recover quickly, preserving her to undo the latest entry first. Queues enforce FIFO,
store’s transactional history and supplier information. so they’re unsuitable for immediate rollback tasks,
Without backups, accidental deletions or crashes could whereas a stack efficiently tracks and reverts recent
irreversibly destroy critical data on stock or orders. modifications.

Direction :Carefully read the case study provided and then 48. Why does Karan employ a queue for older records?
thoroughly answer the subsequent five questions. (A) It deletes data in reverse order
Karan programmed a Python tool to handle event (B) It sorts records alphabetically
registrations for a college festival. He stores participant (C) It processes them on a first-come, first-served basis
details, including names and contact numbers, in text (D) It combines multiple file operations automatically
files. For high-volume data—such as transaction logs—  Ans
he uses binary files to boost read-write efficiency. When
reading files, Karan applies try-except blocks to catch (C) It processes them on a first-come, first-served basis
FileNotFoundError and prompts users to either create A queue follows FIFO logic, ensuring the earliest
or locate the missing file. Additionally, he uses a stack to record is handled first. Karan wants older registration
manage recently modified registration entries for quick data to be processed in the order it arrived, so a queue
rollback if an error arises. For older registration records is the natural choice. This setup preserves fairness and
that must be processed in the order received, Karan relies sequence, particularly for structured tasks like archiving
on a queue. By pairing robust file handling with suitable or scheduled event confirmations.
data structures, the application prevents data corruption, 49. How do binary files enhance handling of large log data
streamlines user input, and makes real-time editing or in Karan’s application?
retrieval possible. (A) They convert data to plain text
46. How does Karan safeguard against a missing file (B) They provide slower access times
scenario? (C) They store and read data more efficiently
(A) He ignores the error (D) They remove the need for user input
(B) He forces the program to crash  Ans
(C) He catches FileNotFoundError using try-except (C) They store and read data more efficiently
(D) He disables file creation Binary files represent data in a compact, machine-
Ans friendly format, cutting down on overhead from text
(C) He catches FileNotFoundError using try-except encoding or parsing. For extensive logs, this format
can accelerate input/output operations, especially when

Downloaded from www.mcqgpt.com


page 84 CUET UG Computer Science

precise structure is already known. Karan’s choice


reduces latency, improves memory usage, and simplifies
writing large volumes of event transactions.

50. What primary advantage does robust file handling bring


to Karan’s tool?
(A) It deliberately omits error checks
(B) It reduces the code’s clarity
(C) It prevents data corruption and manages
unexpected conditions
(D) It always writes all data in plain text
 Ans
(C) It prevents data corruption and manages unexpected
conditions
Comprehensive file handling practices—like using try-
except and validating file paths—shield the application
from abrupt terminations, partial writes, or random
data losses. This boosts overall integrity, letting Karan
safely manage complex operations (like large logs and
rollbacks). Proper handling ensures stable functionality,
even under heavy loads or user mistakes.

 **************

Downloaded from www.mcqgpt.com


PRACTICE PAPER 09

PRACTICE PAPER 09

1. Which key in a relational database uniquely identifies (B) A database system provides better data consistency
each row in a table? (A) Foreign key and integrity than a file system
(B) Candidate key Unlike traditional file systems, database systems
(C) Primary key maintain robust mechanisms to ensure consistency,
(D) Alternate key reduce redundancy, and enforce integrity constraints.
Ans They organize data in relational structures and use
concurrency controls, providing more reliable data
(C) Primary key handling. These features strengthen overall reliability
A primary key is selected from candidate keys to and data correctness compared to simple file-based
uniquely identify each record in a relation. It prevents storage.
duplicate entries and ensures every row is identifiable.
This maintains data integrity by guaranteeing that no 4. Which SQL command does NOT belong to the Data
two rows have the same primary key value, making each Manipulation Language (DML) category? (A) INSERT
row unique in the table. (B) UPDATE
(C) DELETE
2. In a relational model, which of the following is NOT (D) CREATE
considered a valid operation of relational algebra? (A)
Selection  Ans
(B) Intersection (D) CREATE
(C) Projection DML commands include INSERT, UPDATE, and
(D) Encryption DELETE, which change or query the data within tables.
Ans CREATE belongs to the Data Definition Language
(DDL) group, which structures database schemas and
(D) Encryption objects. DDL commands define or modify the structure
Relational algebra includes operations such as selection, of the database rather than manipulating table contents.
projection, union, set difference, intersection, and
Cartesian product. Encryption, while crucial for data 5. Match the following MySQL data types with their
security, is not part of the fundamental relational descriptions:
algebra operations. It is a separate process for securing
Column A Column B
data rather than manipulating or querying relational
data sets. 1. INT a. Stores large textual data
2. VARCHAR b. Stores numeric integers
3. Which statement best explains the difference between 3. DATE c. Stores variable-length strings
a database system and a file system? (A) A file system
4. TEXT d. Stores calendar values
supports multiple users simultaneously, whereas a
database system cannot Options:
(B) A database system provides better data consistency (A) 1-b, 2-c, 3-a, 4-d
and integrity than a file system (B) 1-b, 2-c, 3-d, 4-a
(C) A file system avoids redundant data completely, but (C) 1-d, 2-a, 3-b, 4-c
a database system does not (D) 1-c, 2-d, 3-a, 4-b
(D) A database system lacks concurrency, unlike a file  Ans
system
(B) 1-b, 2-c, 3-d, 4-a
Ans In MySQL, INT is for integer storage, VARCHAR is for
variable-length strings, DATE is for storing date values,

Downloaded from www.mcqgpt.com


page 86 CUET UG Computer Science

and TEXT is for large text fields. This classification helps Column A Column B
ensure the correct data type is applied to each column
1. Union a. Rows in Table1 not in
and supports data integrity.
Table2
6. Match each SQL clause with its purpose: 2. Intersection b. All rows common to
Table1 and Table2
Column A Column B
3. Set Difference c. Combines rows
1. GROUP BY a. Sorts the result
from both without
2. HAVING b. Filters aggregate results duplication
3. ORDER BY c. Groups rows based on shared 4. Cartesian Product d. Pairs each row of
values Table1 with each row
4. WHERE d. Filters individual rows of Table2
Options: Options:
(A) 1-c, 2-b, 3-a, 4-d (A) 1-c, 2-b, 3-a, 4-d
(B) 1-a, 2-d, 3-c, 4-b (B) 1-d, 2-a, 3-b, 4-c
(C) 1-b, 2-c, 3-d, 4-a (C) 1-b, 2-a, 3-d, 4-c
(D) 1-d, 2-c, 3-a, 4-b (D) 1-c, 2-d, 3-a, 4-b
Ans  Ans
(A) 1-c, 2-b, 3-a, 4-d (A) 1-c, 2-b, 3-a, 4-d
GROUP BY consolidates rows with the same values, Union merges rows while removing duplicates,
HAVING filters aggregates, ORDER BY sorts output, Intersection keeps only rows common to both tables, Set
and WHERE filters individual rows. This logical Difference takes rows in one table but not the other, and
sequence allows more refined queries, ensuring accurate Cartesian Product pairs each row of the first table with
aggregated metrics and properly ordered final output, all rows of the second.
fulfilling diverse data analysis requirements.
9. Match the following SQL functions with the correct
7. Match the following aggregate functions with their category:
correct descriptions:
Column A Column B
Column A Column B 1. POWER(x,y) a. Date function
1. COUNT() a. Returns the highest value 2. LCASE(str) b. Mathematical function
2. AVG() b. Returns the lowest value 3. NOW() c. Text function
3. MAX() c. Returns total number of rows 4. MID(str, n, m) d. Text function
4. MIN() d. Returns mean of numeric
Options:
values
(A) 1-b, 2-c, 3-a, 4-d
Options: (B) 1-c, 2-b, 3-d, 4-a
(A) 1-a, 2-b, 3-c, 4-d (C) 1-a, 2-d, 3-b, 4-c
(B) 1-c, 2-d, 3-a, 4-b (D) 1-b, 2-a, 3-c, 4-d
(C) 1-c, 2-b, 3-d, 4-a
 Ans
(D) 1-d, 2-c, 3-b, 4-a
(A) 1-b, 2-c, 3-a, 4-d
Ans
POWER(x,y) is math-related, LCASE(str) is text-
(B) 1-c, 2-d, 3-a, 4-b based, NOW() is a date/time function returning the
COUNT() calculates the total row count, AVG() current timestamp, and MID(str, n, m) is also a text-
calculates the mean for numeric columns, MAX() finds manipulation function extracting a substring. Accurate
the largest value, and MIN() retrieves the smallest. classification ensures correct function usage and avoids
These aggregate functions simplify data summarization query errors.
and support deeper insight into the stored information.
10. Which statements about JOIN in SQL are correct?
8. Match each relational operation to its example outcome: 1. A JOIN combines rows from two or more tables.

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


PRACTICE PAPER 09

2. INNER JOIN returns rows when there is at least In Bus topology, all devices share one backbone cable,
one match. while Mesh topology links every node with every other
3. LEFT JOIN returns matching rows and all rows node. A Star topology has a central hub, and a Ring
from the left table. topology arranges nodes in a loop, not with a central
4. CROSS JOIN duplicates rows based on matching hub.
columns only.
13. Which statements are correct about IP addresses?
(A) 1 and 4
(B) 1, 2, and 3 1. They uniquely identify devices on a network.
(C) 2 and 4 2. They are identical to MAC addresses.
(D) 2, 3, and 4 3. IPv4 uses 32-bit addresses.
4. IPv6 uses 128-bit addresses.
Ans (A) 1 and 3
(B) 1, 2, and 3 (B) 2 and 4
JOIN merges rows across tables based on matching (C) 1, 3, and 4
conditions. INNER JOIN needs at least one common (D) 2, 3, and 4
match, while LEFT JOIN includes all left-table rows  Ans
plus matching right-table rows. CROSS JOIN produces
a Cartesian product, not just matched rows. (C) 1, 3, and 4
IP addresses serve as unique identifiers for network
11. Which statements about computer networks are TRUE? devices. IPv4 employs 32 bits, while IPv6 employs 128
1. A WAN covers a small geographic area. bits. MAC addresses, in contrast, are hardware-bound
2. A LAN usually covers a confined site. and differ from IP addresses, which are logical network
3. A MAN spans a large city or metropolitan area. identifiers.
4. LAN, MAN, WAN are the only existing network
14. Which statements about the Internet and the Web are
types.
(A) 1 and 2 TRUE?
(B) 2 and 3 1. The Web is a collection of interconnected
(C) 1, 2, and 3 documents and resources.
(D) 2, 3, and 4 2. The Internet only consists of Web pages.
3. The Internet is the underlying global network
Ans infrastructure.
(B) 2 and 3 4. The Web is essentially the same as the Internet.
A LAN typically serves a small, localized area, and a (A) 1 and 3
MAN extends across a metropolitan region. A WAN (B) 2 and 3
may span countries or continents. There are also other (C) 2 and 4
network classifications, so stating only LAN, MAN, and (D) 1, 3, and 4
WAN exist is incomplete.  Ans
12. Regarding topologies, identify the correct statements: (A) 1 and 3
1. A Bus topology has a single cable for all nodes. The Internet is a vast global network that supports a
2. A Star topology places all nodes in a ring. variety of services. The Web is one service on top of
3. A Mesh topology connects every node with every that network, comprising interlinked digital resources.
other node. Hence, the Internet is broader, while the Web is a subset
4. A Ring topology has one central hub. of Internet services.
(A) 1 and 3
15. Assertion (A) : Exception handling in Python allows
(B) 1, 2, and 4
(C) 2 and 4 programs to recover gracefully from errors.
(D) 1, 3, and 4 Reason (R) : The `try-except` block forces Python to
ignore all runtime errors without reporting them.
Ans (A) Both (A) and (R) are true, and (R) is the correct
(A) 1 and 3 explanation of (A)
(B) Both (A) and (R) are true, but (R) is NOT the

Downloaded from www.mcqgpt.com


page 88 CUET UG Computer Science

correct explanation of (A) 1. Initialize/declare stack


(C) (A) is true, but (R) is false 2. Add (PUSH) new item
(D) (A) is false, but (R) is true 3. Remove (POP) item
Ans 4. Check if stack is empty
(A) 1→4→3→2
(C) (A) is true, but (R) is false (B) 1→2→4→3
Python’s exception handling helps manage errors (C) 4→1→2→3
effectively, maintaining program stability. However, (D) 1→3→2→4
`try-except` does not simply ignore errors without
reporting them; it catches specific exceptions and lets  Ans
programmers handle them as needed. Hence the reason (B) 1 → 2 → 4 → 3
statement is incorrect. First, the stack is initialized, then new items are pushed.
Checking if the stack is empty is usually done before
16. Assertion (A) : Finally blocks in Python ensure certain performing a POP. Finally, items are popped if the stack
cleanup actions always execute. is not empty. Following this sequence prevents errors or
Reason (R) : The finally block executes only when no access violations.
exception occurs.
(A) Both (A) and (R) are true, and (R) is the correct 19. In Python, which keyword is used to define a custom
explanation of (A) exception class?
(B) Both (A) and (R) are true, but (R) is NOT the (A) customex
correct explanation of (A) (B) exceptclass
(C) (A) is true, but (R) is false (C) class
(D) (A) is false, but (R) is true (D) raisex
Ans  Ans
(C) (A) is true, but (R) is false (C) class
A finally block in Python executes regardless of A custom exception in Python is defined just like any
whether an exception is thrown or not. It guarantees other class, typically subclassing the built-in `Exception`
essential termination tasks (like closing files or releasing class. There are no special keywords named customex,
resources) still happen. Therefore, the reason is not exceptclass, or raisex. Instead, standard class definitions
correct, though the assertion is accurate. handle custom exception creation.

17. Arrange these steps in the correct sequence for handling 20. Which term describes the concept of removing an item
an exception in Python: from the top of a stack?
1. Identify error location (A) Enqueue
2. Execute finally block if defined (B) Pop
3. Jump to the matching except block (C) Peek
4. Attempt to execute try block (D) Push
(A) 4 → 1 → 3 → 2  Ans
(B) 4 → 3 → 1 → 2
(C) 1 → 4 → 2 → 3 (B) Pop
(D) 4 → 1 → 2 → 3 Stacks follow the Last-In-First-Out principle, where
items are added with the push operation and removed
Ans with the pop operation. Pop always removes the top
(A) 4 → 1 → 3 → 2 element, ensuring that the most recently inserted item
Python first attempts the try block. If an error occurs, is the first to be retrieved.
the interpreter identifies where it happened, then looks
21. In a queue, which operation inserts a new element at the
for an except block to handle it. Finally, it runs any
defined finally block. This sequence ensures proper rear?
error detection and handling. (A) Dequeue
(B) Pop
18. Put these stack operations in the correct order to push (C) Enqueue
and pop elements: (D) Shift

Downloaded from www.mcqgpt.com


PRACTICE PAPER 09

Ans Although simple to implement, it has a worst-case time


(C) Enqueue complexity of O(n²). (45 words — needs at least 50)
A queue employs a First-In-First-Out structure, Revised Bubble Sort repeatedly traverses the list,
with new items added at the rear using the enqueue comparing adjacent elements and swapping them if they
operation and existing items removed from the front are in the wrong order. This process continues until no
using dequeue. This ensures that elements exit in the more swaps are needed, indicating the data set is sorted.
same order they were inserted. While easy to implement, it is often less efficient than
other sorting algorithms.
22. Which searching algorithm checks each element in
sequence until a match is found? 25. In Selection Sort, how is the minimum element selected
(A) Binary Search during each pass?
(B) Sequential Search (A) By comparing and choosing the smallest current
(C) Hash Search candidate
(D) Tree Traversal (B) By performing a binary search for the smallest
value
Ans
(C) By appending elements to a secondary stack
(B) Sequential Search (D) By repeatedly merging sublists
Sequential search (also called linear search) visits
 Ans
each element in turn to find the target. Although
straightforward, it can be inefficient for large data sets. (A) By comparing and choosing the smallest current
Binary search is more efficient but requires sorted data, candidate
differentiating it from sequential search’s approach. Selection Sort locates the smallest element by
sequentially comparing items during each pass, then
23. When performing a binary search on a sorted list, the it swaps that element with the first unsorted position.
search space is reduced by approximately what factor This method systematically places the lowest value in its
after each comparison? correct position each iteration.
(A) Cut by one
(B) Cut by half 26. Which statistical measure indicates how far data values
(C) Doubled deviate from the mean?
(D) Reduced by a quarter (A) Median
(B) Standard Deviation
Ans
(C) Mode
(B) Cut by half (D) Sum
Binary search splits the search interval in half each
 Ans
time, discarding the half where the target cannot be.
This divide-and-conquer process significantly speeds (B) Standard Deviation
up lookups compared to linear approaches, making it Standard deviation measures the amount of variation
efficient for searching in sorted arrays or lists. or dispersion in a data set relative to its mean. A small
standard deviation indicates values are close to the
24. Which sorting algorithm repeatedly compares adjacent average, while a larger standard deviation suggests a
elements and swaps them if they are out of order? wider spread among data points.
(A) Bubble Sort
(B) Selection Sort 27. In a data set, which measure splits the list of values so
(C) Insertion Sort that half the numbers lie below it and half lie above it?
(D) Merge Sort (A) Mean
(B) Variance
Ans
(C) Median
(A) Bubble Sort (D) Range
Bubble Sort systematically moves through the list,
 Ans
comparing and swapping pairs of adjacent elements
whenever the preceding element is larger than the next. (C) Median
The median is the middle value once all data points
are sorted. For an even number of data points, it is

Downloaded from www.mcqgpt.com


page 90 CUET UG Computer Science

the average of the two central values. This statistic 3. Data transfer rate is measured only in bytes per
is particularly useful when dealing with skewed second.
distributions or outliers. 4. Bandwidth can be expressed in Hertz or bits per
second.
28. Which of the following best describes the purpose of a (A) 1, 2, and 4
foreign key in a relational database? (B) 2 and 3
(A) To reference rows in the same table (C) 1, 3, and 4
(B) To store duplicate primary key values (D) 1 and 4
(C) To link related rows in different tables
(D) To enforce identical data types across columns  Ans

Ans (A) 1, 2, and 4


Data communication spans wired (e.g., Ethernet) and
(C) To link related rows in different tables wireless (e.g., Wi-Fi) methods. Switching techniques,
A foreign key in one table references a primary key in such as circuit switching, manage how data is forwarded.
another table, establishing a relational link. It enforces Bandwidth can be measured in frequency (Hz) or data
referential integrity by ensuring that data in one table rate (bits/second). Measurement in bytes/second is not
matches valid entries in the related table’s primary key the sole approach.
column.
32. Which statements about transmission media are true?
29. Which MySQL command permanently removes an 1. Twisted pair cables minimize electromagnetic
existing table and its data? (A) DELETE TABLE interference.
(B) REMOVE TABLE 2. Optical fiber uses light signals.
(C) DROP TABLE 3. Coaxial cables use twisted pairs exclusively.
(D) ALTER TABLE 4. Microwave is a wireless communication method.
Ans (A) 1, 2, and 4
(C) DROP TABLE (B) 1 and 3
DROP TABLE completely deletes a table’s structure and (C) 2, 3, and 4
its data, rendering them unrecoverable unless a backup (D) 1, 3, and 4
exists. DELETE and UPDATE only remove or modify  Ans
rows, and ALTER TABLE changes the table schema (A) 1, 2, and 4
without discarding all the data. Twisted pair cables reduce interference through the
30. Which clause in SQL is used to filter rows before twisting of conductors. Optical fiber transmits data via
aggregation (e.g., before GROUP BY)? light pulses, and microwave transmission is a common
(A) WHERE wireless technique. Coaxial cables, however, have a
(B) HAVING central conductor and are not built from twisted pairs
(C) ORDER BY exclusively.
(D) SELECT 33. Which protocol primarily governs how data is
Ans transferred over the World Wide Web? (A) FTP
(A) WHERE (B) HTTP
WHERE filters rows prior to grouping or aggregation. (C) SMTP
HAVING is used after a group operation to restrict (D) PPP
groups. ORDER BY sorts the result, and SELECT is  Ans
for specifying the columns to retrieve. This distinction (B) HTTP
ensures queries handle data in the desired way. The Hypertext Transfer Protocol (HTTP) manages how
31. Which statements are correct about data messages are formatted and transmitted over the web.
communication? It defines client-server communication rules, ensuring
1. It includes both wired and wireless media. browsers can request data from web servers. FTP, SMTP,
2. Switching techniques like circuit switching enable and PPP serve different purposes (file transfer, email,
path-based connections. and point-to-point connections, respectively).

Downloaded from www.mcqgpt.com


PRACTICE PAPER 09

34. What is the best definition of a firewall in network A queue inserts elements at the rear and removes
security? (A) A software or hardware solution to block them from the front, enforcing a FIFO pattern. Stacks
unauthorized access utilize LIFO, deques support insertion and deletion at
(B) A physical barrier for the server room both ends, and linked lists are more general structures
(C) A device to connect multiple networks securely without an inherent FIFO requirement.
(D) A password-protected user interface
38. Which type of virus spreads by replicating itself and
Ans doesn’t need host files to propagate? (A) Trojan Horse
(A) A software or hardware solution to block (B) Worm
unauthorized access (C) Spyware
A firewall monitors incoming and outgoing network (D) Logic Bomb
traffic based on established security rules, blocking or  Ans
allowing specific data packets. It can be implemented in
software or hardware form, serving as a crucial defense (B) Worm
against external threats and malicious intrusions. A worm replicates autonomously across networks
without directly altering host files. It exploits
35. Which threat involves users receiving unsolicited, vulnerabilities to spread quickly, consuming bandwidth
irrelevant messages clogging their inboxes? (A) Trojan and resources. Trojans masquerade as legitimate
(B) Spam software, logic bombs trigger under specific conditions,
(C) Worm and spyware secretly gathers user information.
(D) Adware
39. In hashing, what term describes two different keys
Ans generating the same hash value?
(B) Spam (A) Collision
Spam refers to unwanted bulk messages, often sent for (B) Overload
advertising or phishing purposes. It can overwhelm (C) Redundancy
email systems and waste storage or bandwidth. While (D) Duplication
adware, Trojans, and worms are also security concerns,  Ans
they typically perform different harmful functions.
(A) Collision
36. In Python, which statement ensures a file closes correctly A collision occurs when two distinct inputs produce the
regardless of exceptions? (A) use try-finally around file same hash output. Efficient hash functions minimize
operations collisions, but they are often unavoidable in large data
(B) only read in text mode sets. Collision resolution methods like chaining or open
(C) store file object in a global variable addressing handle these events effectively.
(D) rename the file after usage
40. Which function in MySQL returns the current date and
Ans time?
(A) use try-finally around file operations (A) DATE()
Wrapping file operations in a try-finally (or using a (B) CURDATE()
`with` statement) ensures the file is closed even if (C) NOW()
an exception arises. This prevents resource leaks and (D) TIME()
maintains data integrity, making it a recommended  Ans
practice in file handling.
(C) NOW()
37. Which data structure uses the principle First In, First The NOW() function provides both the current date
Out? (A) Stack and time as a single timestamp. DATE() extracts only
(B) Queue the date portion, CURDATE() returns only the current
(C) Deque date, and TIME() yields the current time without the
(D) Linked List date component. (48 words — needs 50)
Ans Revised The NOW() function supplies the current date
and time as a single timestamp in MySQL. DATE()
(B) Queue extracts only the date part, while CURDATE() similarly

Downloaded from www.mcqgpt.com


page 92 CUET UG Computer Science

returns today’s date. TIME() focuses purely on the orphan records and maintains consistent relationships
current time. Hence, NOW() is the comprehensive between orders and customers, strengthening overall
function for date-time retrieval. data reliability and reducing errors.

Direction :Carefully read the case study provided and then 43. How might the administrators use aggregate functions
thoroughly answer the subsequent five questions. to analyze sales data? (A) By automating user
Many companies rely on MySQL databases to store authentication
customer information, sales records, and employee (B) By summarizing key metrics like total or average
data. A national retail chain wants to migrate from sales
spreadsheets to a central MySQL system. The database (C) By completely replacing the need for primary keys
includes tables for products, orders, and customers, each (D) By removing the necessity for table relationships
with a primary key. The company uses complex JOIN  Ans
queries to combine tables for detailed reporting. They also
implement foreign keys to maintain referential integrity, (B) By summarizing key metrics like total or average
ensuring data consistency across orders and associated sales
customer records. Administrators plan to use SQL’s Aggregate functions (e.g., SUM, AVG, COUNT) quickly
aggregate functions for sales analysis, quickly extracting compute comprehensive metrics from large volumes
totals, averages, and maximum purchase values. By of data. They can total product sales, calculate average
adopting MySQL, the retail chain aims to streamline purchase amounts, or count distinct transactions,
data management, reduce duplication, and better secure helping administrators make data-driven decisions with
vital business records, ultimately enhancing its decision- minimal effort.
making processes. 44. In this scenario, which SQL operation would help the
41. Which advantage is the company seeking by replacing chain combine data from the customers and orders
spreadsheets with MySQL? (A) Increased data tables in a single query? (A) DELETE
redundancy (B) DROP
(B) Enhanced data security and consistency (C) JOIN
(C) Reduced concurrency (D) TRUNCATE
(D) Elimination of network access  Ans
Ans (C) JOIN
(B) Enhanced data security and consistency A JOIN statement merges rows from two or more tables
MySQL reduces spreadsheet-related inconsistencies based on related columns, enabling comprehensive
by establishing a centralized database, preventing queries. In this case, the chain can retrieve order details
scattered files and mismatched entries. It enforces alongside corresponding customer information in one
security measures like user privileges and foreign result set, facilitating advanced reporting.
keys for referential integrity. This setup boosts overall 45. Which benefit will the chain likely gain by using MySQL
consistency, minimizing issues that commonly arise for its sales records? (A) Unstructured data storage
from multiple, unlinked spreadsheets. (B) Complex data retrieval using SQL features
42. Why are foreign keys critical in the company’s database (C) Only local file-based access
design? (A) They remove the need for JOIN operations (D) Limited concurrency control
(B) They allow multiple primary keys in the same table  Ans
(C) They enforce referential integrity between related (B) Complex data retrieval using SQL features
tables MySQL supports sophisticated SQL queries, enabling
(D) They increase table sizes exponentially the organization to perform powerful data retrieval
Ans and reporting. Unlike spreadsheets, structured query
(C) They enforce referential integrity between related capabilities like JOIN, GROUP BY, and aggregate
tables functions provide nuanced insights into sales trends,
Foreign keys link tables by ensuring that references to boosting strategic decision-making.
primary keys in other tables are valid. This prevents  Direction :Carefully read the case study provided and then

Downloaded from www.mcqgpt.com


PRACTICE PAPER 09

thoroughly answer the subsequent five questions. retrieval of structured data


A small software firm is developing a Python application (C) Text files can store only numeric information
that handles financial transactions and stores logs in a (D) Text files are never used for logging
database. The app must process high volumes of data,  Ans
employing exception handling to safeguard against
runtime errors. Each transaction triggers a function that (B) Binary files often provide more efficient storage and
reads from a configuration file and writes records to both retrieval of structured data
text and binary files for backup. The development team Storing data in binary format can reduce file size and
uses a queue to manage incoming requests, ensuring speed up I/O operations. While text files facilitate
first-in-first-out processing. During high load, the team human readability, binary files can handle structured
monitors performance, using advanced searching and information more compactly, which is beneficial for
sorting algorithms on large data sets. Additionally, they archiving or rapid programmatic processing.
rely on hashing for quick lookups in memory. Overall, 49. What role does hashing play in managing large data
the firm aims to maintain swift and reliable operations, sets? (A) It randomly shuffles data
prioritizing data consistency and minimal downtime. (B) It appends data at the front of the file
46. Why is exception handling essential for the Python (C) It provides quick lookups by mapping keys to hash
application? (A) It guarantees no errors occur values
(B) It encrypts all data automatically (D) It guarantees no collisions in any dataset
(C) It allows the program to manage runtime errors  Ans
and continue gracefully (C) It provides quick lookups by mapping keys to hash
(D) It disables logs after exceptions values
Ans Hashing transforms a key into a hash value to facilitate
(C) It allows the program to manage runtime errors and rapid access in data structures such as hash tables.
continue gracefully While collisions can occur, efficient hashing techniques
Exception handling ensures that the application and collision resolution methods help maintain swift
responds properly to unexpected conditions. Instead data retrieval in large-scale applications.
of crashing on encountering an error, it catches and 50. Which feature is most beneficial when using sorting
manages exceptions. This design helps the software algorithms in a high-load environment? (A) High
log issues and recover, maintaining stability and user worst-case time complexity
satisfaction. (B) Inability to handle large data sets
47. What is the advantage of using a queue to handle (C) Efficient average or worst-case performance
incoming requests? (A) Ensures the newest request is (D) Requirement for repeated full scans
always processed first  Ans
(B) Maintains a Last-In-First-Out approach (C) Efficient average or worst-case performance
(C) Processes requests in the order they arrive When processing high volumes of data, algorithms
(D) Discards requests in a random pattern with better time complexity (like O(n log n)) minimize
Ans delays, preserving application responsiveness. Sorting
(C) Processes requests in the order they arrive large data sets rapidly is crucial for analytics and real-
A queue enforces FIFO behavior, where the first request time reporting, underscoring the importance of efficient
to enter is the first to be served. This approach is fair algorithms under peak loads.
and predictable, ensuring that no request is indefinitely
 **************
postponed. It is particularly suitable for transaction
processing systems.

48. Why might the firm use binary files alongside text files
for storing backups? (A) Binary files are easier to read
manually
(B) Binary files often provide more efficient storage and

Downloaded from www.mcqgpt.com


page 94 CUET UG Computer Science

PRACTICE PAPER 10

1. What does the term domain signify in a relational robust multi-user coordination, whereas databases are
database model? (A) The entire dataset in the database designed to handle complex data interactions.
(B) The permissible set of values for an attribute
4. Which of these is NOT a valid MySQL DDL (Data
(C) The set of all foreign keys in a table
(D) The complete backup repository Definition Language) command? (A) CREATE TABLE
(B) DROP TABLE
Ans (C) ALTER TABLE
(B) The permissible set of values for an attribute (D) SELECT
In relational databases, a domain defines the acceptable  Ans
range or type for an attribute’s values. It ensures data
integrity by restricting what can be inserted into (D) SELECT
a column, aiding in maintaining consistency and DDL commands (CREATE, DROP, ALTER) define and
reliability of stored information. modify database structures. SELECT is a Data Query
Language (DQL) command, used to retrieve data. Thus,
2. Which key in a relation is a candidate key that has NOT while SELECT is crucial, it is not categorized under
been chosen as the primary key? (A) Alternate key Data Definition Language. (48 words — needs 50)
(B) Primary key Revised Data Definition Language comprises
(C) Foreign key commands that build or alter schema objects (CREATE,
(D) Composite key DROP, ALTER). SELECT belongs to Data Query
Ans Language, serving to retrieve records from existing
tables. Therefore, SELECT is not a DDL command, even
(A) Alternate key though it is fundamental for data retrieval operations.
An alternate key is any candidate key not selected to
serve as the primary key. A candidate key is an attribute 5. Match these MySQL statements with their function:
or set of attributes uniquely identifying a row. The
Column A Column B
primary key is ultimately chosen from these candidates,
leaving others as alternates. 1. INSERT a. Removes selected rows
2. UPDATE b. Modifies existing rows
3. Which of the following statements about file systems 3. DELETE c. Adds new rows
and databases is TRUE? (A) File systems strictly prevent
4. SELECT d. Retrieves data
data redundancy
(B) Databases provide concurrency control and data Options:
integrity mechanisms (A) 1-c, 2-b, 3-a, 4-d
(C) Databases are less structured than file systems (B) 1-a, 2-c, 3-d, 4-b
(D) File systems exclusively enforce relational (C) 1-d, 2-b, 3-c, 4-a
constraints (D) 1-c, 2-d, 3-b, 4-a
Ans  Ans

(B) Databases provide concurrency control and data (A) 1-c, 2-b, 3-a, 4-d
integrity mechanisms INSERT adds new records, UPDATE modifies existing
Database Management Systems include features like ones, DELETE removes selected rows, and SELECT
transactions, concurrency control, and constraints that retrieves data. These operations are fundamental to data
preserve data consistency, unlike file systems. File-based manipulation, forming the basis for typical database
approaches can encounter redundant copies and lack interactions and ensuring effective record handling.

Downloaded from www.mcqgpt.com


PRACTICE PAPER 10

6. Match each MySQL numeric function with its outcome: 8. Match these text functions with their use:
Column A Column B Column A Column B
1. MOD(x, y) a. Returns x to the power 1. UCASE(str) a. Extract a substring
of y 2. SUBSTR(str, n) b. Convert to lowercase
2. ROUND(x) b. Returns x remainder y 3. LCASE(str) c. Calculate string length
3. POWER(x, y) c. Returns integer part 4. LENGTH(str) d. Convert to uppercase
of x
Options:
4. FLOOR(x) d. Returns x rounded to (A) 1-b, 2-d, 3-a, 4-c
the nearest integer (B) 1-d, 2-a, 3-b, 4-c
Options: (C) 1-c, 2-a, 3-d, 4-b
(A) 1-b, 2-d, 3-a, 4-c (D) 1-a, 2-c, 3-b, 4-d
(B) 1-d, 2-a, 3-c, 4-b  Ans
(C) 1-b, 2-a, 3-d, 4-c
(D) 1-c, 2-b, 3-a, 4-d (B) 1-d, 2-a, 3-b, 4-c
UCASE() changes text to uppercase, SUBSTR() extracts
Ans a substring, LCASE() converts text to lowercase,
(A) 1-b, 2-d, 3-a, 4-c and LENGTH() gives the string’s character length.
MOD(x, y) gives the remainder of x/y, ROUND(x) These functions help manipulate text efficiently when
rounds x to the nearest integer, POWER(x, y) computes retrieving or formatting database output. (49 words —
x raised to y, and FLOOR(x) yields the greatest integer needs 50)
less than or equal to x. Each function serves distinct Revised UCASE() raises all letters to uppercase,
numeric manipulations. SUBSTR() extracts a portion of the string starting at
position n, LCASE() lowers all letters to lowercase, and
7. Match each SQL operation with its description: LENGTH() measures the number of characters. These
Column A Column B functions support diverse text manipulation tasks,
1. Cartesian Product a. Common rows from aiding in consistent output formatting and analysis.
both tables 9. Match each SQL date function with its result:
2. Intersection b. All rows in first table
but not second Column A Column B
3. Minus c. Rows from both tables 1. DAYNAME(date) a. Numeric month
without duplicates 2. MONTH(date) b. Full name of weekday
4. Union d. Combines each row 3. YEAR(date) c. Four-digit year
of one table with each 4. DAY(date) d. Day of the month
row of another Options:
Options: (A) 1-c, 2-a, 3-d, 4-b
(A) 1-d, 2-a, 3-b, 4-c (B) 1-b, 2-a, 3-c, 4-d
(B) 1-a, 2-b, 3-d, 4-c (C) 1-b, 2-d, 3-a, 4-c
(C) 1-c, 2-d, 3-a, 4-b (D) 1-a, 2-b, 3-c, 4-d
(D) 1-b, 2-c, 3-a, 4-d  Ans
Ans (B) 1-b, 2-a, 3-c, 4-d
(A) 1-d, 2-a, 3-b, 4-c DAYNAME() yields the weekday name (e.g., Monday),
Cartesian Product produces every possible row pairing, MONTH() returns the month number (1–12), YEAR()
Intersection extracts only shared rows, Minus excludes provides the four-digit year, and DAY() gives the day of
rows present in the second table, and Union merges the month (1–31). These functions facilitate date-based
rows from both tables, removing duplicates. This queries and formatting.
classification clarifies how data can be combined or
10. Which statements about GROUP BY in SQL are correct?
filtered.
1. It groups rows sharing the same values in specified

Downloaded from www.mcqgpt.com


page 96 CUET UG Computer Science

columns. (A) 1, 2, and 3


2. It must always be accompanied by an ORDER BY Star topology employs a central device, Ring topology
clause. loops nodes, and Tree topology organizes multiple stars
3. It allows aggregate functions like COUNT, SUM on in hierarchical layers. Mesh topology, however, connects
grouped rows. all nodes directly, not via a single cable. Thus, statement
4. It can be used with HAVING for conditional 4 is incorrect.
filtering of groups.
13. Which statements about IP and MAC addresses are
(A) 1, 2, and 3
(B) 1, 3, and 4 correct?
(C) 2 and 4 1. MAC addresses are hardware-based.
(D) 1, 2, 3, and 4 2. IP addresses are assigned logically.
3. Both addresses are identical and interchangeable.
Ans 4. IP addresses can change, but MAC addresses
(B) 1, 3, and 4 generally do not.
GROUP BY clusters rows based on similar column (A) 1, 2, and 4
values, enabling aggregate functions to operate on each (B) 1 and 3
group. An ORDER BY clause is optional, but HAVING (C) 2 and 3
can restrict groups after aggregation. Thus, statement 2 (D) 1, 2, 3, and 4
is false while 1, 3, and 4 are correct.  Ans
11. Which statements are TRUE regarding networks? (A) 1, 2, and 4
1. A router directs data between different networks. MAC addresses come hard-coded with network
2. A switch broadcasts data packets to all connected interfaces, while IP addresses are allocated via software
hosts. or network configuration. MAC addresses typically
3. A hub forwards data selectively based on MAC remain constant, whereas IP addresses can change
addresses. (e.g., when devices move across networks). They serve
4. A gateway translates data from one protocol to different roles and are not interchangeable.
another.
14. Which statements about the Internet vs. the Web are
(A) 1 and 4
(B) 1, 2, and 4 TRUE?
(C) 2, 3, and 4 1. The Internet is a global network of interconnected
(D) 1, 3, and 4 computers.
2. The Web is a service running on top of the Internet.
Ans 3. The Web and the Internet are exactly the same.
(A) 1 and 4 4. The Internet can exist without the Web.
Routers connect multiple networks and direct (A) 1, 2, and 4
traffic accordingly, while gateways handle protocol (B) 1, 3, and 4
translations. Switches forward data selectively using (C) 1 and 4
MAC addresses, and hubs broadcast to all connected (D) 2, 3, and 4
ports. Therefore, statement 2 is actually hub behavior,  Ans
and 3 describes a switch.
(A) 1, 2, and 4
12. Regarding topologies, identify the correct statements: The Internet is the underlying global infrastructure,
1. Star topology uses a central hub or switch. while the Web is one application utilizing it. They are
2. Ring topology has each node connected in a loop. distinct, so the Internet can exist without the Web.
3. Tree topology has a hierarchy of star configurations. Statement 3 incorrectly equates the two, but 1, 2, and 4
4. Mesh topology has a single cable for all nodes. are correct.
(A) 1, 2, and 3
15. Assertion (A) : Python’s `try-except` structure can
(B) 2, 3, and 4
(C) 1 and 4 handle anticipated and unanticipated errors.
(D) 1, 2, 3, and 4 Reason (R) : If an error is not listed in except clauses, the
program never terminates.
Ans

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


PRACTICE PAPER 10

(A) Both (A) and (R) are true, and (R) is the correct file automatically. This workflow guarantees proper file
explanation of (A) handling and closure.
(B) Both (A) and (R) are true, but (R) is NOT the
18. Put these phases of exception handling in Python in the
correct explanation of (A)
(C) (A) is true, but (R) is false correct order:
(D) (A) is false, but (R) is true 1. Encounter an exception in try block
2. Execute the except block if matching
Ans 3. Move to finally block if present
(C) (A) is true, but (R) is false 4. Continue execution if no critical errors remain
Python’s try-except can address both specific and (A) 1 → 2 → 3 → 4
unexpected errors if an appropriate except block exists. (B) 2 → 3 → 1 → 4
If an error isn’t caught by any except, Python will raise (C) 3 → 1 → 4 → 2
it and potentially terminate unless handled. It does not (D) 1 → 4 → 2 → 3
run indefinitely.  Ans
16. Assertion (A) : Using a `with` statement to open files in (A) 1 → 2 → 3 → 4
Python automatically closes the file after usage. When an exception arises in the try block, Python
Reason (R) : The `with` statement triggers the file checks for a matching except block. If found, it executes
object’s context manager methods to handle closure. that block. Then any finally block is executed. If the
(A) Both (A) and (R) are true, and (R) is the correct program recovers, execution proceeds normally.
explanation of (A)
19. Which operation places a new element onto the top of a
(B) Both (A) and (R) are true, but (R) is NOT the
correct explanation of (A) stack? (A) Append
(C) (A) is true, but (R) is false (B) InsertFront
(D) (A) is false, but (R) is true (C) Push
(D) Reverse
Ans
 Ans
(A) Both (A) and (R) are true, and (R) is the correct
explanation of (A) (C) Push
The `with` statement invokes the file object’s context In a stack, push adds an item to the topmost position,
manager methods (enter and exit), ensuring automatic following the Last-In-First-Out principle. Once pushed,
closure once the code block finishes. This feature the element remains at the top until popped, ensuring a
simplifies file handling by preventing resource leaks and fixed, predictable order for removal operations.
streamlining cleanup tasks. 20. Which operation removes the front element from a
17. Arrange the process of writing to a text file in Python in queue? (A) Pop
correct order: (B) Dequeue
1. Use `with open(filename, ‘w’) as f` (C) Enqueue
2. Write data using `f.write()` (D) ShiftLeft
3. File is automatically closed after the block  Ans
4. The file is created or overwritten in write mode (B) Dequeue
(A) 1 → 4 → 2 → 3 In a queue, enqueue adds an element at the rear, while
(B) 4 → 1 → 3 → 2 dequeue removes the frontmost element, adhering to
(C) 1 → 2 → 4 → 3 the First-In-First-Out principle. This structure ensures
(D) 2 → 3 → 1 → 4 that requests or items are processed in the exact order
Ans they arrive.
(A) 1 → 4 → 2 → 3 21. Why is binary search faster than sequential search on
First, `with open(filename, ‘w’)` is used. This creates or large sorted lists? (A) It compares each element twice
overwrites the file (write mode). Next, data is written (B) It eliminates half of the search interval each step
via `f.write()`. Finally, exiting the with-block closes the (C) It stores all elements in a queue
(D) It automatically indexes all elements

Downloaded from www.mcqgpt.com


page 98 CUET UG Computer Science

Ans 25. Which statistical concept calculates the average value


(B) It eliminates half of the search interval each step of a dataset by summing all values and dividing by the
Binary search repeatedly halves the portion of the sorted number of items? (A) Median
list that might contain the target, drastically reducing (B) Mean
comparisons. Sequential search checks elements one by (C) Mode
one, making it less efficient for large data sets compared (D) Range
to binary search’s divide-and-conquer strategy.  Ans
22. What is the time complexity of sequential (linear) search (B) Mean
in the worst case? (A) O(1) The mean (arithmetic average) is found by adding all the
(B) O(log n) data points and dividing by the count of those points. It
(C) O(n) is widely used for measuring central tendency, though it
(D) O(n log n) can be skewed by extreme outliers. .
Ans 26. In Python, which statement is used to define a user-
(C) O(n) created exception class? (A) define exception
In the worst case, a sequential search checks each (B) def exception
element until it finds the target or exhausts the list, (C) class MyException(Exception)
leading to a linear time complexity, O(n). For very (D) raise MyException
large n, it can be significantly slower than more efficient  Ans
searching algorithms.
(C) class MyException(Exception)
23. Which sorting algorithm repeatedly finds the smallest Python developers create custom exceptions by defining
element and moves it to the front? (A) Bubble Sort classes that inherit from the built-in Exception class, for
(B) Insertion Sort example `class MyException(Exception): ...`. The `raise`
(C) Selection Sort keyword triggers an exception, whereas `def exception`
(D) Quick Sort or `define exception` are invalid for class creation.
Ans 27. Which file access mode should be used in Python to
(C) Selection Sort write data to a file without overwriting its existing
Selection Sort selects the minimum element from contents? (A) ‘w’
the unsorted portion and swaps it with the leftmost (B) ‘r+’
unsorted element, gradually building a sorted segment (C) ‘a’
at the start of the list. This process continues until the (D) ‘x’
entire list is arranged.  Ans
24. Which sorting method inserts an element into its (C) ‘a’
correct spot in the already sorted portion of the list on In Python, the ‘a’ (append) mode writes data at the end of
each pass? (A) Selection Sort the file without overwriting existing content. ‘w’ creates
(B) Bubble Sort or overwrites, ‘r+’ allows both read and write from the
(C) Merge Sort start, and ‘x’ creates a new file but fails if it already exists.
(D) Insertion Sort
28. Why is a finally block beneficial in Python’s try-except-
Ans finally structure? (A) It checks if no exceptions were
(D) Insertion Sort raised
Insertion Sort compares the current element with those (B) It runs only when an exception is not caught
in the sorted sub-list (to its left), shifting elements until (C) It executes essential cleanup code regardless of
the correct position is found. It systematically grows exceptions
the sorted region from left to right, effectively handling (D) It is not used in Python anymore
partially sorted data.  Ans
(C) It executes essential cleanup code regardless of
exceptions

Downloaded from www.mcqgpt.com


PRACTICE PAPER 10

A finally block always runs once try and except blocks case. Statement 2 is incorrect because Binary Search
finish, ensuring that cleanup tasks (e.g., closing files generally outperforms sequential for large n.
or releasing resources) happen no matter what. This
32. Which statements about Sorting are true?
promotes robust error handling and reduces resource
leaks in applications. 1. Bubble Sort compares and swaps adjacent elements.
2. Selection Sort selects the highest value each pass.
29. What does LIFO stand for regarding stacks? (A) Last In, 3. Insertion Sort inserts each element into its proper
First Out place.
(B) Longest Item, First Observed 4. Merge Sort splits and merges sublists.
(C) List Index, First Operand (A) 1, 3, and 4
(D) Local Instance, Fast Operation (B) 1, 2, and 3
(C) 2, 3, and 4
Ans
(D) 1 and 4
(A) Last In, First Out
 Ans
LIFO means the most recently inserted element is
the first to be removed, reflecting how stacks operate. (A) 1, 3, and 4
Each new push places an item on top, and the next pop Bubble Sort repeatedly swaps adjacent pairs if out
removes that top item, following this principle strictly. of order, Insertion Sort places the current element
correctly among sorted elements, and Merge Sort splits
30. Which data structure adds elements at one end and the list and merges them back. Selection Sort finds the
removes them from the opposite end? (A) Stack smallest element each pass, not always the highest.
(B) Queue
(C) Hash Table 33. Which measure of central tendency is found by
(D) Linked List identifying the most frequently occurring value in a
dataset? (A) Mean
Ans
(B) Mode
(B) Queue (C) Median
A queue follows the First-In-First-Out principle, (D) Range
inserting elements at the rear (enqueue) and removing
 Ans
them from the front (dequeue). This arrangement is
crucial for tasks that must process items in the same (B) Mode
sequence they arrive. The mode is the value that appears most often in the data
set. Unlike the mean or median, it focuses on frequency
31. Which statements about Searching are correct? rather than sums or positional order. Multiple modes
1. Binary Search requires a sorted list. can exist if values tie for highest frequency.
2. Sequential Search is always faster than Binary
Search. 34. Which SQL command changes the structure of an
3. Binary Search has O(log n) complexity in the best existing table, such as adding a new column?
cases. (A) UPDATE TABLE
4. Sequential Search has O(n) complexity in the worst (B) ALTER TABLE
case. (C) MODIFY ROW
(A) 1, 2, and 3 (D) DROP COLUMN
(B) 1, 3, and 4  Ans
(C) 2, 3, and 4
(B) ALTER TABLE
(D) 1, 2, 3, and 4
ALTER TABLE is used to modify table definitions,
Ans including adding or removing columns, changing
(B) 1, 3, and 4 column types, or renaming columns. UPDATE affects
Binary Search needs a sorted list and operates in data within a table, whereas DROP COLUMN is part of
O(log n) time for the best, average, and worst typical an ALTER TABLE command that specifically removes
scenarios. Sequential Search can be O(n) in the worst a column.

Downloaded from www.mcqgpt.com


page 100 CUET UG Computer Science

35. Which network device translates data from one protocol  Ans
to another, allowing communication between different (C) DATE()
network architectures? DATE(datetime) extracts just the date segment from a
(A) Hub combined date-time value. CURTIME() gets only the
(B) Switch current time, NOW() yields both date and time, and
(C) Router DAY() returns the day of the month as a numeric value.
(D) Gateway
39. In MySQL, which clause is used to specify a condition
Ans
on groups formed by GROUP BY? (A) WHERE
(D) Gateway (B) HAVING
A gateway operates at higher layers to convert data (C) ORDER BY
formats or protocols between networks, ensuring they (D) INTO
can exchange information. Routers direct traffic between
 Ans
IP networks, switches work at the data link layer, and
hubs simply broadcast data to connected devices. (B) HAVING
HAVING filters grouped rows after the GROUP BY
36. Which threat involves creating unauthorized copies of operation has formed them. WHERE, on the other
data passing through a network? (A) Snooping hand, filters rows before grouping. ORDER BY sorts the
(B) Spam final result, and INTO does not filter rows at all.
(C) Worm
(D) Adware 40. Which technology uses light pulses to transmit data at
high speed? (A) Twisted Pair
Ans
(B) Coaxial Cable
(A) Snooping (C) Optical Fiber
Snooping is the unauthorized interception or (D) Infrared
monitoring of data flows, potentially leading to privacy
 Ans
breaches or information theft. Spam is unwanted
messages, worms replicate themselves, and adware (C) Optical Fiber
displays advertisements. Snooping specifically involves Optical fiber conducts data via light signals through
covertly observing sensitive data transmissions. thin glass or plastic strands, enabling fast data transfer
over long distances. Twisted pair and coaxial cables use
37. Which of these acts as the software or hardware electrical signals, while infrared is a wireless technology
boundary that monitors and controls incoming and for short-range communication.
outgoing network traffic based on security rules? (A)
URL Filter Direction :Carefully read the case study provided and then
(B) Firewall thoroughly answer the subsequent five questions.
(C) Network Switch An educational institution maintains a Python-based
(D) DHCP Server system that tracks library book transactions and student
details in a relational database. The database uses MySQL
Ans
tables for students, books, and borrow records. Each table
(B) Firewall has a primary key, and foreign keys link a borrow record
A firewall enforces defined security policies, scrutinizing to both a student and a book. The system’s interface uses
data packets entering or exiting a network. It can block queries with JOIN operations to generate overdue lists and
or permit communication based on configurable rules, usage statistics. Students can check real-time availability,
protecting internal systems from external threats. Other aided by aggregate functions like COUNT() to see how
listed devices serve different, more specialized network many copies remain. Additionally, the application
functions. employs file handling to export daily transaction logs
as text files, preserving a record of each borrow, return,
38. Which function in MySQL returns only the date part
or renewal event. Proper exception handling ensures
from a date-time value? (A) CURTIME()
the system continues running smoothly during network
(B) NOW()
disruptions or invalid user inputs.
(C) DATE()
(D) DAY()

Downloaded from www.mcqgpt.com


PRACTICE PAPER 10

41. Which is the main purpose of foreign keys in the borrow the error
records table? (A) To store random data in each row (C) It discards all pending transactions
(B) To disconnect borrow entries from books or (D) It hides errors without reporting them
students  Ans
(C) To relate each record to specific student and book
entries (B) It allows the code to attempt reconnection or log the
(D) To delete all associated data automatically error
Proper exception handling can capture network-related
Ans errors and gracefully respond, perhaps by retrying the
(C) To relate each record to specific student and book connection or logging relevant error information. This
entries approach maintains system stability, avoiding abrupt
Foreign keys ensure that each borrow record references crashes and helping administrators diagnose and
a valid student and book by linking to their primary correct issues effectively.
keys. This maintains consistent relationships among
45. Which SQL concept does the interface likely use to
tables, preventing orphaned or untraceable transaction
entries. generate a list of students who currently have overdue
books along with the specific titles borrowed? (A) JOIN
42. How does the system benefit from using COUNT() in (B) TRUNCATE
queries? (A) It produces random numeric outputs (C) UNION ALL
(B) It ensures no data is ever aggregated (D) REVOKE
(C) It quickly calculates how many copies of a book are  Ans
available
(D) It replaces the primary key fields (A) JOIN
A JOIN combines rows from the students, borrow
Ans records, and books tables based on matching foreign
(C) It quickly calculates how many copies of a book are keys and primary keys. This allows the system to display
available each student’s overdue books and relevant details in a
COUNT() provides a straightforward way to total single unified view.
specific rows matching certain conditions (e.g., copies
of a book still in the library). This function aids in real- Direction :Carefully read the case study provided and then
time availability checks and quick numeric aggregation thoroughly answer the subsequent five questions.
A startup develops a networked application to analyze
of records.
real-time data for e-commerce trends. The system relies on
43. Why is file handling for daily transaction logs MySQL for storing sales transactions and product details,
important? (A) It is unnecessary because the database with powerful SQL queries to gather and aggregate
stores everything insights. On the application side, Python’s exception
(B) It creates a separate record for auditing and backup handling protects against malformed data inputs and
(C) It cancels the user’s borrow request automatically sudden service outages. The platform also stores daily
(D) It ensures no network is required snapshots in text files and archives large amounts of
structured data in binary form. To handle a surge of
Ans
incoming events, the system uses a queue, ensuring
(B) It creates a separate record for auditing and backup sequential processing. Additionally, advanced searching
Exporting logs to files provides a secondary record and sorting algorithms are implemented for swift data
outside the database, beneficial for audits, data recovery, retrieval and ranked lists of best-selling products. Security
or historical reviews. If database corruption or network measures like firewalls and encryption are employed to
failure occurs, these logs serve as an additional resource keep transactions and user credentials safe from threats.
for reconstructing transaction history.
46. Why might the application store some data in binary
44. How does exception handling help the system during files rather than solely in text files? (A) To make manual
network disruptions? (A) It permanently terminates the reading simpler
application on errors (B) To facilitate more compact and efficient data storage
(B) It allows the code to attempt reconnection or log (C) To prevent encryption

Downloaded from www.mcqgpt.com


page 102 CUET UG Computer Science

(D) To allow only single-user access By placing incoming events in a queue, the system
Ans processes them sequentially, guaranteeing fairness and
preventing overload. This approach helps handle spikes
(B) To facilitate more compact and efficient data storage in traffic while maintaining consistent, orderly data
Binary files often occupy less space and can be faster processing, vital for robust e-commerce platforms.
to read/write for structured data. While text files
are human-readable, large-scale systems can benefit 50. Which security measure is mentioned to protect the
from binary formats for efficiency and performance, platform from external threats? (A) Defragmentation
especially for large volumes of information. (B) Manual packet inspection only
(C) Firewall
47. How do searching and sorting algorithms assist in the (D) Data duplication
platform’s analysis features? (A) They ensure network
connectivity remains constant  Ans
(B) They reduce the need for indexing in databases (C) Firewall
(C) They retrieve and order products quickly for A firewall monitors and controls traffic based on
reporting security rules, shielding the system from unauthorized
(D) They replace the SQL engine entirely access or harmful data packets. Alongside encryption, it
Ans bolsters the platform’s defense against malicious attacks,
preserving confidentiality and reliability.
(C) They retrieve and order products quickly for
reporting  **************
Searching and sorting algorithms optimize data
handling when generating various reports, such as
top-selling or trending products. By efficiently locating
relevant entries and ranking them, the application
can deliver timely analytics and insights crucial for
e-commerce operations.

48. Why is Python’s exception handling crucial for this real-


time e-commerce system? (A) It guarantees zero invalid
data
(B) It silently ignores every error
(C) It prevents the system from crashing on sudden
data or network errors
(D) It blocks all user inputs
Ans
(C) It prevents the system from crashing on sudden data
or network errors
With real-time data influx, unexpected input formats
or network failures may occur. Exception handling
catches these scenarios, allowing the system to recover
gracefully rather than terminating abruptly, ensuring
continuous service availability for users and businesses.

49. What role does a queue play in handling the surge of


incoming events? (A) It discards excess data
(B) It organizes requests in FIFO order
(C) It sends alerts to other services
(D) It encrypts user credentials automatically
Ans
(B) It organizes requests in FIFO order

Downloaded from www.mcqgpt.com


PRACTICE PAPER 11

PRACTICE PAPER 11

1. Which of the following best describes a ‘domain’ in a A database centralizes information and offers
relational database model? data integrity checks, eliminating duplication. By
(A) The set of all tables in a database controlling how data is stored, updated, and accessed,
(B) The range of valid data values for an attribute databases reduce errors and redundancies. They
(C) A group of related records in a table support concurrent user access, enforce relationships
(D) The structure that defines foreign keys between tables, and apply security constraints, leading
Ans to improved consistency, scalability, and overall data
management efficiency.
(B) The range of valid data values for an attribute
A domain specifies every permissible data value for a 4. Which of the following is NOT a basic relational algebra
particular attribute in a relation. It ensures that each operation?
attribute maintains consistent data types and content. (A) Selection
By defining boundaries for valid values, domains help (B) Intersection
uphold data integrity and accuracy across the entire (C) Projection
database environment, preventing inconsistent or (D) Cartesian Product
invalid entries or future discrepancies.  Ans
2. Which key uniquely identifies each record in a relational (B) Intersection
table, ensuring no duplicates? Classical relational algebra includes selection,
(A) Foreign key projection, union, set difference, and Cartesian product
(B) Alternate key as core operations. Intersection, although commonly
(C) Primary key used in extended relational algebra, is not part of the
(D) Candidate key fundamental set. Recognizing these foundational
Ans operations helps students comprehend how queries
manipulate and derive new relations in databases.
(C) Primary key
A primary key is a designated attribute or combination 5. When comparing a candidate key and a primary key,
of attributes that uniquely identifies every row in a table, which statement is most accurate?
prohibiting duplicates. This uniqueness requirement (A) A candidate key always references another table
maintains record distinction, thereby guaranteeing (B) A primary key cannot ever be unique
accurate referencing. Without a primary key, identifying (C) Every primary key is a candidate key, but not every
and managing rows would become error-prone, candidate key is chosen as the primary key
jeopardizing data consistency and reliability. (D) Candidate keys and primary keys must both appear
in other tables
3. Why is a database often considered more efficient than a
traditional file system?  Ans
(A) It uses more physical storage (C) Every primary key is a candidate key, but not every
(B) It integrates data redundantly candidate key is chosen as the primary key
(C) It centralizes data control and reduces Candidate keys are potential primary keys that uniquely
inconsistencies identify tuples. Once one candidate key is formally
(D) It only stores small files designated as the primary key, the others remain
Ans alternate keys. All candidate keys share uniqueness, but
only one is ultimately selected as the table’s primary key,
(C) It centralizes data control and reduces inconsistencies preserving distinct records and data integrity.

Downloaded from www.mcqgpt.com


page 104 CUET UG Computer Science

6. Which SQL command is used to remove a table structure 1. SELECT


along with its data from a database? 2. FROM
(A) DELETE 3. ORDER BY
(B) ALTER TABLE 4. WHERE
(C) DROP TABLE (A) 1 -> 2 -> 3 -> 4
(D) TRUNCATE (B) 2 -> 1 -> 3 -> 4
Ans (C) 1 -> 2 -> 4 -> 3
(D) 2 -> 4 -> 1 -> 3
(C) DROP TABLE
DROP TABLE permanently deletes a table’s structure  Ans
and its data from the database. Unlike DELETE, which (C) 1 -> 2 -> 4 -> 3
removes rows but leaves the structure intact, DROP A typical SQL query is interpreted in the sequence:
TABLE eradicates the entire object. This distinction SELECT to identify columns, FROM to specify tables,
matters because once dropped, the table and its schema WHERE to filter rows, and ORDER BY to sort the
definitions cannot be recovered without recreating final output. Although the conceptual order differs
them. from certain internal optimizations, this arrangement
accurately represents the conventional top-down SQL
7. Which MySQL function returns the current date and logic.
time?
(A) CURRENT_DATE() 10. Which of the following statements about SQL data
(B) NOW() definition (DDL) are correct?
(C) TIME() 1. CREATE TABLE defines a new table
(D) DATE() 2. DROP TABLE removes only data but retains
Ans structure
3. ALTER TABLE modifies an existing table
(B) NOW() 4. DDL commands do not affect database schema
NOW() retrieves the precise date and time at the (A) 1 and 3 only
moment of query execution. It yields both the date (B) 2 and 4 only
portion (year, month, and day) and the time portion (C) 1, 2, and 3
(hours, minutes, seconds). This function is particularly (D) 1 and 4 only
useful for timestamping records or generating real-time
logs within a MySQL environment.  Ans
(A) 1 and 3 only
8. How does the GROUP BY clause enhance data retrieval CREATE TABLE introduces a fresh structure in
in SQL? the schema, and ALTER TABLE adjusts an existing
(A) It deletes duplicate rows from the table structure. DROP TABLE removes both data and
(B) It segments query results based on unique column structure. Consequently, statement 2 is incorrect, since
values DROP TABLE deletes the entire table, and statement 4
(C) It limits the rows returned to only one is incorrect, as DDL commands inherently reshape the
(D) It automatically updates all columns database schema.
Ans
11. Which of the following is NOT a valid MySQL text
(B) It segments query results based on unique column function?
values (A) UCASE()
GROUP BY partitions the output into subsets according (B) RTRIM()
to the distinct values in one or more columns. By (C) INSTR()
organizing results in logical groups, it enables the use (D) TTYPE()
of aggregate functions like COUNT, SUM, or AVG
on each subset. This grouping mechanism simplifies  Ans
summarizing data and deriving meaningful insights. (D) TTYPE()
Common MySQL text functions include UCASE() for
9. Arrange the following SQL clauses in the correct order uppercase conversion, RTRIM() for trimming trailing
of execution:

Downloaded from www.mcqgpt.com


PRACTICE PAPER 11

spaces, and INSTR() for locating substrings. There Options:


is no native function named TTYPE() in MySQL. (A) 1-c, 2-d, 3-b, 4-a
Identifying valid functions is essential for accurate (B) 1-d, 2-c, 3-a, 4-b
string manipulation and avoiding errors during query (C) 1-b, 2-a, 3-d, 4-c
execution or application development. (D) 1-a, 2-b, 3-c, 4-d

12. Which SQL feature best ensures consistent updates  Ans


across linked tables? (A) 1-c, 2-d, 3-b, 4-a
(A) Stored routines A router routes data according to IP addresses, while
(B) Foreign keys with referential integrity a switch directs frames within the local network.
(C) Using only one table for all data A repeater boosts weakened signals, and a gateway
(D) Replicating data in each table permits intercommunication between networks
Ans running different protocols. Proper device usage ensures
efficient, reliable data transfer and connectivity across
(B) Foreign keys with referential integrity diverse network environments.
Foreign keys link related data across tables. By
enforcing referential integrity, the database prevents 15. Match each topology in Column A with its description
invalid inserts, updates, or deletions that would break in Column B:
these relationships. This ensures that changes in one
Column A Column B
table propagate meaningfully, guaranteeing consistent,
accurate data while reducing redundancy and protecting 1. Star a. Nodes form a closed
against orphaned or mismatched records. loop
2. Bus b. All nodes connect to a
13. Which operator combines the output of two SELECT central hub
statements and removes duplicates in SQL? 3. Ring c. Each node may
(A) UNION ALL have multiple direct
(B) INTERSECT connections
(C) UNION
4. Mesh d. All devices share a single
(D) JOIN
communication line
Ans
Options:
(C) UNION (A) 1-b, 2-d, 3-a, 4-c
UNION unifies result sets from multiple SELECT (B) 1-a, 2-b, 3-c, 4-d
statements, discarding redundant rows. It differs (C) 1-c, 2-d, 3-b, 4-a
from UNION ALL, which retains duplicates, and (D) 1-d, 2-a, 3-b, 4-c
INTERSECT, which returns common rows. JOIN
 Ans
merges columns from two tables. Recognizing these
distinctions helps produce the desired dataset without (A) 1-b, 2-d, 3-a, 4-c
unintended duplication or omitted entries. A star topology focuses each link on a central hub or
switch. A bus topology employs one cable that all
14. Match each network device in Column A with its nodes share. A ring topology arranges nodes in a loop
primary function in Column B: structure, while a mesh offers multiple paths for data.
Column A Column B Understanding these layouts aids in designing robust
network architectures.
1. Router a. Connects multiple
networks using 16. Match the following protocols in Column A with their
different protocols primary function in Column B:
2. Switch b. Regenerates signals
Column A Column B
3. Repeater c. Forwards data based
1. HTTP a. Governs packet
on IP addresses
addressing and routing
4. Gateway d. Filters and forwards
2. FTP b. Facilitates file transfers
frames within a LAN

Downloaded from www.mcqgpt.com


page 106 CUET UG Computer Science

18. Arrange these phases of networking evolution in


3. IP c. Delivers web pages
chronological order:
4. SMTP d. Sends and receives
1. ARPANET
email
2. Emergence of Email
Options: 3. Introduction of the World Wide Web
(A) 1-c, 2-b, 3-a, 4-d 4. Widespread adoption of Broadband
(B) 1-d, 2-a, 3-b, 4-c (A) 2 -> 1 -> 3 -> 4
(C) 1-b, 2-c, 3-d, 4-a (B) 1 -> 2 -> 3 -> 4
(D) 1-a, 2-d, 3-c, 4-b (C) 3 -> 1 -> 2 -> 4
Ans (D) 1 -> 3 -> 2 -> 4
(A) 1-c, 2-b, 3-a, 4-d  Ans
HTTP controls the transfer of web pages, while FTP (B) 1 -> 2 -> 3 -> 4
is designed for file uploads and downloads. IP is Networking began with ARPANET’s creation in the
responsible for addressing and routing packets across late 1960s, followed by the development of email in
networks. SMTP manages the sending and receiving the 1970s. The World Wide Web emerged in the early
of email messages. Each protocol specializes in distinct 1990s, revolutionizing global information sharing,
tasks that enable seamless online communication. and widespread broadband adoption took off in the
2000s, providing faster, more reliable internet access to
17. Match the following terms in Column A with their
everyday users.
correct definitions in Column B:
Column A Column B 19. Match each built-in Python exception in Column A
with its description in Column B:
1. MAC address a. Hardware address
assigned to network Column A Column B
interfaces 1. ZeroDivisionError a. Occurs when
2. LAN b. Interconnects local a function gets
network with external an argument of
networks incorrect type
3. Router c. Connects multiple 2. ValueError b. Arises from dividing
LANs or WANs, by zero
directing data packets 3. TypeError c. Triggered when a file
4. Gateway d. Small network operation fails due to
confined to a limited missing file
area 4. FileNotFoundError d. Raised when a
Options: function receives an
(A) 1-a, 2-d, 3-c, 4-b argument of correct
(B) 1-d, 2-a, 3-b, 4-c type but improper
(C) 1-b, 2-c, 3-a, 4-d value
(D) 1-c, 2-d, 3-b, 4-a Options:
Ans (A) 1-b, 2-d, 3-a, 4-c
(B) 1-a, 2-c, 3-d, 4-b
(A) 1-a, 2-d, 3-c, 4-b
(C) 1-d, 2-b, 3-c, 4-a
A MAC address uniquely identifies a device on the data
(D) 1-c, 2-a, 3-b, 4-d
link layer. A LAN covers a small, localized geographic
area. A router interconnects multiple networks by  Ans
directing packets toward their destinations, and a (A) 1-b, 2-d, 3-a, 4-c
gateway often bridges distinct network environments. ZeroDivisionError arises from division by zero.
These elements form the backbone of reliable data ValueError indicates an inappropriate argument value
communication. despite correct type. TypeError signals a mismatch in
expected data type, and FileNotFoundError emerges

Downloaded from www.mcqgpt.com


PRACTICE PAPER 11

when attempting to open or manipulate a nonexisting (C) 2 and 3 only


file. Recognizing these exceptions aids in writing robust (D) 3 and 4 only
and error-resistant Python code.  Ans
20. Which statements are TRUE about Python’s try-except- (B) 1, 2, and 4
else structure? Binary file tasks in Python often involve pickle.
1. else runs only if no exception occurs dump() and pickle.load() for object serialization and
2. except catches all errors automatically deserialization. Opening a file with ‘rb’ also signifies
3. Multiple except blocks can follow one try block reading in binary mode. Meanwhile, writeText() is
4. else executes before except blocks not a standard method for binary files. Recognizing
(A) 1 and 3 appropriate modes and functions avoids corrupted data
(B) 2 and 4 and ensures smooth file interactions.
(C) 1, 2, and 3
(D) 1, 3, and 4 23. Identify the TRUE statements about stacks:
1. They follow FIFO
Ans 2. PUSH adds an item to the top
(A) 1 and 3 3. POP removes the topmost item
In Python, the else clause in a try-except-else block 4. They follow LIFO
executes solely when no exceptions are raised within (A) 1, 2, and 3
the try section. You can define multiple except blocks (B) 2, 3, and 4
to catch different exceptions. However, except does not (C) 1 and 4 only
capture every possible error by default, and else does not (D) 1, 2, 3, and 4
precede the except clauses.  Ans
21. Regarding Python file operations, which statements are (B) 2, 3, and 4
CORRECT? Stacks rely on a Last-In, First-Out discipline (LIFO),
1. ‘r’ mode opens a file for reading meaning the most recently inserted element is removed
2. ‘wb’ mode reads text files first. PUSH places an item atop the stack, and POP
3. ‘a’ appends data to the end removes the top element. FIFO, or First-In, First-Out,
4. ‘close()’ is optional after file operations applies to queues, not stacks, making statement 1
(A) 1 and 3 only incorrect in this context.
(B) 2 and 4 only
24. Assertion (A) : Stacks are useful for evaluating postfix
(C) 1, 2, and 3
(D) 1, 3, and 4 expressions.
Reason (R) : Stacks can quickly store and retrieve the
Ans last pushed item.
(A) 1 and 3 only (A) Both (A) and (R) are true, and (R) is the correct
‘r’ mode is used to read an existing file, while ‘a’ mode explanation of (A)
appends data at the file’s end. ‘wb’ writes binary data, (B) Both (A) and (R) are true, but (R) is not the correct
not text files. Although many modern contexts handle explanation of (A)
file closure automatically, explicitly invoking close() (C) (A) is true, (R) is false
or using a with statement remains a best practice for (D) (A) is false, (R) is true
resource management.  Ans
22. Which of these Python modules or functions handle (A) Both (A) and (R) are true, and (R) is the correct
binary file operations? explanation of (A)
1. pickle.dump() Postfix evaluations systematically pop and push
2. open(‘file’, ‘rb’) operands and operators as they appear. Stacks excel
3. writeText() at retrieving the most recently pushed items, which is
4. pickle.load() exactly what postfix calculation requires. This advantage
(A) 1 and 4 only directly explains why stacks efficiently handle postfix
(B) 1, 2, and 4

Downloaded from www.mcqgpt.com


page 108 CUET UG Computer Science

expressions by reversing the typical order of operators methods. However, it is only applicable if the data is
and operands. sorted, making it unsuitable for unsorted collections.

25. Assertion (A) : Queues are suitable for breadth-first 28. Which of the following is NOT necessary for binary
traversal algorithms. search to function correctly?
Reason (R) : Queues remove elements from the rear and (A) Data in ascending or descending order
insert them at the front. (B) Calculation of a midpoint
(A) Both (A) and (R) are true, and (R) is the correct (C) Checking each element from start to finish
explanation of (A) (D) Comparing the target value with midpoint
(B) Both (A) and (R) are true, but (R) is not the correct  Ans
explanation of (A)
(C) (A) is true, (R) is false (C) Checking each element from start to finish
(D) (A) is false, (R) is true Binary search relies on dividing the search space and
focusing on one half each iteration. Consequently,
Ans checking every element from beginning to end is
(C) (A) is true, (R) is false unnecessary. Sorting the list, finding the midpoint,
Breadth-first traversal indeed uses queues to explore and comparing the target to refine the subrange are all
nodes level by level in graphs or trees. However, queue integral to the binary search process.
operations insert new elements at the rear and remove
29. Which sorting method repeatedly compares adjacent
items from the front, maintaining FIFO order. The
reason statement incorrectly reverses this process, pairs and swaps them if they are out of order?
making it false while the assertion remains true. (A) Selection Sort
(B) Insertion Sort
26. Which queue variation allows elements to be added or (C) Bubble Sort
removed from both ends? (D) Merge Sort
(A) Circular Queue  Ans
(B) Priority Queue
(C) Deque (C) Bubble Sort
(D) Static Queue Bubble Sort checks neighboring elements and swaps
them when out of sequence, effectively bubbling larger
Ans or smaller values toward the list’s end with each pass.
(C) Deque Despite its simplicity, it is inefficient for large datasets.
A deque, short for double-ended queue, enables insertion Selection Sort locates the minimum each pass, while
and removal operations at both the front and rear. Insertion Sort builds a sorted portion incrementally.
This flexibility makes it useful for scenarios requiring
30. Which algorithm generally performs best for partially
efficient access to both ends. In contrast, typical queues
limit enqueuing at the rear and dequeuing at the front, sorted arrays?
enforcing a strict FIFO policy. (A) Selection Sort
(B) Insertion Sort
27. What is a key advantage of binary search over sequential (C) Bubble Sort
search? (D) Quick Sort
(A) It can search unsorted data quickly  Ans
(B) It always checks all elements
(C) It discards half of the data set every iteration (B) Insertion Sort
(D) It requires more time than sequential search Insertion Sort excels when arrays are partially sorted,
as it only requires a few comparisons and shifts to
Ans place each element in the correct spot. It incrementally
(C) It discards half of the data set every iteration expands a sorted sublist. Unlike Quick Sort, which still
Binary search exploits a sorted list by repeatedly partitions extensively, or Bubble Sort, which compares
comparing the target with the midpoint, then discarding many adjacent pairs, Insertion Sort capitalizes on near-
half of the remaining data. This logarithmic reduction order.
provides significantly faster search times than linear

Downloaded from www.mcqgpt.com


PRACTICE PAPER 11

31. Which measure of central tendency is calculated by (C) Optical fiber


summing all values and dividing by the number of (D) Ethernet cable
values?  Ans
(A) Mean
(B) Median (C) Optical fiber
(C) Mode Optical fiber transmits data as pulses of light through
(D) Range specialized glass or plastic fibers, enabling high-
speed transmission over long distances. Twisted pair
Ans and coaxial cables rely on electrical signals, whereas
(A) Mean Ethernet cables can be either twisted pair or fiber-based,
The mean is found by adding up every data point, then but typical Ethernet cables do not use light for data.
dividing by the total count of those points. It represents
35. Which statement best differentiates wireless Bluetooth
an average value, serving as a simple summary of the
dataset. While easy to compute, the mean can be skewed from WLAN?
by extreme outliers, necessitating additional analyses. (A) Both have infinite range
(B) Bluetooth covers larger areas than WLAN
32. Why might the median be more informative than the (C) Bluetooth is generally used for short-range
mean for highly skewed data? connections, whereas WLAN extends coverage to
(A) It multiplies all values larger areas
(B) It accounts for only the smallest value (D) Bluetooth uses cables, while WLAN is entirely
(C) It is unaffected by extreme outliers wireless
(D) It always equals the mean  Ans
Ans (C) Bluetooth is generally used for short-range
(C) It is unaffected by extreme outliers connections, whereas WLAN extends coverage to larger
The median splits a dataset in half, with equal numbers areas
of values above and below it, making it robust against Bluetooth typically supports short distances for
outliers. A few extremely high or low data points can personal area networking, such as peripheral devices
distort the mean. By focusing on positional data rather and smartphones. WLAN (commonly Wi-Fi) covers a
than averaging, the median gives a more representative broader range suitable for homes, offices, and hotspots.
midpoint. Both are wireless technologies, but their coverage areas,
speeds, and intended use cases differ, making them
33. Which is NOT a standard measure used in data complementary rather than identical solutions.
interpretation?
(A) Mean 36. Which of the following is NOT a switching technique in
(B) Variance data communication?
(C) Mode (A) Circuit switching
(D) Exponent (B) Packet switching
Ans (C) Message switching
(D) Buffer switching
(D) Exponent
Mean, variance, and mode are standard measures for  Ans
analyzing and describing data distributions. Mean (D) Buffer switching
indicates average value, variance gauges the spread Circuit, packet, and message switching represent
of data, and mode identifies the most frequent value. primary methods for moving data across networks,
Exponent, on the other hand, is a mathematical each with distinct approaches to path establishment
operation rather than a conventional statistical measure and data handling. Buffer switching is not a recognized
for interpreting datasets. category. Buffers are temporary storage areas used
in many contexts but do not represent a fundamental
34. Which communication medium uses light signals along switching mechanism.
thin strands of glass or plastic?
(A) Twisted pair cable 37. Which type of malware replicates itself and spreads
(B) Co-axial cable without attaching to other programs?

Downloaded from www.mcqgpt.com


page 110 CUET UG Computer Science

(A) Virus (B) Using strong, unique passwords and changing


(B) Trojan horse them regularly
(C) Worm (C) Disabling all firewalls
(D) Spyware (D) Responding to unsolicited emails with personal
Ans details

(C) Worm  Ans


A worm independently replicates and distributes itself (B) Using strong, unique passwords and changing them
across networks, consuming resources or creating regularly
backdoors. Unlike a virus, it does not require host Employing complex and distinct passwords for each
program attachments. Trojan horses masquerade as account, combined with periodic updates, significantly
legitimate software, while spyware stealthily gathers user reduces the risk of credential theft. Reusing or sharing
data. Identifying worms quickly is crucial for preventing passwords makes breaches more damaging, while
large-scale network or system compromises. disabling security measures or disclosing personal
information compromises system integrity. A robust
38. Which security measure monitors incoming and password strategy is essential for protecting sensitive
outgoing traffic based on predetermined rules? data.
(A) Antivirus
(B) Firewall Direction :Carefully read the case study provided and then
(C) Anti-spam filter thoroughly answer the subsequent five questions.
(D) Cookie blocker Sunrise Public School decided to implement a robust
Ans database system to store and manage student information.
The school’s IT coordinator chose MySQL for creating
(B) Firewall tables to hold student profiles, attendance records, and
A firewall inspects data packets entering or leaving a exam scores. Each table was designed with primary keys
network, enforcing rules that determine which traffic is to uniquely identify records, while foreign keys established
allowed or blocked. By filtering suspicious connections relationships among the tables. For instance, the ‘student_
and restricting unauthorized access, firewalls form a id’ in the attendance and exam tables referenced the same
key defense layer. Antivirus tools detect malware, while primary key in the student profile table. This helped
anti-spam filters block unwanted emails and cookie maintain referential integrity and reduced redundant
blockers handle tracking cookies. data. Teachers accessed the system to enter marks and
39. How does HTTPS differ from HTTP in securing web track students’ performance over time. By leveraging
communication? SQL commands like SELECT, JOIN, and GROUP BY,
(A) It uses lower bandwidth the school administrators quickly generated summarized
(B) It encrypts transmitted data for confidentiality reports, improving decision-making and ensuring data
(C) It blocks all website cookies accuracy. Regular backups were scheduled to prevent data
(D) It only works on internal networks loss and ensure consistent availability.

Ans 41. Which key in the MySQL tables of Sunrise Public School
(B) It encrypts transmitted data for confidentiality directly references another table’s primary key?
HTTPS employs SSL/TLS encryption to protect data (A) Primary key
exchanged between clients and servers, preventing (B) Foreign key
eavesdroppers from reading sensitive information. (C) Candidate key
By contrast, HTTP sends data in clear text, leaving (D) Composite key
it vulnerable to interception. HTTPS ensures the  Ans
authenticity of the site and confidentiality of user (B) Foreign key
credentials, financial details, or personal data. A foreign key links a field in one table to the primary key
40. Which practice best helps prevent unauthorized data of another table. At Sunrise Public School, the ‘student_
access? id’ field in the attendance and exam tables references the
(A) Sharing passwords among teammates primary key in the student profile table. This relationship

Downloaded from www.mcqgpt.com


PRACTICE PAPER 11

enforces referential integrity and preserves consistent 45. Why are regular backups vital for Sunrise Public School’s
inter-table connections. database?
(A) They slow down the system
42. Which SQL command helps administrators retrieve (B) They help fetch data from multiple tables
combined information from multiple related tables? (C) They restore data if corruption or loss occurs
(A) SELECT (D) They ensure primary key uniqueness
(B) JOIN
(C) GROUP BY  Ans
(D) ORDER BY (C) They restore data if corruption or loss occurs
Ans Regular backups preserve the database state and guard
against hardware failures, software bugs, or accidental
(B) JOIN deletions. If data is lost or compromised, administrators
JOIN merges rows from two or more tables based on a can revert to the latest functional copy. In a school
related column. In the school scenario, merging student environment, reliable backups protect critical student
profiles, attendance, and exam data into a single, records, ensuring continuity and avoiding permanent,
unified result requires a JOIN clause. SELECT is used large-scale data disruption.
for choosing columns, but JOIN specifically handles
referencing rows across linked tables. Direction :Carefully read the case study provided and then
thoroughly answer the subsequent five questions.
43. How did the school minimize repetitive data across its Brighton College’s programming club tested a Python
tables? application to convert infix arithmetic expressions into
(A) By using multiple identical fields postfix notation. Club members learned that stacks
(B) By storing all information in one table are essential for holding operators while scanning
(C) Through referential integrity with foreign keys expressions from left to right. Whenever an operator with
(D) By never updating the same record lower precedence appeared, the system popped higher
Ans precedence operators first. After processing the entire
(C) Through referential integrity with foreign keys string, any remaining operators on the stack were popped
Foreign keys ensure each table references a unique and appended to the postfix string. This process made
record in the student profile, avoiding duplication of subsequent evaluations simpler, as postfix expressions
personal details. Rather than storing the same data eliminate parentheses by placing operators after operands.
repeatedly, the attendance and exam tables link back to The application also tested stack-based evaluations to
the principal record. This design saves storage space and quickly compute results by pushing numbers and then
maintains consistency among different data points. applying each operator to the top items. This project
showcased how fundamental stack operations—push and
44. Which MySQL feature can help the school produce pop—streamline expression parsing and computation in
summaries of total attendance or average marks? Python. Students discovered improved performance and
(A) Aggregate functions with GROUP BY reduced complexity using this systematic approach.
(B) TRUNCATE commands for large datasets
46. Which data structure is primarily used in the club’s
(C) DELETE statements for removing duplicates
(D) Only textual queries without any functions application for operator management?
(A) Queue
Ans (B) Stack
(A) Aggregate functions with GROUP BY (C) Linked List
GROUP BY allows grouping rows by a specified (D) Hash Table
column, enabling aggregate functions like AVG, SUM,  Ans
or COUNT for each group. In the school’s database,
grouping data by student_id or class can yield total (B) Stack
attendance or average marks. This approach simplifies A stack handles operators in infix-to-postfix conversion
generating structured summaries for informed by holding them until they can be popped in the
administrative decisions. correct precedence order. This last-in, first-out design
ensures that higher-precedence operators are resolved
first, enabling a systematic approach for generating

Downloaded from www.mcqgpt.com


page 112 CUET UG Computer Science

valid postfix expressions without parenthesis-based remain, completing the conversion and guaranteeing a
complications. valid postfix expression.

47. How does postfix notation simplify arithmetic 50. How did the club evaluate the postfix expressions once
expressions according to the case study? generated?
(A) By inserting parentheses after every operator (A) Ignoring the operator precedence
(B) By requiring explicit operator precedence rules (B) By reversing the string
(C) By placing operators after operands, eliminating (C) Using a stack to push numbers and apply operators
parentheses (D) Asking the user to insert parentheses
(D) By using multiple stacks  Ans
Ans (C) Using a stack to push numbers and apply operators
(C) By placing operators after operands, eliminating Once the postfix expression is created, the club’s
parentheses program scans each token and pushes numbers onto the
Postfix, or Reverse Polish notation, removes the stack. Whenever it encounters an operator, it pops the
need for parentheses by writing operators after their necessary operands, applies the operation, and pushes
corresponding operands. This results in fewer syntax the result back. This stack-based execution efficiently
complications and a more streamlined evaluation resolves postfix expressions without extra parentheses.
process. In the club’s application, the final expressions
no longer contain brackets, simplifying interpretation  **************

for both humans and computing systems.

48. What triggers the system to pop higher precedence


operators first?
(A) Encountering a lower precedence operator
(B) Starting the program
(C) Reading operands
(D) Converting postfix to infix automatically
Ans
(A) Encountering a lower precedence operator
When a newly scanned operator has lower precedence
than the top of the stack, the higher precedence operator
is popped first to maintain correct ordering. This
ensures that the proper operator hierarchy is respected
in the resulting postfix expression, preventing incorrect
evaluations and preserving consistent operator
precedence rules.

49. Which stack operation appends the remaining operators


to the postfix expression once the entire infix string is
processed?
(A) PUSH
(B) ENQUEUE
(C) POP
(D) SHIFT
Ans
(C) POP
After processing all tokens in the infix string, any
operators left in the stack must be popped and added to
the postfix output. Popping removes the top item from
the stack. This final step ensures no pending operators

Downloaded from www.mcqgpt.com


PRACTICE PAPER 12

PRACTICE PAPER 12

1. In a relational database model, what does a ‘tuple’ parent table. This prevents invalid entries and orphan
specifically represent? records. By linking tables through consistent references,
(A) A complete column in a table foreign keys bolster relational integrity, making data
(B) A single row containing related data values more reliable and cohesive.
(C) A structural constraint on foreign keys
4. Which of the following does NOT characterize the
(D) A data type definition
relational approach to data management?
Ans (A) Data is organized into tables (relations)
(B) A single row containing related data values (B) Each row represents a tuple
A tuple corresponds to one record or row in a relational (C) Hierarchical structure is mandatory
table, grouping related attribute values together. Each (D) Tables can be linked through keys
tuple represents a unique data entity within that relation.  Ans
By storing data in row form, the database can maintain
organized, easily searchable records that align with table (C) Hierarchical structure is mandatory
constraints. The relational model organizes information into tables,
each row forming a tuple. Relations can interconnect
2. Which type of key refers to a candidate key that is not through primary and foreign keys without requiring
chosen to be the primary key? hierarchical paths. In contrast, hierarchical databases
(A) Alternate key impose parent-child data structures. Therefore,
(B) Foreign key hierarchical organization is not a defining characteristic
(C) Composite key of the relational database model.
(D) Partial key
5. Which statement best distinguishes between a file
Ans system and a database system?
(A) Alternate key (A) File systems always use SQL, databases never do
Among the candidate keys, one is selected as the (B) Databases enforce relationships and constraints,
primary key to uniquely identify table records. The file systems generally do not
other candidate keys, which also uniquely identify (C) Databases lack concurrent access, while file systems
rows but are not chosen as the primary key, are called allow multiple users
alternate keys. They remain valid unique identifiers but (D) File systems automatically ensure data consistency
hold secondary status. across multiple files

3. Why does enforcing a foreign key constraint improve  Ans


data consistency? (B) Databases enforce relationships and constraints, file
(A) It duplicates data across tables systems generally do not
(B) It ensures matching records exist in the referenced Traditional file systems store data in separate files
table without inherent constraints or relationships. By
(C) It allows multiple primary keys in one table contrast, databases centralize information, permitting
(D) It hides all references from other tables defined relationships (e.g., foreign keys) and applying
Ans integrity rules. This difference enables enhanced
consistency, controlled redundancy, and robust multi-
(B) It ensures matching records exist in the referenced user access, making databases more suitable for complex
table data management.
A foreign key constraint forces each value in a child table
column to match an existing primary key value in the

Downloaded from www.mcqgpt.com


page 114 CUET UG Computer Science

6. Which SQL command permanently removes selected 1. CREATE TABLE


rows from a table? 2. INSERT
(A) DROP TABLE 3. SELECT
(B) DELETE 4. ALTER TABLE
(C) ALTER TABLE (A) 1 -> 4 -> 2 -> 3
(D) SELECT (B) 4 -> 1 -> 3 -> 2
Ans (C) 1 -> 2 -> 4 -> 3
(D) 2 -> 1 -> 3 -> 4
(B) DELETE
DELETE eliminates the specified rows from an existing  Ans
table while preserving the table’s structure. By contrast, (C) 1 -> 2 -> 4 -> 3
DROP TABLE removes the entire table structure and The usual workflow starts with CREATE TABLE to
its data, and ALTER TABLE modifies table definitions. define structure. Then records are added with INSERT.
SELECT merely queries the data. Proper use of DELETE ALTER TABLE may subsequently revise the table
is crucial to targeted data removal. schema. Finally, SELECT queries retrieve the data.
While real-world scenarios can vary, this sequence
7. Which of these is a valid date function in MySQL? typically depicts how a developer might progressively
(A) YEAR() build a database.
(B) TRIM()
(C) RTRIM() 10. Which statements about MySQL numeric functions are
(D) UCASE() correct?
Ans 1. POWER(x, y) raises x to the power y
2. ROUND(x, n) rounds x to n decimal places
(A) YEAR() 3. MOD(x, y) computes x multiplied by y
YEAR() extracts the year portion from a date or 4. POWER(x) calculates x squared automatically
DateTime value. TRIM(), RTRIM(), and UCASE() (A) 1 and 2 only
are text functions handling string manipulation. (B) 2 and 3 only
Recognizing MySQL’s date functions helps retrieve (C) 1, 2, and 4
specific parts of timestamps and supports date-based (D) 1, 2, and 3
calculations, filtering, and grouping in data analysis
tasks.  Ans
(A) 1 and 2 only
8. How does the HAVING clause differ from WHERE POWER(x, y) computes x^y, and ROUND(x, n) adjusts
when using aggregate functions? x to n decimals. MOD(x, y) yields the remainder when x
(A) WHERE applies to grouped data, HAVING does is divided by y, not a product. POWER(x) with a single
not argument is invalid syntax. Understanding these built-
(B) HAVING can filter results of aggregate functions, in numeric functions aids in performing mathematical
WHERE cannot operations in queries.
(C) Both can filter results after grouping
(D) HAVING runs before GROUP BY 11. Which clause does NOT exist in standard SQL?
Ans (A) GROUP BY
(B) INTERSECT
(B) HAVING can filter results of aggregate functions, (C) HAVING
WHERE cannot (D) WHILE
WHERE filters rows before grouping, whereas HAVING
filters entire groups after aggregate functions (like  Ans
COUNT or SUM) have been calculated. Consequently, (D) WHILE
HAVING can apply conditions to the results of those GROUP BY groups rows for aggregates, HAVING filters
aggregates, making it essential for refining grouped groups after aggregation, and INTERSECT (in many
datasets based on aggregated values. SQL dialects) returns common results from two queries.
WHILE is not a standard SQL clause for queries. Some
9. Arrange the following SQL statements in the order
they’re typically used to create and manage a new table:

Downloaded from www.mcqgpt.com


PRACTICE PAPER 12

procedural extensions include looping constructs, but 4. PAN d. Usually confined to


pure SQL lacks a WHILE clause for query statements. a single building or
12. Which method is best for retrieving only distinct city small campus
names from a Students table? Options:
(A) SELECT ALL city FROM Students (A) 1-d, 2-c, 3-a, 4-b
(B) SELECT city FROM Students WHERE city = (B) 1-c, 2-a, 3-d, 4-b
DISTINCT (C) 1-d, 2-b, 3-a, 4-c
(C) SELECT DISTINCT city FROM Students (D) 1-a, 2-d, 3-c, 4-b
(D) SELECT UNIQUE city FROM Students  Ans
Ans (A) 1-d, 2-c, 3-a, 4-b
(C) SELECT DISTINCT city FROM Students A LAN typically covers a single building or small
SELECT DISTINCT eliminates duplicate values from campus. A WAN reaches across very large distances,
the result set, returning only one instance of each potentially worldwide. A MAN spans a metropolitan
distinct city name. While UNIQUE is recognized by area or big campus, while a PAN remains limited to a
some SQL dialects, DISTINCT is standard. WHERE few meters around an individual. Recognizing these
city = DISTINCT is invalid syntax, and SELECT ALL scopes helps design appropriate networks.
city simply returns every city row, including duplicates.
15. Match each data transmission medium in Column A
13. Which set operation returns rows that appear in both with its description in Column B:
result sets? Column A Column B
(A) UNION
1. Twisted pair cable a. Uses light through
(B) UNION ALL
glass or plastic fibers
(C) INTERSECT
(D) EXCEPT 2. Coaxial cable b. Employs two insulated
copper wires twisted
Ans
together
(C) INTERSECT 3. Optical fiber c. Transmits via high-
INTERSECT yields the intersection of two queries, frequency radio waves
listing only rows common to both. UNION merges
4. Microwave d. Single copper
all rows, while UNION ALL also retains duplicates.
conductor with metal
EXCEPT (or MINUS in some SQL variants) returns
shielding
rows from the first query that do not appear in the
second. Recognizing each operator avoids incorrect Options:
merges. (A) 1-b, 2-d, 3-a, 4-c
(B) 1-d, 2-b, 3-c, 4-a
14. Match each network type in Column A with its defining (C) 1-a, 2-c, 3-b, 4-d
characteristic in Column B: (D) 1-c, 2-a, 3-d, 4-b
Column A Column B  Ans
1. LAN a. Covers a city or large (A) 1-b, 2-d, 3-a, 4-c
campus Twisted pair cables have two copper wires twisted to
2. WAN b. Interconnects devices reduce electromagnetic interference. Coaxial cables
over very short range incorporate a central conductor, insulating layer, and
(e.g., personal devices) metallic shield. Optical fiber uses pulses of light, offering
3. MAN c. Spans large high bandwidth. Microwave communication leverages
geographic areas, directional, high-frequency radio waves for wireless
often countrywide or data transmission over line-of-sight distances.
worldwide 16. Match each network topology term in Column A with
its primary advantage in Column B:

Downloaded from www.mcqgpt.com


page 116 CUET UG Computer Science

Column A Column B (A) 1-a, 2-d, 3-c, 4-b


A hub sends incoming signals to every port, wasting
1. Mesh a. Easy to add new nodes
bandwidth. A switch uses MAC addresses for directing
without affecting
frames within a LAN. A router uses IP addresses to
others
forward packets between networks, and a firewall
2. Ring b. Minimal cabling; enforces security policies on traffic flows. Each device
simple structure but a addresses unique network requirements.
single backbone
3. Bus c. High redundancy and 18. Put these historical networking events in chronological
multiple paths to each order:
node 1. Introduction of Ethernet
4. Star d. Data travels in one 2. Birth of the World Wide Web
circular direction, 3. Development of Wi-Fi (802.11 standard)
reducing collisions 4. Launch of social networking platforms
(A) 2 -> 1 -> 3 -> 4
Options: (B) 1 -> 2 -> 3 -> 4
(A) 1-c, 2-d, 3-b, 4-a (C) 3 -> 1 -> 2 -> 4
(B) 1-a, 2-b, 3-c, 4-d (D) 1 -> 3 -> 2 -> 4
(C) 1-d, 2-c, 3-a, 4-b
(D) 1-b, 2-a, 3-d, 4-c  Ans

Ans (B) 1 -> 2 -> 3 -> 4


Ethernet emerged in the 1970s, enabling local area
(A) 1-c, 2-d, 3-b, 4-a networking. The World Wide Web was introduced
A mesh topology offers numerous links between around 1990. Wi-Fi protocols (802.11) gained traction
devices, yielding high fault tolerance. A ring sends data in the late 1990s. Widespread social networking
in a loop, limiting collisions. A bus topology’s simplicity platforms appeared early 2000s onward. This sequence
arises from a single backbone. A star provides hassle- illustrates significant milestones in modern computer
free node additions by connecting each node to a central networking evolution.
hub, isolating failures effectively.
19. Assertion (A) : Using try-except blocks can prevent
17. Match each network device in Column A with its program termination.
primary characteristic in Column B: Reason (R) : If an exception is raised and not caught, the
Column A Column B Python interpreter halts execution immediately.
1. Hub a. Broadcasts data to all (A) Both (A) and (R) are true, and (R) is the correct
ports, no filtering explanation of (A)
(B) Both (A) and (R) are true, but (R) is not the correct
2. Switch b. Controls inbound/
explanation of (A)
outbound traffic based
(C) (A) is true, (R) is false
on security rules
(D) (A) is false, (R) is true
3. Router c. Forwards packets
using IP addresses  Ans
across networks (A) Both (A) and (R) are true, and (R) is the correct
4. Firewall d. Filters frames on a explanation of (A)
LAN using MAC Unhandled exceptions cause Python to stop execution.
address tables The try-except mechanism lets programmers intercept
and manage errors, preventing abrupt termination. By
Options:
catching raised exceptions, developers can perform
(A) 1-a, 2-d, 3-c, 4-b
corrective actions or user prompts, ensuring program
(B) 1-d, 2-a, 3-b, 4-c
flow continues instead of ending in an unhandled
(C) 1-b, 2-c, 3-d, 4-a
exception state.
(D) 1-c, 2-b, 3-a, 4-d
Ans

Downloaded from www.mcqgpt.com


PRACTICE PAPER 12

20. Assertion (A) : A finally block always executes in if the file is absent. Thus, ‘rb’ does not handle textual
Python, even if an exception is not caught. decoding by default.
Reason (R) : The finally block is designed for cleanup
23. Which statements about stack operations in Python are
operations regardless of success or failure.
(A) Both (A) and (R) are true, and (R) is the correct correct?
explanation of (A) 1. pop() removes the last element of a list used as a
(B) Both (A) and (R) are true, but (R) is not the correct stack
explanation of (A) 2. append() inserts a new element at the top
(C) (A) is true, (R) is false 3. The top of the stack is index 0
(D) (A) is false, (R) is true 4. LIFO principle applies
(A) 1, 2, and 4
Ans (B) 2, 3, and 4
(A) Both (A) and (R) are true, and (R) is the correct (C) 1 and 4 only
explanation of (A) (D) 1, 3, and 4
The finally block executes no matter how control leaves  Ans
the try-except statement—be it a normal exit or an
unhandled exception. It provides a place for cleanup (A) 1, 2, and 4
code, like closing files or releasing resources. Thus, it Using a list as a stack, append() adds an item at the end
operates regardless of whether the exception is caught (top), while pop() removes the last element. The top of
or not. the stack is typically the final index, not index 0. Stacks
use Last-In, First-Out, meaning the most recently added
21. Which file access mode in Python opens a binary file for item is removed first.
appending?
24. How does prefix notation differ from postfix notation in
(A) ‘a’
(B) ‘ab’ expression evaluation with a stack?
(C) ‘w’ (A) Prefix places operators after operands, postfix
(D) ‘wb’ places them before
(B) Both place operators at the end
Ans (C) Prefix places operators before operands, postfix
(B) ‘ab’ places them after
In Python, ‘ab’ opens a binary file for appending, letting (D) Neither prefix nor postfix uses operators in the
you add new data at the end. ‘a’ opens a text file for expression
appending, while ‘w’ and ‘wb’ overwrite existing files  Ans
before writing. Understanding these modes prevents
unintentional data loss and ensures proper handling of (C) Prefix places operators before operands, postfix
text versus binary content. places them after
In prefix (Polish) notation, each operator precedes its
22. Which statement is NOT true about reading files in operands, while postfix (Reverse Polish) notation follows
Python? them. Both formats allow stacks to manage evaluations
(A) ‘r’ mode opens a file for reading by default systematically. However, their scanning sequences
(B) read() returns the entire file content as a string differ, and code must handle the operator-operand
(C) A FileNotFoundError can occur if the file does not order properly for correct arithmetic interpretation.
exist
25. Which statements about queues are accurate?
(D) Using ‘rb’ mode automatically decodes text
encoding 1. They follow FIFO
2. enqueue() places an element at the rear
Ans 3. dequeue() removes an element from the front
(D) Using ‘rb’ mode automatically decodes text encoding 4. They follow LIFO
Opening a file in ‘rb’ reads bytes, not automatically (A) 1, 2, and 4
decoded text. Developers must manually decode if (B) 1, 2, and 3
needed. ‘r’ is the default read mode, read() pulls the (C) 2, 3, and 4
entire content, and Python can raise FileNotFoundError (D) 1, 3, and 4

Downloaded from www.mcqgpt.com


page 118 CUET UG Computer Science

Ans  Ans
(B) 1, 2, and 3 (C) Retrieving items from an unsorted data list
Queues operate under First-In, First-Out ordering, Binary search requires sorted input to systematically
with enqueue() adding items at the rear and dequeue() halve the search space. In an unsorted list, comparing
removing them from the front. This design ensures against a midpoint doesn’t help discard irrelevant
the earliest element inserted is the first served. LIFO is portions. Thus, for unsorted data, binary search fails to
characteristic of stacks, not queues, making statement 4 provide meaningful shortcuts, making linear search or
incorrect in this context. sorting the data first the better approach.

26. Assertion (A) : A circular queue reuses empty positions 29. Which sorting algorithm repeatedly finds the minimum
from the front after items are dequeued. element and places it at the beginning of the list?
Reason (R) : In a simple linear queue, the front pointer (A) Insertion Sort
only moves forward, eventually wasting space. (B) Bubble Sort
(A) Both (A) and (R) are true, and (R) is the correct (C) Selection Sort
explanation of (A) (D) Merge Sort
(B) Both (A) and (R) are true, but (R) is not the correct  Ans
explanation of (A)
(C) (A) is true, (R) is false (C) Selection Sort
(D) (A) is false, (R) is true Selection Sort scans the list to find the minimum
element, swapping it with the element at the current
Ans start position. It then repeats this process for the
(A) Both (A) and (R) are true, and (R) is the correct subsequent positions, gradually building a sorted sublist
explanation of (A) at the beginning. This approach is straightforward but
In a standard linear queue, once items are dequeued not highly efficient for large datasets.
from the front, that space can’t be reused unless the
30. Which sorting method is often praised for its average
queue is reset. A circular queue logically connects
the end to the front, making it possible to reuse freed efficiency in practical scenarios, using a divide-and-
locations. This solves the space-wasting limitation of conquer approach?
linear queues. (A) Merge Sort
(B) Bubble Sort
27. Why might sequential (linear) search be preferred over (C) Quick Sort
binary search in certain situations? (D) Selection Sort
(A) It always runs faster for large lists  Ans
(B) It does not require sorted data
(C) It is less intuitive to implement (C) Quick Sort
(D) It avoids searching the entire list Quick Sort typically performs well with random data
due to its average O(n log n) complexity. It partitions the
Ans list around a pivot, recursively sorting sublists. Though
(B) It does not require sorted data its worst-case can be O(n^2), proper pivot selection and
Linear search simply checks each element in turn, average conditions often make it faster in practice than
so it can be applied to unsorted data sets. Binary other straightforward sorts.
search, though more efficient on sorted lists, becomes
31. Which measure indicates the most frequently occurring
inapplicable if elements are not in ascending or
descending order. For smaller or unsorted lists, linear value in a data set?
search may be simpler and sufficient. (A) Mean
(B) Median
28. Which situation does NOT indicate a good use of binary (C) Mode
search? (D) Variance
(A) Searching for a name in a sorted phonebook  Ans
(B) Looking up a value in a sorted array
(C) Retrieving items from an unsorted data list (C) Mode
(D) Performing repeated lookups in a static sorted list

Downloaded from www.mcqgpt.com


PRACTICE PAPER 12

The mode identifies the most common or frequently 10 meters. This makes it ideal for peripherals like
appearing data point. Unlike the mean or median, headphones, speakers, or keyboards. Wi-Fi covers larger
which focus on central tendencies, the mode highlights areas, Ethernet is wired, and satellite communication is
repetition. For instance, if 10 appears more than any designed for very long-range data transmission.
other number, then 10 is the mode. Some distributions
35. Which statement best contrasts circuit switching with
may have multiple modes or none.
packet switching?
32. Why is standard deviation critical for understanding (A) Both require a dedicated communication path
data spread? (B) Circuit switching dynamically breaks data into
(A) It classifies data into categories packets
(B) It measures the central average of data (C) Packet switching does not need a dedicated path,
(C) It quantifies how much individual values deviate whereas circuit switching does
from the mean (D) Packet switching only applies to voice calls
(D) It automatically sorts the data  Ans
Ans (C) Packet switching does not need a dedicated path,
(C) It quantifies how much individual values deviate whereas circuit switching does
from the mean Circuit switching establishes an exclusive channel for
Standard deviation calculates how far data points the call’s duration, as in traditional telephone networks.
typically lie from the average. A small standard deviation Packet switching segments data into packets that may
indicates tightly clustered values around the mean, while traverse different paths, optimizing network usage.
a large one reveals widespread variation. This measure This fundamental difference influences bandwidth
aids in judging consistency, identifying outliers, and allocation, cost, and flexibility in data communication
comparing variability across different datasets. systems.

33. Which of the following is NOT a standard statistical 36. Which of the following is NOT a common data
approach for measuring variability? communication protocol?
(A) Standard deviation (A) HTTP
(B) Range (B) IP
(C) Variance (C) SMTP
(D) Logarithm (D) FMT
Ans  Ans
(D) Logarithm (D) FMT
Measures like standard deviation, range, and variance HTTP handles web requests, IP deals with addressing
gauge how widely data points spread around the mean and routing, and SMTP manages email transfers.
or among themselves. A logarithm is a mathematical FMT is not recognized as a core protocol for data
transformation often used for scaling data but is not itself communication. Using established protocols ensures
a measure of variability. Hence, it does not inherently standardized communication procedures, compatibility
indicate data dispersion. across devices, and seamless data exchange over
networks.
34. Which wireless technology commonly operates over
short distances to connect devices such as smartphones 37. Which malicious program often disguises itself as
and headphones? legitimate software but carries harmful code?
(A) Bluetooth (A) Trojan horse
(B) Wi-Fi (B) Worm
(C) Ethernet (C) Spyware
(D) Satellite (D) Rootkit
Ans  Ans
(A) Bluetooth (A) Trojan horse
Bluetooth is a low-power, short-range standard for A Trojan horse pretends to be useful or benign but
exchanging data over distances typically within executes malicious operations once installed. Worms

Downloaded from www.mcqgpt.com


page 120 CUET UG Computer Science

replicate themselves, spyware gathers user data, and (C) Implementing file access permissions and regular
rootkits hide an intruder’s presence. Users must remain audits
cautious about unfamiliar downloads and employ Correct access permissions ensure only authorized
security software to detect such disguised threats. users can view or change sensitive data. Regular audits
detect anomalies and unauthorized access attempts.
38. Which term describes attempts to obtain sensitive Persistently staying logged in, saving passwords in
information by masquerading as a trustworthy entity plain text, or keeping default credentials compromise
via email or messaging? security, exposing networks to breaches or misuse by
(A) Phishing malicious actors.
(B) Pharming
(C) Spoofing Direction :Carefully read the case study provided and then
(D) DDoS thoroughly answer the subsequent five questions.
Ans Hillside University deployed MySQL to manage course
registrations and faculty assignments. Each student record
(A) Phishing featured a unique primary key, while a foreign key in the
Phishing attacks trick users into revealing credentials or enrollment table ensured valid references to each student.
financial details through fraudulent messages or websites For instance, a student_id was used to track individual
that appear authentic. Pharming redirects users to fake progress across various courses. Administrators set up
sites, spoofing alters data packets or email headers, and tables for courses, faculty, and classroom resources, linking
DDoS overloads servers. Recognizing phishing attempts them with carefully defined relationships. The university
helps prevent confidential information from being relied on SQL queries to handle tasks like checking how
exposed. many students were enrolled in each course and how many
39. How do antivirus programs typically detect malicious courses a single faculty member led. Regular backups were
software? maintained to safeguard critical academic data. This
(A) By matching code against a database of known database-driven approach accelerated the registration
signatures and using heuristic checks process, minimized data entry errors, and provided real-
(B) By monitoring only the memory usage in real time time enrollment statistics, all while ensuring strict data
(C) By blocking every incoming file with no scanning consistency across multiple tables and relationships.
(D) By allowing all scripts to run unrestricted 41. Which table likely contains a foreign key pointing to the
Ans primary key in the student table?
(A) By matching code against a database of known (A) Student table itself
signatures and using heuristic checks (B) Faculty table
Antivirus software examines data against a library of (C) Enrollment table
known malware signatures and also uses heuristic (D) Classroom resources table
algorithms to identify previously unknown or modified  Ans
threats. Real-time scanning monitors file actions, (C) Enrollment table
memory, and network activities. Blocking everything In Hillside University’s setup, the enrollment table
would hamper normal operations, while unrestricted references the student table’s primary key to link each
script execution would risk undetected malware record to the correct student. This guarantees that
infiltration. no invalid student entries appear in enrollments. The
40. Which action best preserves the security of sensitive faculty and classroom resources tables serve different
data on a shared network? purposes, so their foreign keys typically point elsewhere.
(A) Leaving user accounts logged in constantly 42. Why did the university regularly back up the database?
(B) Storing all passwords in a visible text file (A) To slow down the system
(C) Implementing file access permissions and regular (B) To run multiple SELECT queries simultaneously
audits (C) To avoid data loss in cases of hardware failure or
(D) Allowing default admin/admin credentials mistakes
Ans (D) To prevent the creation of new faculty records
 Ans

Downloaded from www.mcqgpt.com


PRACTICE PAPER 12

(C) To avoid data loss in cases of hardware failure or faculty member


mistakes (D) It hid the number of courses from administrators
Regular database backups protect against unexpected  Ans
events like hardware malfunctions, accidental deletions,
or corruption. Recovery from a backup minimizes (B) It allowed immediate insights for scheduling or
downtime and preserves vital academic information. resource allocation
Without backups, the university could lose student Real-time enrollment data gives administrators up-
enrollment details and course records, severely to-date numbers on course capacity, faculty loads,
disrupting registration, scheduling, and reporting and classroom needs. Swift adjustments can be made
processes. if certain classes fill quickly or if resource constraints
appear. This agile decision-making enhances overall
43. Which key in the student table ensures each record is efficiency and supports prompt, data-driven policy in
uniquely identifiable? course management.
(A) Candidate key
(B) Primary key Direction :Carefully read the case study provided and then
(C) Composite key thoroughly answer the subsequent five questions.
(D) Foreign key MetroTech Institute’s computer club developed a Python
program to simulate queue operations for handling
Ans incoming service requests. Every time a new request
(B) Primary key arrived, the system enqueued it, tagging it with a
The primary key in a student table — such as a unique timestamp. When a service agent became available, the
student ID — makes every student record uniquely oldest request in the queue was dequeued and processed.
identifiable. Unlike a foreign key, which references The club tested scenarios where high volumes of incoming
another table, the primary key stands on its own, requests stressed the queue, requiring efficient removal
guaranteeing no duplicate rows and helping to maintain of served requests. To improve performance, members
consistent relationships across tables. implemented a circular queue structure, preventing
wasted space from front pointer increments. Exception
44. How does linking tables with defined relationships handling blocks were added to manage potential errors
benefit data management? such as invalid requests or file access issues when logging.
(A) It prevents any table from having columns Overall, the project highlighted how queues streamline
(B) It ensures that only one table is ever used task allocation, ensuring fair, first-come, first-served
(C) It enforces referential integrity and reduces service distribution, and maintaining order under heavy
redundancy loads.
(D) It automatically deletes all records every day
46. What primary operation occurs when a new service
Ans
request arrives in MetroTech’s system?
(C) It enforces referential integrity and reduces (A) It is popped from the queue
redundancy (B) It is appended to the end (enqueue)
By defining relationships (e.g., through primary and (C) It is sorted by priority first
foreign keys), the database consistently maintains (D) It is discarded immediately
matching records across multiple tables. This approach
keeps data consistent, preventing orphan or duplicated  Ans
entries. Referential integrity means each foreign key (B) It is appended to the end (enqueue)
matches an existing primary key, upholding accuracy When new requests arrive, the queue mechanism adds
across interlinked tables in the system. them at the rear. This aligns with FIFO (First-In, First-
Out) logic, so earlier requests are served before later
45. What advantage did the university gain through real- ones. The club’s program tags each new request with
time enrollment statistics? a timestamp, ensuring it is processed in the order it
(A) It eliminated the student primary key requirement arrived.
(B) It allowed immediate insights for scheduling or
resource allocation 47. Why did the club opt for a circular queue
(C) It restricted all table relationships to only one implementation?

Downloaded from www.mcqgpt.com


page 122 CUET UG Computer Science

(A) To remove the concept of a front pointer entirely (B) It processes the newest request first
(B) To reuse dequeued space and prevent wasted (C) It ensures the earliest request is served before later
capacity arrivals
(C) To add priority-based ordering for each request (D) It sorts by agent preference
(D) To bypass exception handling in the main code  Ans
Ans (C) It ensures the earliest request is served before later
(B) To reuse dequeued space and prevent wasted arrivals
capacity By enqueuing new requests and serving them from the
A circular queue links the end back to the beginning, front, the system guarantees that older requests receive
letting newly enqueued items occupy previously freed attention first. This prevents newer entries from jumping
positions. Without it, a linear queue’s front pointer can ahead, modeling a fair lineup. Consequently, users are
leave unused space behind as items are dequeued. This served in the order they arrive, consistent with standard
optimization preserves memory efficiency, especially FIFO logic.
during high volumes of incoming requests.
 **************
48. Which best describes how the oldest service request is
handled once an agent becomes available?
(A) It is removed from the rear of the queue
(B) It is placed on hold
(C) It is dequeued from the front
(D) It is immediately turned into a stack
Ans
(C) It is dequeued from the front
Under FIFO policy, the earliest enqueued request resides
at the front of the queue. When a service agent is free,
that oldest request is removed (dequeued) first. This
ensures fairness and keeps processing in chronological
order, matching real-world scenarios like customer
support or scheduling tasks.

49. What role did exception handling blocks play in this


system?
(A) They eliminated the need for a queue
(B) They automatically sorted all requests
(C) They handled potential errors like invalid requests
or file access problems
(D) They disabled time-stamping altogether
Ans
(C) They handled potential errors like invalid requests
or file access problems
The club used exception handling to catch issues such
as malformed request data or errors while writing to
log files. By intercepting these exceptions, the program
avoids crashing unexpectedly, allowing developers to
either correct the anomaly or notify users, preserving
reliability under high loads and unexpected input.

50. Why does a queue-based approach promote fairness in


request handling?
(A) It discards every other request

Downloaded from www.mcqgpt.com


PRACTICE PAPER 13

PRACTICE PAPER 13

1. In the context of relational databases, which of the prevent confusion or duplication, maintaining data
following best describes a domain? integrity while enabling reliable retrieval and updates.
(A) A collection of primary keys in a table
4. Which of the following is NOT a valid MySQL numeric
(B) The permissible set of values for an attribute
(C) A special database partition for temporary tables data type?
(D) The schema definition for all tables (A) INT
(B) FLOAT
Ans (C) DOUBLE
(B) The permissible set of values for an attribute (D) WORD
A domain is the valid set of possible values that an  Ans
attribute can hold in a relational database. By restricting
the values an attribute can take, domains help maintain (D) WORD
data integrity and consistency, ensuring each attribute MySQL provides several numeric data types such as
conforms to established rules throughout the table and INT, FLOAT, and DOUBLE for handling integer and
database. floating-point values. WORD is not a numeric data
type in MySQL; it does not exist as a valid type within
2. Which SQL command is used to remove an entire table MySQL’s data definition language.
structure from the database along with its data?
5. What differentiates a DROP TABLE command from a
(A) DROP TABLE
(B) DELETE TABLE TRUNCATE TABLE command in SQL?
(C) TRUNCATE TABLE (A) DROP TABLE only removes rows but keeps
(D) REMOVE TABLE structure
(B) TRUNCATE TABLE removes structure and data
Ans permanently
(A) DROP TABLE (C) DROP TABLE removes structure and data;
The DROP TABLE command eliminates both the table TRUNCATE TABLE only removes rows
structure and its data from the database. DELETE only (D) Both remove structure and data equally
removes rows, TRUNCATE rapidly clears all rows but  Ans
keeps the structure, and REMOVE TABLE is not a valid
SQL command. Hence, DROP TABLE is the correct and (C) DROP TABLE removes structure and data;
complete removal method. TRUNCATE TABLE only removes rows
In SQL, DROP TABLE erases the table definition and its
3. In MySQL, why is the concept of a primary key critical data. TRUNCATE TABLE quickly deletes all rows but
for every relational table? retains the table’s structure for future use. They serve
(A) It allows duplicate rows for more flexibility different needs: full removal of a table or clearing rows
(B) It ensures each row can be uniquely identified efficiently while preserving schema.
(C) It prevents user access to sensitive data
6. Arrange the following network evolutions in
(D) It always improves query speed significantly
chronological order:
Ans 1. ARPANET
(B) It ensures each row can be uniquely identified 2. World Wide Web
A primary key enforces uniqueness within a table, 3. NSFNET
allowing each record to be distinctly identified. This 4. Email introduced
facilitates accurate data referencing and efficient (A) 1 → 3 → 2 → 4
relationships across multiple tables. Primary keys also (B) 4 → 1 → 3 → 2

Downloaded from www.mcqgpt.com


page 124 CUET UG Computer Science

(C) 1 → 4 → 3 → 2 (A) 1-b, 2-d, 3-c, 4-a


(D) 4 → 3 → 2 → 1 A hub (1) broadcasts signals to all ports, a switch (2)
Ans sends data only to the destination port, a router (3)
routes data using IP addresses, and a gateway (4) bridges
(C) 1 → 4 → 3 → 2 different network protocols or architectures, acting as
ARPANET emerged first (late 1960s), then email an entrance to another system.
protocols gained popularity (1970s), followed by
NSFNET’s expansion (1980s), and finally Tim Berners- 9. Match the following types of database keys (Column A)
Lee’s World Wide Web (early 1990s). This sequence with their definitions (Column B):
underscores how fundamental technologies built on
Column A Column B
each other over time.
1. Candidate Key a. A minimal set of
7. Put these sorting algorithms in the order they were attributes that can
historically introduced: uniquely identify
1. Insertion Sort records
2. Selection Sort 2. Primary Key b. A candidate key
3. Bubble Sort chosen to uniquely
4. Merge Sort identify records
(A) 3 → 2 → 1 → 4 3. Foreign Key c. A candidate key not
(B) 1 → 2 → 3 → 4 chosen as primary
(C) 3 → 4 → 1 → 2
4. Alternate Key d. A field in a table
(D) 1 → 3 → 2 → 4
referencing another
Ans table’s primary key
(B) 1 → 2 → 3 → 4 Options:
Insertion Sort emerged early (around the 1940s), (A) 1-a, 2-b, 3-d, 4-c
Selection Sort followed, Bubble Sort surfaced somewhat (B) 1-d, 2-b, 3-a, 4-c
later, and Merge Sort was formalized in the late 1940s by (C) 1-b, 2-a, 3-c, 4-d
John von Neumann. Despite close historical timelines, (D) 1-c, 2-d, 3-a, 4-b
this sequence reflects documented earliest references.
 Ans
8. Match the following networking terms (Column A) (A) 1-a, 2-b, 3-d, 4-c
with their brief descriptions (Column B): Candidate Keys (1) are minimal keys, from which the
Column A Column B Primary Key (2) is selected. Foreign Keys (3) reference
other tables’ Primary Keys, and Alternate Keys (4) are
1. Hub a. Interconnects
remaining Candidate Keys not chosen as primary. This
networks using
ensures referential integrity and clear data relationships.
different protocols
2. Switch b. Broadcasts data to all 10. Match the following Python file modes (Column A)
connected devices with their primary usage (Column B):
3. Router c. Directs data packets Column A Column B
based on IP addresses
1. r a. Append data to end of
4. Gateway d. Forwards data file
selectively to intended
2. w b. Read existing file
devices
3. a c. Write to file (overwrite
Options: if exists)
(A) 1-b, 2-d, 3-c, 4-a
4. r+ d. Read and write without
(B) 1-c, 2-d, 3-b, 4-a
truncation
(C) 1-d, 2-c, 3-a, 4-b
(D) 1-a, 2-b, 3-d, 4-c Options:
(A) 1-b, 2-c, 3-a, 4-d
Ans
(B) 1-a, 2-d, 3-b, 4-c

Downloaded from www.mcqgpt.com


PRACTICE PAPER 13

(C) 1-c, 2-a, 3-d, 4-b 4. Protocol d. Range of frequencies a


(D) 1-d, 2-b, 3-c, 4-a transmission medium
Ans can handle
(A) 1-b, 2-c, 3-a, 4-d Options:
In Python, r is for reading, w overwrites existing (A) 1-d, 2-b, 3-a, 4-c
content, a appends new data, and r+ allows both reading (B) 1-b, 2-c, 3-d, 4-a
and writing on an existing file without clearing it. Each (C) 1-c, 2-a, 3-b, 4-d
mode serves distinct use cases based on file handling (D) 1-a, 2-d, 3-c, 4-b
requirements.  Ans
11. Match the following queue operations (Column A) with (A) 1-d, 2-b, 3-a, 4-c
their description (Column B): Bandwidth denotes frequency range for data
transmission, latency refers to delay, throughput is the
Column A Column B
rate at which data is effectively processed, and a protocol
1. INSERT (Enqueue) a. Removes an element defines the rules that enable communication between
from the front systems, establishing structured data exchange.
2. DELETE (Dequeue) b. Position of the most
recent addition 13. Which statements are correct about MySQL functions?
1. POWER(x, y) returns x raised to the power of y.
3. Front c. Adds a new element
2. ROUND(x, d) rounds x to d decimal places.
at the end
3. MOD(x, y) returns the greatest integer less than x.
4. Rear d. Position of the 4. LENGTH(str) returns the length of a string.
next element to be (A) Only 1, 2, and 4
removed (B) Only 1 and 3
Options: (C) Only 2 and 4
(A) 1-c, 2-a, 3-d, 4-b (D) All 1, 2, 3, and 4
(B) 1-d, 2-a, 3-c, 4-b
 Ans
(C) 1-a, 2-c, 3-b, 4-d
(D) 1-c, 2-b, 3-a, 4-d (A) Only 1, 2, and 4
POWER calculates exponentiation, ROUND adjusts
Ans
the decimal precision, and LENGTH determines the
(A) 1-c, 2-a, 3-d, 4-b string’s character count. MOD returns the remainder
INSERT (enqueue) places a new item at the queue’s of x divided by y, not the greatest integer less than x.
rear, DELETE (dequeue) removes the front item, Front Therefore, statements 1, 2, and 4 are correct.
indicates the position of the next item to be removed,
and Rear indicates the position where the newest 14. Regarding data handling with Python’s pickle module:
element is inserted. 1. It is used primarily for text file handling.
2. It serializes Python objects to a file.
12. Match the following data communication terms 3. It can deserialize objects back into Python.
(Column A) with their definitions (Column B): 4. It automatically encrypts the data for security.
Column A Column B (A) 1, 2, and 3 are correct
(B) 2 and 3 are correct
1. Bandwidth a. Total amount of data
(C) 1, 3, and 4 are correct
successfully delivered
(D) 2, 3, and 4 are correct
over a medium
2. Latency b. Time delay in  Ans
transferring data from (B) 2 and 3 are correct
source to destination The pickle module is used to serialize and deserialize
3. Throughput c. The set of rules and Python objects, allowing them to be stored or
conventions for data transmitted in binary form. It does not encrypt data
exchange for security, and it is not for standard text file handling.
Hence, statements 2 and 3 are correct.

Downloaded from www.mcqgpt.com


page 126 CUET UG Computer Science

15. Which of the following statements about a stack are (B) 1, 2, 4, and 5 only
correct? In MySQL, NOW() returns the current date and time,
1. It follows LIFO (Last-In, First-Out) principle. YEAR() extracts the year, MONTHNAME() provides
2. PUSH operation adds an item to the top. the month’s name, and DAYNAME() gives the weekday
3. POP operation removes an item from the bottom. name. MINUTE() is valid, but as a Time function that
4. Stacks can be implemented using lists in Python. extracts minutes from a datetime, not typically listed
(A) 1, 2, and 4 are correct under basic Date-only functions.
(B) 2 and 3 are correct
18. Assertion (A) : Union operation in relational algebra
(C) 1, 3, and 4 are correct
(D) 1, 2, and 3 are correct combines all rows from two relations without duplicates.
Reason (R) : Intersection operation includes only rows
Ans present in both relations.
(A) 1, 2, and 4 are correct (A) Both (A) and (R) are true, and (R) is the correct
A stack is a LIFO structure, where PUSH adds to the top explanation of (A).
and POP removes from the top. Python lists can easily (B) Both (A) and (R) are true, but (R) is not the correct
implement stacks using append() and pop(). Statement explanation of (A).
3 is incorrect because the item is removed from the top, (C) (A) is true, but (R) is false.
not the bottom. (D) (A) is false, but (R) is true.

16. Consider the following statements about bubble sort:  Ans


1. It repeatedly swaps adjacent elements if they are in (B) Both (A) and (R) are true, but (R) is not the correct
the wrong order. explanation of (A).
2. Worst-case time complexity is O(n). The union operation merges rows from two relations
3. Best-case time complexity is O(n) when the list is while eliminating duplicates. The intersection operation
already sorted. returns only rows found in both sets. Both statements
4. It can stop early if no swaps occur in a pass. are correct but describe two separate relational algebra
(A) 1, 2, and 4 are correct operations; hence, (R) does not explain (A).
(B) 1, 3, and 4 are correct
19. Assertion (A) : In Python, using a try-except block
(C) 2, 3, and 4 are correct
(D) 1, 2, 3, and 4 are correct prevents all runtime errors.
Reason (R) : A try-except block allows programmers to
Ans catch specific exceptions and handle them gracefully.
(B) 1, 3, and 4 are correct (A) Both (A) and (R) are true, and (R) is the correct
Bubble sort repeatedly swaps adjacent out-of-order explanation of (A).
elements. Its worst-case time complexity is O(n²). (B) Both (A) and (R) are true, but (R) is not the correct
However, the best-case scenario is O(n) if the array is explanation of (A).
already sorted, and the algorithm can detect no swaps (C) (A) is false, but (R) is true.
and terminate early. (D) (A) is true, but (R) is false.

17. Which of the following are valid Date functions in  Ans


MySQL? (C) (A) is false, but (R) is true.
1. NOW() A try-except block does not eliminate every possible
2. YEAR() runtime error; some exceptions can still occur if they
3. MINUTE() are not handled. The reason statement is true, as try-
4. MONTHNAME() except enables developers to catch and manage specified
5. DAYNAME() errors. Therefore, (A) is incorrect while (R) is correct.
(A) 1, 2, 3, and 4 only
20. Which queue variation allows elements to be inserted at
(B) 1, 2, 4, and 5 only
(C) 1, 3, 4, and 5 only both front and rear?
(D) 1, 2, 3, 4, and 5 (A) Circular Queue
(B) Priority Queue
Ans (C) Double-Ended Queue (DQueue)

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


PRACTICE PAPER 13

(D) Decreasing Queue In bubble sort, each pass compares adjacent pairs across
Ans the entire list. If every pass needs to traverse almost the
entire array, the total comparisons grow as n(n-1)/2,
(C) Double-Ended Queue (DQueue) simplifying to O(n²). This quadratic behavior arises in
A double-ended queue supports insertion and deletion the worst-case or unsorted scenarios.
operations at both ends. Circular queues optimize space
usage for standard queues, while priority queues insert 24. Which search strategy is generally the most efficient for
elements based on priority, not position. Decreasing large sorted data sets?
queue is not a standard term in basic queue operations. (A) Linear Search
(B) Binary Search
21. In searching algorithms, what is the key difference (C) Fibonacci Search
between Sequential Search and Binary Search? (D) Sequential Search
(A) Sequential Search requires sorted data
(B) Binary Search does not need sorted data  Ans
(C) Binary Search repeatedly halves the search space (B) Binary Search
(D) Sequential Search uses recursion by default For large sorted datasets, binary search outperforms
Ans linear and sequential searches by repeatedly dividing
the search interval by two. While Fibonacci search is
(C) Binary Search repeatedly halves the search space also effective for specific cases, binary search remains
Binary Search relies on sorted data and methodically the standard method due to ease of implementation and
divides the search interval in half after each comparison, stable logarithmic performance.
significantly reducing comparisons. Sequential Search
checks each element linearly and does not need the 25. How does a stack differ from a queue in terms of data
data sorted. Thus, halving the search space is the major removal?
distinction. (A) Both remove data from the bottom
(B) A stack removes data from the top, while a queue
22. Which of the following is NOT a valid Python built-in removes data from the front
exception? (C) A stack removes data from the front, while a queue
(A) ValueError removes data from the rear
(B) KeyError (D) Both remove data from the top
(C) MemoryError
(D) NotFoundError  Ans

Ans (B) A stack removes data from the top, while a queue
removes data from the front
(D) NotFoundError A stack is a Last-In, First-Out structure removing
Python provides built-in exceptions like ValueError, elements from the top. A queue is First-In, First-Out,
KeyError, and MemoryError for various error removing elements from the front. This fundamental
conditions. NotFoundError is not a standard built-in difference shapes their application in scenarios requiring
Python exception. Programmers can create a similar distinct ordering of operations.
exception manually, but it does not exist by default in
Python’s exception hierarchy. 26. Which relational algebra operation returns only the
tuples present in both relations?
23. Why does bubble sort have a worst-case time complexity (A) Union
of O(n²)? (B) Intersection
(A) It always needs extra space proportional to n² (C) Set Difference
(B) It requires up to n-1 passes, each involving (D) Cartesian Product
comparisons of adjacent elements
(C) It creates n² new arrays in memory  Ans
(D) It divides the list into two halves recursively (B) Intersection
Ans The intersection operation yields the rows (tuples)
present in both relations. Union merges tuples from
(B) It requires up to n-1 passes, each involving both without repetition, set difference subtracts the
comparisons of adjacent elements

Downloaded from www.mcqgpt.com


page 128 CUET UG Computer Science

tuples of one from another, and the cartesian product 30. Which term refers to malicious software designed
forms all possible pairs of tuples from two relations. to replicate itself and spread from one computer to
1. 27. Conceptual Understanding another?
(A) Worm
27. In MySQL, which clause is used to filter groups of data (B) Trojan horse
after a GROUP BY clause has been applied? (C) Adware
(A) WHERE (D) Spyware
(B) ORDER BY
(C) HAVING  Ans
(D) DISTINCT (A) Worm
Ans A computer worm is self-replicating malware capable of
spreading independently across networks. Trojan horses
(C) HAVING deceive users into executing them, adware displays
The HAVING clause is specifically designed to unwanted advertisements, and spyware covertly gathers
filter aggregated results following a GROUP BY user information. Worms differentiate themselves by
operation. WHERE applies filters to individual rows their autonomous propagation mechanisms.
before grouping, ORDER BY sorts the result set, and
DISTINCT removes duplicate rows but does not filter 31. Which of the following is NOT a valid file access mode
grouped data like HAVING does. in Python?
(A) rw
28. Which topology connects all devices along a single (B) r
shared cable, with each device tapping into the line? (C) a
(A) Star topology (D) w+
(B) Bus topology
(C) Ring topology  Ans
(D) Mesh topology (A) rw
Ans Python supports multiple file modes, including r for
reading, w for writing (overwrite), a for appending,
(B) Bus topology and w+ for writing and reading. However, rw is not a
In a bus topology, every device attaches to one valid built-in mode identifier. Similar functionality can
continuous cable, and data signals pass through this be achieved but requires specifying proper read/write
shared medium. Star topology uses a central hub or modes like r+ or w+.
switch, ring topology connects devices in a loop, and
mesh topology interlinks devices with multiple direct 32. Which exception is raised when a sequence subscript is
paths. out of range in Python?
(A) NameError
29. Which of these is NOT a recognized switching technique (B) TypeError
in data communication? (C) IndexError
(A) Circuit switching (D) IOError
(B) Message switching
(C) Packet switching  Ans
(D) Token switching (C) IndexError
Ans Python raises IndexError when an index is outside the
valid range for a list, tuple, or string. NameError occurs
(D) Token switching when a variable is not defined, TypeError emerges when
Common switching techniques include circuit switching an operation is applied to an incompatible object type,
(dedicated path), message switching (store-and- and IOError arises with file or I/O operations.
forward of entire messages), and packet switching (data
broken into packets). Token switching is not a standard 33. Which structure is best suited for implementing
switching technique, although token passing exists as a recursive function call tracking?
channel access method in certain ring networks. (A) Queue
(B) Stack
(C) Dictionary

Downloaded from www.mcqgpt.com


PRACTICE PAPER 13

(D) Linked List  Ans

Ans (B) Median


The median is less influenced by extreme values or
(B) Stack
outliers, making it more reliable for skewed data. The
A stack naturally supports Last-In, First-Out operations,
mean can be heavily impacted by extreme outliers,
mirroring how function calls nest and return in most
while the mode identifies the most frequently occurring
programming languages. Each function call’s return
value, and standard deviation measures data dispersion
address is pushed onto the call stack, ensuring that
around the mean.
the latest function returns first. Hence, stacks enable
recursive call management efficiently. 37. In database design, why is it crucial to define a foreign
key between two related tables?
34. Why does binary search require a sorted list before
(A) To store images efficiently
execution?
(B) To enforce referential integrity between tables
(A) To store extra data in an auxiliary array
(C) To combine columns for faster indexing
(B) Because it compares middle elements only in
(D) To ignore duplicate rows automatically
ascending lists
(C) It relies on the ability to discard half of the search  Ans
space each step (B) To enforce referential integrity between tables
(D) It randomly tests indices to locate the target A foreign key ensures that data in one table is validly
Ans linked to a primary key in another, preventing orphan
records and maintaining consistent, meaningful
(C) It relies on the ability to discard half of the search
relationships. It does not guarantee faster indexing,
space each step
image handling, or automatic elimination of duplicates.
Binary search counts on the list being sorted so it can
decide which half of the data set might contain the 38. Which SQL clause is used to return unique values in a
value. Without sorting, discarding half at each iteration result set, removing all duplicates?
would be meaningless, as the target could exist in either (A) GROUP BY
partition unpredictably. (B) HAVING
(C) DISTINCT
35. How does selection sort differ from insertion sort in its
(D) UNION
fundamental operation?
(A) Selection sort swaps every adjacent pair  Ans
(B) Insertion sort searches for the largest element first (C) DISTINCT
(C) Selection sort finds the minimum element and The DISTINCT keyword in the SELECT statement
places it in sorted position ensures duplicates are removed from the output,
(D) Insertion sort never shifts elements returning only unique rows. GROUP BY arranges rows
Ans into groups, HAVING filters those groups, and UNION
can merge results from two queries while also removing
(C) Selection sort finds the minimum element and
duplicates between them.
places it in sorted position
Selection sort locates the smallest (or largest) element 39. In wireless data communication, how does Bluetooth
in the unsorted partition and swaps it into the correct differ from Wi-Fi?
position. In contrast, insertion sort systematically grows (A) Bluetooth is mainly for wide-area networks, while
a sorted sublist by inserting elements in their proper Wi-Fi is short-range
places, potentially shifting multiple items. (B) Bluetooth is typically used for low-power, short-
range connections, while Wi-Fi covers larger ranges
36. Which statistical measure best represents the central
and higher data rates
tendency of a skewed dataset with outliers?
(C) Both are equally suitable for high-volume data
(A) Mean
transfer
(B) Median
(D) Wi-Fi and Bluetooth share the same maximum
(C) Mode
transmission distance
(D) Standard Deviation
 Ans

Downloaded from www.mcqgpt.com


page 130 CUET UG Computer Science

(B) Bluetooth is typically used for low-power, short-  Ans


range connections, while Wi-Fi covers larger ranges and (B) Queue
higher data rates A queue follows the First-In, First-Out principle,
Bluetooth is designed for personal area networks (PANs), aligning with how user requests should be processed
offering shorter ranges and lower energy consumption. in a fair order. This method ensures the earliest request
Wi-Fi covers longer distances and supports faster is addressed first. Stacks, trees, and heaps follow
data throughput, suitable for LAN environments. This different structural approaches unsuitable for managing
distinction influences usage scenarios like peripheral sequential first-come, first-served operations.
pairing (Bluetooth) vs. internet access (Wi-Fi).
1. 40. Definition-Based 42. In the library’s system, a primary key for the Books table
helps achieve which core objective?
40. Which security mechanism inspects incoming and (A) Duplicate record creation
outgoing network traffic based on predefined rules, to (B) Stored procedures
block unauthorized communications? (C) Uniquely identifying each book
(A) Antivirus (D) Automatic backups
(B) Firewall
 Ans
(C) Encryption
(D) Gateway (C) Uniquely identifying each book
A primary key ensures each book record is distinct,
Ans
preventing confusion and allowing a reliable way
(B) Firewall to retrieve, update, or reference specific entries. It
A firewall monitors inbound and outbound traffic neither directly handles database backups nor defines
according to set rules, thereby preventing unauthorized procedures, but it does guarantee that no duplicate book
access or harmful data packets from passing. Antivirus records exist.
software scans files and programs for malware,
encryption scrambles data to protect confidentiality, 43. Which SQL clause would best filter results by author
and a gateway typically routes data between networks. name after grouping by genre in the library’s database?
(A) WHERE
Direction :Carefully read the case study provided and then (B) ORDER BY
thoroughly answer the subsequent five questions. (C) HAVING
The city library deployed a new computerized system (D) DISTINCT
to manage the growing collection of books and handle
 Ans
user requests effectively. The system relies on a MySQL
database to store book information, track lending (C) HAVING
details, and maintain user accounts. With multiple HAVING is used after GROUP BY to further refine
librarians accessing the database concurrently, the design group-based results. WHERE cannot filter aggregated
ensures data integrity using primary and foreign keys. group results, ORDER BY simply sorts output, and
Additionally, stack-based data structures handle the DISTINCT removes duplicate rows. Hence, HAVING is
recently accessed books feature on user dashboards, while the correct choice to apply conditions on grouped data
queue implementations manage user requests in a first- like genre.
come, first-served manner. Network connectivity allows
44. How does the recently accessed books feature function
remote access through a secure interface, demonstrating
logically if it uses a stack structure?
the significance of robust computer networking and
(A) It processes items in the order of arrival without
security protocols. Overall, the system streamlines library
removal
operations and improves user satisfaction.
(B) The earliest accessed book always appears on top
41. Which data structure likely handles the next-in-line (C) It is based on Last-In, First-Out, with the newest
user requests? accessed book on top
(A) Stack (D) It merges all books into a single queue
(B) Queue  Ans
(C) Tree
(D) Heap

Downloaded from www.mcqgpt.com


PRACTICE PAPER 13

(C) It is based on Last-In, First-Out, with the newest (C) To maintain referential integrity between related
accessed book on top data
A stack places the most recently accessed item at the A foreign key references a primary key in another
top, making that item the first to be recalled. This is table, enforcing consistent linkages across related
the essence of LIFO ordering, suitable for a recently datasets. This prevents orphaned records and preserves
accessed list, where the last accessed item is displayed meaningful relationships. It does not automatically
first. overwrite data, strictly deals with referencing, and is
unrelated to encryption layout.
45. Which networking consideration is crucial for ensuring
librarians can safely connect from remote locations? 47. Why might the startup use a stack for managing real-
(A) Using an unencrypted public network time notifications?
(B) Implementing secure protocols or VPN solutions (A) First-In, First-Out ordering suits notifications
(C) Eliminating authentication requirements perfectly
(D) Disabling firewalls for convenience (B) Latest notifications are displayed first, leveraging
Ans LIFO
(C) Stacks eliminate the oldest notification first
(B) Implementing secure protocols or VPN solutions (D) It ensures the earliest messages remain visible until
Security in remote connections typically requires read
protocols like SSH, HTTPS, or a VPN to encrypt data
and protect information from eavesdropping. Public  Ans
networks without encryption, no authentication, or (B) Latest notifications are displayed first, leveraging
firewall removal would expose library data to significant LIFO
risks. A stack uses Last-In, First-Out ordering. The most
recent notification is placed on top, so users see new
Direction :Carefully read the case study provided and then notifications first. This approach is often adopted
thoroughly answer the subsequent five questions. in alerts or pop-up notifications, where the most
A startup that offers home delivery services employs immediate items should be most visible.
Python for back-end automation and database handling.
They rely on both stacks for managing real-time 48. Which data structure is best for serving customers’
notifications and queues for organizing delivery orders. delivery orders in the sequence they arrive?
MySQL stores customer details, order statuses, and route (A) Stack
information in multiple tables, linked by foreign keys. (B) Queue
The system further utilizes searching algorithms to find (C) Tree
addresses quickly and sorting algorithms to sequence (D) Hash Table
deliveries by priority. Network connectivity and secure  Ans
protocols protect sensitive transaction data, ensuring safe
interactions between customers, delivery personnel, and (B) Queue
the central database. As the service expands, database A queue processes elements in the order they enter—
optimization, efficient data structures, and robust First-In, First-Out. This is perfect for sequential tasks
network security become even more important. like serving delivery orders by arrival time. A stack
would reverse the order, while trees and hash tables
46. What is the primary reason for using foreign keys across serve different organizational purposes unsuited to
multiple tables in the startup’s database? queue-based scheduling.
(A) To arrange data for encryption
49. Which searching method offers faster lookups if the
(B) To allow each table to share primary key values
identically addresses are already alphabetically sorted?
(C) To maintain referential integrity between related (A) Linear Search
data (B) Binary Search
(D) To overwrite existing data in other tables (C) Bubble Search
automatically (D) Sequential Search

Ans  Ans
(B) Binary Search

Downloaded from www.mcqgpt.com


page 132 CUET UG Computer Science

Binary search operates in O(log n) time, discarding half


the search space each step, but requires a sorted list.
Linear (sequential) search checks each address from the
start and has O(n) complexity, while bubble search is
not a recognized searching algorithm.

50. How can robust network security benefit this expanding


delivery service?
(A) It slows data communication speed to prevent
traffic congestion
(B) It circumvents the need for any authentication
system
(C) It protects sensitive data exchanges between
customers, delivery staff, and servers
(D) It only permits unencrypted connections for
increased compatibility
Ans
(C) It protects sensitive data exchanges between
customers, delivery staff, and servers
Ensuring strong encryption and secure protocols helps
safeguard personal details and financial data. Network
security measures—like firewalls, secure connections,
and authentication—are crucial for preventing
unauthorized access and protecting customers. Slowing
communication or bypassing encryption would
jeopardize data integrity.

 **************

Downloaded from www.mcqgpt.com


PRACTICE PAPER 14

PRACTICE PAPER 14

1. In relational databases, what is a tuple? accurate links across tables. Uniqueness constraints,
(A) A column definition within a table encryption, or database merges are separate design or
(B) A single row or record in a table security considerations.
(C) A combination of primary keys in two tables
4. Which of the following MySQL text functions does
(D) A database backup file
NOT exist?
Ans (A) UCASE()
(B) A single row or record in a table (B) MID()
In relational database terminology, each row of a table (C) LTRIM()
is called a tuple. It represents a single, ordered record. (D) CHARUPPER()
Columns are called attributes, and multiple primary  Ans
keys across different tables involve relationships, not
tuples. Backup files are separate from relational table (D) CHARUPPER()
data definitions. MySQL includes functions such as UCASE()/
UPPER(), MID(), and LTRIM() to manipulate text.
2. Which one of the following SQL commands is classified CHARUPPER() is not a recognized MySQL function.
as DDL (Data Definition Language)? The valid function to convert strings to uppercase is
(A) SELECT UCASE() or UPPER(), whereas MID() and LTRIM()
(B) UPDATE handle substring extraction and leading space removal,
(C) ALTER TABLE respectively.
(D) INSERT
5. Which statement compares stack and queue data
Ans structures accurately?
(C) ALTER TABLE (A) Both remove elements from the front
SQL’s DDL commands manage structure. ALTER (B) Stack uses LIFO; queue uses FIFO
TABLE modifies an existing table’s structure. SELECT (C) Stack uses FIFO; queue uses LIFO
is a query (DQL), UPDATE and INSERT are DML (D) Both insert elements only at one end
(Data Manipulation Language). Hence, ALTER TABLE  Ans
belongs to the Data Definition Language category,
impacting the schema rather than just the data. (B) Stack uses LIFO; queue uses FIFO
Stacks operate on a Last-In, First-Out principle,
3. Why is a FOREIGN KEY integral for linking two removing elements from the top last placed. Queues
relational tables? employ First-In, First-Out, removing elements from
(A) It enforces unique constraints on each row the front that were inserted first. They differ primarily
(B) It automatically encrypts sensitive data in how items are removed, influencing their usage
(C) It references the PRIMARY KEY in another table to scenarios.
maintain referential integrity
6. Arrange these database operations in the order they
(D) It merges distinct databases into one
typically occur in a simple scenario:
Ans 1. INSERT new records
(C) It references the PRIMARY KEY in another table to 2. CREATE a table
maintain referential integrity 3. SELECT data
A foreign key references a primary key or candidate 4. DROP the table
key in a different table, ensuring valid, consistent (A) 2 → 1 → 3 → 4
relationships. This prevents orphan data and safeguards (B) 1 → 2 → 3 → 4

Downloaded from www.mcqgpt.com


page 134 CUET UG Computer Science

(C) 2 → 3 → 1 → 4 numbers to identify partition points in the search


(D) 1 → 3 → 2 → 4 interval. Each technique suits different performance
Ans needs and data conditions.

(A) 2 → 1 → 3 → 4 9. Match the following Python exceptions (Column A)


Typically, one first creates a table (CREATE), inserts with their typical cause (Column B):
data (INSERT), retrieves or queries data (SELECT), Column A Column B
and eventually drops the table (DROP) if it is no longer 1. ZeroDivisionError a. Performing an
needed. This flow reflects a standard database lifecycle illegal operation on
from creation to deletion. the wrong data type
7. Put these Python exception handling steps in proper 2. KeyError b. Accessing a
order: dictionary with an
1. Try block executes unavailable key
2. An exception occurs 3. IOError c. Dividing by zero
3. Except block handles the error 4. TypeError d. Errors accessing a
4. Finally block executes file or stream
(A) 1 → 2 → 3 → 4 Options:
(B) 2 → 1 → 3 → 4 (A) 1-b, 2-a, 3-d, 4-c
(C) 1 → 3 → 2 → 4 (B) 1-c, 2-b, 3-d, 4-a
(D) 3 → 1 → 2 → 4 (C) 1-c, 2-d, 3-b, 4-a
Ans (D) 1-d, 2-b, 3-a, 4-c
(A) 1 → 2 → 3 → 4  Ans
The normal sequence is that Python first runs the code (B) 1-c, 2-b, 3-d, 4-a
in the try block. If an exception arises, control passes to ZeroDivisionError emerges when attempting to
the except block for handling, and regardless of whether divide by zero, KeyError occurs if a dictionary key is
an exception occurs, the finally block executes last. missing, IOError often arises from file-related issues,
and TypeError indicates using an operation on an
8. Match the following Searching methods (Column A)
incompatible data type. These specific exceptions help
with their key characteristic (Column B):
isolate and handle precise errors.
Column A Column B
10. Match the following components of computer networks
1. Sequential Search a. Divides interval using
(Column A) with their functions (Column B):
mid = (low + high)/2
2. Binary Search b. Each element is Column A Column B
checked one by one 1. Repeater a. Broadcasts data to all
3. Hashing c. Uses a hash function to ports
determine index 2. Hub b. Boosts signal to extend
4. Fibonacci Search d. Divides interval using network range
Fibonacci offsets 3. Switch c. Directs data packets to
Options: specific destinations
(A) 1-b, 2-a, 3-c, 4-d using MAC
(B) 1-c, 2-b, 3-d, 4-a 4. Router d. Routes data packets
(C) 1-d, 2-a, 3-b, 4-c between networks
(D) 1-a, 2-d, 3-c, 4-b using IP
Ans Options:
(A) 1-b, 2-a, 3-c, 4-d
(A) 1-b, 2-a, 3-c, 4-d
(B) 1-a, 2-b, 3-d, 4-c
Sequential search linearly checks elements, binary
(C) 1-c, 2-a, 3-b, 4-d
search divides by mid, hashing computes an index using
(D) 1-d, 2-c, 3-a, 4-b
a hash function, and Fibonacci search applies Fibonacci

Downloaded from www.mcqgpt.com


PRACTICE PAPER 14

Ans GROUP BY gathers rows sharing column values into


(A) 1-b, 2-a, 3-c, 4-d groups, ORDER BY arranges results, WHERE filters
A repeater regenerates signals, a hub broadcasts rows prior to grouping or aggregation, and HAVING
incoming data to all connected devices, a switch forwards filters aggregated groups after they have been formed.
frames to the correct port using MAC addresses, and Each clause manages data differently in a query
a router uses IP addresses to move packets between workflow.
different networks. Each device is essential for network
13. Which statements about a queue are correct?
functionality.
1. It is a FIFO structure
11. Match the following SQL functionalities (Column A) 2. Enqueue adds an element to the rear
with their descriptions (Column B): 3. Dequeue removes an element from the front
4. It allows random access removal
Column A Column B (A) 1, 2, and 3 are correct
1. CREATE TABLE a. Retrieves data (B) 2, 3, and 4 are correct
2. SELECT b. Removes rows (C) 1 and 4 are correct
3. DELETE c. Modifies rows (D) 1, 2, 3, and 4 are correct
4. UPDATE d. Defines a new table  Ans
structure (A) 1, 2, and 3 are correct
Options: A queue operates under First-In, First-Out. Enqueue
(A) 1-d, 2-a, 3-b, 4-c places items at the rear and dequeue removes from the
(B) 1-c, 2-d, 3-a, 4-b front. Queues do not support arbitrary removal from
(C) 1-a, 2-b, 3-c, 4-d random positions. This linear ordering ensures a fair
(D) 1-b, 2-c, 3-d, 4-a scheduling mechanism in many real-world applications.
Ans
14. Consider the following statements about DDL
(A) 1-d, 2-a, 3-b, 4-c commands:
CREATE TABLE defines a table structure, SELECT 1. CREATE TABLE creates a new table
fetches data, DELETE removes rows, and UPDATE 2. DROP TABLE deletes a table permanently
modifies existing rows. These are standard SQL 3. TRUNCATE TABLE retains table structure but
commands belonging to different language subsets but removes rows
collectively form core database interactions. 4. ALTER TABLE modifies table columns
(A) 1, 2, and 3 are correct
12. Match the following MySQL clauses (Column A) with (B) 2, 3, and 4 are correct
their usage (Column B): (C) 1, 2, and 4 are correct
Column A Column B (D) 1, 2, 3, and 4 are correct
1. GROUP BY a. Applies conditions on  Ans
individual rows (D) 1, 2, 3, and 4 are correct
2. ORDER BY b. Sorts the result set All listed statements accurately describe Data Definition
3. WHERE c. Aggregates rows by Language commands in SQL: CREATE TABLE, DROP
common values TABLE, TRUNCATE TABLE, and ALTER TABLE. They
4. HAVING d. Filters groups formed deal with table structure—creation, deletion, emptying
by an aggregate table rows without dropping structure, and modifying
columns or other schema elements.
Options:
(A) 1-c, 2-b, 3-a, 4-d 15. Which statements about MySQL DATE() and TIME()
(B) 1-a, 2-b, 3-d, 4-c functions are accurate?
(C) 1-b, 2-c, 3-a, 4-d 1. DATE() can extract the date from a datetime value
(D) 1-d, 2-a, 3-b, 4-c 2. TIME() can extract the time portion from a
Ans datetime value
3. DATE() includes hour and minute fields
(A) 1-c, 2-b, 3-a, 4-d

Downloaded from www.mcqgpt.com


page 136 CUET UG Computer Science

4. TIME() returns only the date part statement 5 is incorrect in naming, so only options 1, 2,
(A) 1 and 2 are correct 3, and 4 are correct.
(B) 1, 2, and 3 are correct
18. Assertion (A) : Selection sort uses minimal swaps
(C) 2, 3, and 4 are correct
(D) 1 and 4 are correct compared to bubble sort.
Reason (R) : Selection sort always places the correct
Ans element in its final position with each outer loop pass.
(A) 1 and 2 are correct (A) Both (A) and (R) are true, and (R) is the correct
DATE() returns only the date portion, and TIME() explanation of (A).
extracts only the time portion. Thus, statements (B) Both (A) and (R) are true, but (R) is not the correct
claiming DATE() includes hour or TIME() returns date explanation of (A).
are incorrect. MySQL separates the components neatly, (C) (A) is true, but (R) is false.
letting you isolate date or time from a combined value. (D) (A) is false, but (R) is true.
1. 16. Combination (4-Statement)  Ans
16. Regarding bubble sort, which of these statements are (A) Both (A) and (R) are true, and (R) is the correct
true? explanation of (A).
1. It is comparison-based Selection sort selects the minimum element in each pass
2. Best-case complexity is O(n) and swaps it with the element at the sorted boundary
3. Worst-case complexity is O(n²) only once. This leads to fewer swaps than bubble sort.
4. It uses a pivot for partitioning Each pass definitively places an element in its correct
(A) 1, 2, and 3 are correct location, affirming both statements.
(B) 1 and 4 are correct
19. Assertion (A) : Firewalls inspect inbound traffic only.
(C) 2, 3, and 4 are correct
(D) 1, 3, and 4 are correct Reason (R) : Firewalls filter traffic based on predefined
security rules.
Ans (A) Both (A) and (R) are true, and (R) is the correct
(A) 1, 2, and 3 are correct explanation of (A).
Bubble sort compares adjacent elements, making it (B) Both (A) and (R) are true, but (R) is not the correct
comparison-based. It has a best-case of O(n) (already explanation of (A).
sorted lists) and a worst-case of O(n²). It does not use a (C) (A) is true, but (R) is false.
pivot for partitioning; that concept typically belongs to (D) (A) is false, but (R) is true.
quicksort, not bubble sort.  Ans
17. Which of the following are valid text functions in (D) (A) is false, but (R) is true.
MySQL? Firewalls manage and filter both inbound and outbound
1. UCASE() traffic following security guidelines. The assertion that
2. LOWER() they only inspect inbound traffic is incorrect. The reason
3. MID() statement is true, as firewalls do rely on predefined rules
4. INSTR() to allow or block traffic in either direction.
5. CONCATENATE()
20. Which aggregate function in MySQL returns the
(A) 1, 2, 3, and 4 only
(B) 1, 3, 4, and 5 only number of rows in a result set, including duplicates?
(C) 1, 2, 4, and 5 only (A) SUM()
(D) 1, 2, 3, 4, and 5 (B) COUNT(*)
(C) MAX()
Ans (D) AVG()
(A) 1, 2, 3, and 4 only  Ans
UCASE() (or UPPER()), LOWER() (or LCASE()), MID()
(or SUBSTRING()), and INSTR() are valid MySQL text (B) COUNT(_)
functions. CONCAT() is the MySQL function for string COUNT(_) counts all rows in a table or query result
concatenation, not CONCATENATE(). Therefore, set, even if duplicates exist. SUM() aggregates numeric
column values, MAX() finds the highest value, and

Downloaded from www.mcqgpt.com


PRACTICE PAPER 14

AVG() computes the average. Hence, COUNT(*) is 24. Which searching method is best suited for small,
specifically used for counting total rows. unsorted lists where simplicity is preferred over speed?
(A) Binary Search
21. What is the primary goal of exception handling in (B) Sequential Search
Python? (C) Fibonacci Search
(A) To automatically correct all coding mistakes (D) Exponential Search
(B) To provide a mechanism to respond gracefully to
runtime errors  Ans
(C) To log all errors silently without user notification (B) Sequential Search
(D) To slow program execution and detect memory For small, unsorted datasets, sequential (linear) search
issues is straightforward and easy to implement, despite being
Ans O(n) in time complexity. Binary and Fibonacci searches
require data to be sorted, and exponential search is more
(B) To provide a mechanism to respond gracefully to complex, offering benefits mainly on larger datasets.
runtime errors 1. 25. Comparison/Contrast
Exception handling in Python ensures that unexpected
errors can be managed without crashing the entire 25. How does a stack differ from a double-ended queue
application. It doesn’t fix coding errors automatically (DQueue)?
nor necessarily slow the program. Properly handled (A) Both allow insertion and removal only at the front
exceptions can offer helpful messages or alternative (B) A stack is LIFO, while a DQueue allows insertions/
flows, preserving program stability. removals at both ends
(C) A DQueue supports LIFO exclusively, while a stack
22. Which of these is NOT a recognized Python file mode? uses FIFO
(A) rb (D) They function identically but have different
(B) ab terminologies
(C) xb
(D) ob  Ans

Ans (B) A stack is LIFO, while a DQueue allows insertions/


removals at both ends
(D) ob A stack follows a strict Last-In, First-Out principle with
Python supports modes like rb (read binary), ab operations constrained to the top. A double-ended
(append binary), and xb (exclusive creation in binary). queue permits adding and removing items at either
There is no built-in ob mode. Mixing text and binary front or rear. This makes them fundamentally different
modes follows specific naming (e.g., r+b), but ob alone in usage and design, although both are linear structures.
is not valid in Python’s standard file modes.
26. Which clause in SQL groups rows that have the same
23. Why is a circular queue beneficial over a normal queue values into summary rows?
implementation using an array? (A) WHERE
(A) It allows insertion at both ends (B) GROUP BY
(B) It reuses vacated space efficiently once the rear (C) HAVING
reaches the array’s end (D) ORDER BY
(C) It always sorts the queue automatically
(D) It has unlimited memory capacity  Ans

Ans (B) GROUP BY


GROUP BY arranges rows with identical column
(B) It reuses vacated space efficiently once the rear values into consolidated groups, typically for aggregate
reaches the array’s end computations (e.g., SUM, AVG). WHERE filters
A circular queue wraps around the end of the array to individual rows, HAVING filters groups after grouping,
reuse space freed at the front, avoiding the wasted space and ORDER BY sorts the result set in either ascending
issue in a normal linear array-based queue. It does or descending order.
not inherently sort, nor does it have infinite memory.
Double-ended queues handle insertions at both ends. 27. In networking, why is a MAC address unique to each
network interface card (NIC)?

Downloaded from www.mcqgpt.com


page 138 CUET UG Computer Science

(A) It is a random number generated at boot (D) The frequency of the most common value
(B) It is assigned by a router every time a device  Ans
connects
(C) It serves as a hardware identifier burned in by the (C) The average squared deviation from the mean
manufacturer Variance is calculated by averaging the squared
(D) It changes when you clear your browser’s cache differences between each data point and the mean.
This indicates how spread out or concentrated the data
Ans distribution is. It does not measure range, typical absolute
(C) It serves as a hardware identifier burned in by the deviations from the median, or mode frequency.
manufacturer
31. Which of the following is NOT an aspect of Python’s
MAC addresses are globally unique identifiers assigned
to network interfaces, encoded by manufacturers, try-except mechanism?
ensuring no two devices share the same address (A) Automatic variable declaration
within a local environment. They do not change with (B) Handling raised exceptions
router settings or browser cache and are not randomly (C) Attempting code in the try block
regenerated. (D) Optional else or finally blocks
 Ans
28. Which network topology connects each node to two
other nodes, forming a closed loop? (A) Automatic variable declaration
(A) Ring topology Python’s try-except system manages exceptions by
(B) Bus topology attempting code inside try, catching errors in except,
(C) Star topology and optionally using else or finally blocks. It does
(D) Tree topology not automatically declare variables. Variables must
be declared (assigned) before usage; the try-except
Ans mechanism is about error handling, not variable
(A) Ring topology declarations.
In a ring topology, each device has exactly two
32. Which built-in Python function is used to read text lines
neighbors, creating a continuous loop of data flow. Bus
topology relies on one central cable, star topology uses a from a file object?
central hub, and tree topology is a hierarchical blend of (A) readlines()
star and bus designs. (B) readnums()
(C) readall()
29. Which of the following is NOT a known threat to (D) readlist()
network security?  Ans
(A) Eavesdropping
(B) Trojan horse (A) readlines()
(C) Denial of Service (DoS) In Python, readlines() returns a list of all lines from
(D) Open Source an open text file. Alternatives like readline() retrieve a
single line, and read() retrieves the entire file content
Ans as a string. readnums() and readlist() are not standard
(D) Open Source built-in Python file-reading functions.
Eavesdropping, Trojan horses, and Denial of Service 1. 33. Best Answer
attacks are well-known network security threats.
33. Which type of queue is most appropriate for
Open Source typically refers to software licensing and
development methodology, not a malicious threat. implementing job scheduling where priorities must be
While open-source code can have vulnerabilities, it is respected?
not classified as a direct network security threat. (A) Circular Queue
(B) Priority Queue
30. What does the term data variance measure in a dataset? (C) Double-Ended Queue
(A) The difference between the maximum and (D) Linear Queue
minimum values  Ans
(B) The average of absolute deviations from the median
(C) The average squared deviation from the mean (B) Priority Queue

Downloaded from www.mcqgpt.com


PRACTICE PAPER 14

A priority queue arranges items based on designated The mean reveals the central tendency, and the variance
priorities, ensuring critical tasks are processed first. (or its square root, standard deviation) indicates data
Circular or linear queues follow FIFO, double-ended spread around the mean. Though other pairs can
queues allow insertion and removal at both ends, but do be useful in specific scenarios, mean-variance (or
not inherently handle differing priority levels. mean-standard deviation) is a classic combination for
quantitative analysis.
34. Why does selection sort have a time complexity of O(n²)
even though it performs fewer swaps? 37. Why is TRIM() used in MySQL text operations?
(A) It requires nested loops to find the minimum in (A) To replace characters within a string
each pass (B) To remove leading or trailing spaces
(B) It uses recursion intensively (C) To duplicate strings a specified number of times
(C) It sorts the list in place using extra arrays (D) To compare two strings for equality
(D) It creates multiple sorted sublists  Ans
Ans (B) To remove leading or trailing spaces
(A) It requires nested loops to find the minimum in TRIM() eliminates unwanted whitespace at the
each pass start or end of a string, ensuring data is clean and
Selection sort finds the smallest element by scanning all consistent. It does not handle in-string replacements,
remaining items, resulting in nested looping over the string duplication, or direct comparisons. TRIM()
data. While it performs fewer swaps than bubble sort, is particularly useful to standardize user inputs with
the process of identifying the minimum each time still potential extra spaces.
leads to O(n²) comparisons overall.
38. Which network device routes data between different
1. 35. Comparison/Contrast
networks using IP addresses?
35. How does insertion sort differ from bubble sort in its (A) Switch
approach? (B) Router
(A) Insertion sort always places the largest element at (C) Hub
the end in each pass (D) Repeater
(B) Bubble sort shifts elements backward in a partially  Ans
sorted list
(C) Insertion sort picks the next element and inserts it (B) Router
into the correct place in the already sorted sublist A router directs data packets between networks based
(D) Bubble sort’s best-case complexity is O(log n) on their IP addresses. Switches forward frames within
a local network segment using MAC addresses, hubs
Ans broadcast signals to all ports, and repeaters regenerate
(C) Insertion sort picks the next element and inserts it signals but do not handle advanced routing decisions.
into the correct place in the already sorted sublist
39. How do circuit switching and packet switching differ for
In insertion sort, each new element is compared with
elements in the sorted sublist and inserted in the data communication?
appropriate position. Bubble sort focuses on bubbling (A) Circuit switching uses store-and-forward for entire
up out-of-order elements via repeated adjacent swaps. messages, packet switching uses dedicated paths
Insertion sort’s best-case is O(n), not bubble sort’s. (B) Packet switching establishes a constant data path,
circuit switching breaks messages into packets
36. When analyzing a dataset’s central tendency and spread, (C) Circuit switching creates a dedicated channel for
which pair of statistical measures is commonly used the duration of a transmission, whereas packet
together? switching splits data into packets for transmission
(A) Mean and variance on shared channels
(B) Median and mode (D) Both rely on indefinite open connections
(C) Mode and standard deviation  Ans
(D) Range and frequency
(C) Circuit switching creates a dedicated channel for the
Ans duration of a transmission, whereas packet switching
(A) Mean and variance

Downloaded from www.mcqgpt.com


page 140 CUET UG Computer Science

splits data into packets for transmission on shared Foreign keys connect related tables by referencing a
channels primary key in another table. This ensures consistent
Circuit switching reserves a continuous path for the and valid relationships, preventing orphaned records.
entire communication, while packet switching breaks Foreign keys do not automatically remove duplicates
data into smaller units that traverse shared routes or bypass concurrency. They guarantee correct data
dynamically. This distinction significantly impacts linkage between relevant database entities.
resource usage, efficiency, and reliability.
42. Which data structure is best suited to keep a record of
40. Which security measure specifically protects data by the most recently accessed student records?
transforming it into an unreadable format, requiring a (A) Queue
key to decode? (B) Stack
(A) Antivirus (C) Tree
(B) Encryption (D) Priority Queue
(C) Firewall  Ans
(D) MAC Address
(B) Stack
Ans A stack uses Last-In, First-Out ordering. Adding a newly
(B) Encryption accessed record to the top means it becomes the first
Encryption scrambles data into an unreadable cipher item to appear when reviewing history. This approach
text, only accessible using the correct decryption key. naturally fits recently accessed functionality, where the
Antivirus detects and removes malware, a firewall filters most recently visited record sits atop the stack.
traffic based on rules, and a MAC address identifies
43. How does robust network security benefit the school’s
a network interface card. Thus, encryption ensures
confidentiality of transmitted or stored data. data handling?
(A) It automatically deletes all logs monthly
Direction :Carefully read the case study provided and then (B) It allows external access with no authentication
thoroughly answer the subsequent five questions. (C) It blocks unauthorized intrusions and protects
A local school manages student records, attendance, and sensitive information
fee transactions using a MySQL database. Various tables (D) It prevents staff from updating any records
store personal details, fee information, and attendance  Ans
logs. Relationships between these tables rely on foreign
keys to ensure data consistency. Python scripts handle (C) It blocks unauthorized intrusions and protects
day-to-day updates, using exception handling to manage sensitive information
any runtime issues during data entry or retrieval. Stacks Network security measures, such as firewalls,
are used to maintain a history of accessed records, while encryption, and secure authentication, safeguard
queues manage form submissions in a first-in, first-out confidential student data from malicious access. They
sequence. Secure connections and robust network policies do not remove legitimate logs, and they do not prohibit
help keep student data protected from external threats. authorized staff from updates. Instead, they shield the
Overall, this integrated system simplifies administration system from illegitimate external threats.
and reduces manual errors. 44. Why might queue management be useful for processing
41. Why are foreign keys used among the school’s various form submissions?
tables? (A) Submissions are handled in a Last-In, First-Out
(A) They allow adding unlimited rows in any table manner
(B) They link records across tables to maintain (B) They sort submissions alphabetically by default
referential integrity (C) They handle the earliest forms first in a First-In,
(C) They remove duplicates automatically First-Out manner
(D) They disable concurrency controls (D) They automatically merge duplicate forms

Ans  Ans

(B) They link records across tables to maintain referential (C) They handle the earliest forms first in a First-In,
integrity First-Out manner

Downloaded from www.mcqgpt.com


PRACTICE PAPER 14

A queue ensures form requests are processed in the same (C) It follows First-In, First-Out, meaning earlier tasks
order they arrive. The earliest submission in the queue are addressed first
is processed first, providing a fair sequence. It does not A queue schedules tasks in the exact sequence they
sort them alphabetically or merge duplicates. FIFO is arrive, aligning with FIFO operations. New tasks move
ideal for managing consecutive, time-based requests. to the queue’s rear, and earlier tasks exit from the front,
ensuring fairness in task scheduling and preventing
45. Which aspect of Python’s exception handling might newer tasks from overtaking previously created ones.
be most relevant if a database connection fails during
attendance updates? 47. What is the primary role of stacks in the application’s
(A) Using a try block around the connection code and undo/redo functionality?
an except block for connection-related errors (A) They require tasks to be processed in arrival order
(B) Letting the program terminate immediately (B) They store database credentials
(C) Hiding the error messages from administrators (C) They maintain a LIFO structure to revert or reapply
(D) Enabling the code to run without any error checks changes
Ans (D) They compress large files before saving

(A) Using a try block around the connection code and  Ans
an except block for connection-related errors (C) They maintain a LIFO structure to revert or reapply
By enclosing connection operations in a try block and changes
catching database-specific exceptions in an except block, Undo/redo systems often store recent operations on
Python can gracefully handle failures without crashing. a stack, reversing changes in the opposite order they
This approach informs administrators about the issue were performed. Once undone, redoing actions can
and potentially retries or logs the error, maintaining also follow the LIFO principle on a separate stack. This
system stability. approach effectively tracks recent modifications for user
convenience.
Direction :Carefully read the case study provided and then
thoroughly answer the subsequent five questions. 48. Which MySQL function can display only the month
A software firm develops an application that tracks name from a date column, such as ‘July’?
employee tasks and deadlines. The system uses MySQL (A) DAY()
to store each task’s details, including start and end dates, (B) MONTH()
which are filtered and aggregated using date functions. (C) MONTHNAME()
Data structures like queues help schedule tasks in the (D) YEAR()
order received, while stacks assist in undo/redo features.  Ans
Python exceptions are carefully handled to ensure that
if a file write fails, the app notifies users rather than (C) MONTHNAME()
shutting down unexpectedly. On the networking side, MONTHNAME() extracts and returns the full month
employees connect to the server from various locations, name, for example, July. DAY() returns day of the
secured by VPN protocols. As the system grows, the firm month, MONTH() gives the numeric month (like
continuously refines sorting algorithms for efficient data 7), and YEAR() returns the year component. Thus,
output and invests in robust network safeguards against MONTHNAME() is specifically suited to retrieving the
malicious attacks. text representation of the month.

49. Which networking measure is crucial to secure remote


46. How does a queue support scheduling tasks in the order
they are created? employee connections?
(A) It processes the newest tasks first by default (A) Disabling all firewalls
(B) It uses a Last-In, First-Out principle for each task (B) Using an open public network
(C) It follows First-In, First-Out, meaning earlier tasks (C) Employing a Virtual Private Network (VPN)
are addressed first (D) Letting employees log in with default passwords
(D) It rearranges tasks based on file size  Ans
Ans (C) Employing a Virtual Private Network (VPN)
A VPN encrypts traffic and authenticates users, enabling
secure remote connections even over public networks.

Downloaded from www.mcqgpt.com


page 142 CUET UG Computer Science

Disabling firewalls, relying on default passwords, or


using open networks exposes sensitive data to risk.
Hence, VPN solutions are central to safeguarding
remote communications.

50. Why might a specialized sorting algorithm be important


as the task database grows?
(A) It permanently deletes older tasks
(B) It ensures tasks cannot be modified
(C) It reduces the time needed to generate ordered task
lists
(D) It prevents new tasks from being added
Ans
(C) It reduces the time needed to generate ordered task
lists
Efficient sorting algorithms scale better with larger
datasets, delivering faster retrieval of sorted information.
Deleting tasks or restricting additions is not their
purpose, and they do not enforce unchangeable tasks.
Sorting is key to presenting large sets of data in an
organized manner.

 **************

Downloaded from www.mcqgpt.com


PRACTICE PAPER 15

PRACTICE PAPER 15

1. Which key in a relational database uniquely identifies in queries that require precise row-level condition
each record in a table? checks.
(A) Foreign key
4. Which of the following best describes the function of
(B) Alternate key
(C) Primary key the SELECT statement in SQL?
(D) Candidate key (A) Modifies table structure
(B) Extracts data from tables
Ans (C) Deletes rows from tables
(C) Primary key (D) Updates existing rows in tables
A primary key guarantees that each row is uniquely  Ans
identified by prohibiting duplicate values. It cannot
contain NULL and ensures entity integrity. By serving (B) Extracts data from tables
as a unique identifier, it allows developers and database The SELECT statement is used to retrieve data stored in
systems to reference a specific row accurately and one or more tables based on specified criteria. It allows
maintain clear relational connections among tables. data analysts and developers to query specific columns
and rows. This retrieval mechanism is fundamental for
2. Which relational algebra operation is used to extract analysis, reporting, and data manipulation tasks.
specific columns from a table?
5. Which SQL keyword is NOT part of the Data
(A) Union
(B) Cartesian product Manipulation Language (DML)?
(C) Projection (A) INSERT
(D) Selection (B) SELECT
(C) UPDATE
Ans (D) DROP
(C) Projection  Ans
Projection retrieves specified columns from a relation,
effectively filtering the dataset by vertical slices. This is (D) DROP
distinct from Selection, which filters rows. Projection DML involves actions like INSERT, UPDATE, and
helps isolate needed attributes for further processing, SELECT that manipulate data. DROP belongs to Data
thereby streamlining data handling and querying for Definition Language (DDL), which deals with altering
more efficient management in relational databases. or removing database structures. Confusing DML with
DDL can lead to structural changes rather than simply
3. In MySQL, which clause is used to restrict rows returned manipulating data content.
by a query based on a specified condition?
6. Which is the best example of a DDL statement for
(A) GROUP BY
(B) ORDER BY changing a column’s data type in an existing table
(C) HAVING Students?
(D) WHERE (A) ALTER TABLE Students MODIFY ColumnName
NewDataType;
Ans (B) SELECT * FROM Students WHERE
(D) WHERE ColumnName=’NewDataType’;
The WHERE clause filters rows from a table that meet (C) INSERT INTO Students VALUES (‘NewDataType’);
specified criteria before grouping or other operations (D) UPDATE Students SET
occur. It is central to narrowing large datasets, ensuring ColumnName=’NewDataType’;
only matching records are returned. WHERE is essential  Ans

Downloaded from www.mcqgpt.com


page 144 CUET UG Computer Science

(A) ALTER TABLE Students MODIFY ColumnName A ring topology forms a continuous circular data path.
NewDataType; Each node connects to exactly two others, creating
DDL (Data Definition Language) manages schema a loop. Data typically travels in one direction until
definitions and structural changes. ALTER TABLE with it reaches the target node. Though simpler for some
MODIFY (or CHANGE in some SQL dialects) adjusts scenarios, a single node failure can disrupt the entire
the column data type. Unlike DML statements like loop.
UPDATE, which alters data values, ALTER modifies the
10. Arrange the evolution of computer networks in
table’s structure directly.
chronological order from earliest to latest:
7. Which network type typically spans a small geographic 1. ARPANET
area like a single building or campus? 2. Internet expansion
(A) LAN 3. Email introduction
(B) WAN 4. Social media dominance
(C) MAN (A) 1 → 3 → 2 → 4
(D) Internet (B) 3 → 1 → 4 → 2
Ans (C) 1 → 4 → 3 → 2
(D) 3 → 2 → 1 → 4
(A) LAN
A Local Area Network (LAN) connects computers  Ans
within a confined area, such as an office or campus, (A) 1 → 3 → 2 → 4
using high-speed transmission. It generally offers faster ARPANET appeared first in late 1960s, followed by
data transfer and lower latency compared to broader email in the early 1970s. The broader Internet expansion
networks like WAN or MAN. LAN is ideal for localized occurred in the 1980s and early 1990s, and finally
resource sharing. social media platforms started dominating the digital
landscape in the 2000s onward.
8. Which statement best differentiates a modem from a
router in networking? 11. Which Python statement is used to handle exceptions
(A) Both strictly convert analog signals to digital that might occur during execution?
(B) A modem shares data across internal nodes while a (A) while
router translates signals (B) def
(C) A router directs data between networks; a modem (C) try-except
converts analog signals to digital (D) return
(D) Both primarily manage wireless connectivity  Ans
Ans (C) try-except
(C) A router directs data between networks; a modem The try-except block captures and manages exceptions
converts analog signals to digital that arise in code, allowing alternative paths or corrective
A router forwards packets among different networks actions. By catching runtime errors gracefully, programs
using addressing, while a modem modulates and avoid abrupt termination, thus improving robustness
demodulates signals for internet connectivity over and user experience.
telephone or cable lines. These roles are distinct though
12. Which built-in Python exception is raised when a
both devices often coexist in a network infrastructure.
function or operation receives an argument of the
9. In computer networks, which topology arranges each correct type but an inappropriate value?
node in a closed loop, allowing data to circulate in one (A) KeyError
direction? (B) ValueError
(A) Star (C) TypeError
(B) Ring (D) IndexError
(C) Bus  Ans
(D) Tree
(B) ValueError
Ans ValueError occurs when an argument with an otherwise
(B) Ring valid type has an invalid value. For example, int(‘abc’)

Downloaded from www.mcqgpt.com


PRACTICE PAPER 15

triggers ValueError because ‘abc’ cannot be interpreted (B) SHIFT


as an integer. This distinguishes it from TypeError, (C) POP
which indicates an incompatible argument type. (D) PULL

13. Which Python file access mode is used solely for writing  Ans
to a file, creating it if it does not exist, and truncating (C) POP
existing content? POP deletes and returns the top element from the stack.
(A) ‘r’ It is the counterpart to PUSH, which inserts an element
(B) ‘w’ onto the top. Together, these operations enforce LIFO
(C) ‘a’ behavior, forming the fundamental basis of stack usage
(D) ‘r+’ in algorithms and systems.
Ans 17. Which notation is evaluated from left to right, with
(B) ‘w’ operators following their operands, and requires a stack
Mode ‘w’ opens a file for writing. If the file doesn’t exist, for parsing?
it’s created; if it does exist, its contents are removed (A) Infix
before writing begins. This ensures a fresh start for (B) Prefix
writing operations, distinguishing it from ‘a’ (append) (C) Postfix
or ‘r’ (read). (D) Mixed notation

14. In Python file handling, the pickle module is primarily  Ans


used to: (C) Postfix
(A) Compress large text files In Postfix (Reverse Polish) notation, an operator is
(B) Encrypt binary files written after its two operands. For example, 3 4 +
(C) Serialize and deserialize Python objects means 3 + 4. Evaluation is straightforward with a stack,
(D) Convert CSV files to JSON pushing operands and then applying the operator when
Ans encountered.

(C) Serialize and deserialize Python objects 18. Which data structure follows the First-In, First-Out
The pickle module in Python serializes objects into a byte principle?
stream for storage and later recovery (deserialization). (A) Stack
This is invaluable for saving complex data types like (B) Binary Tree
lists, dictionaries, or custom classes without manually (C) Queue
implementing conversion logic. (D) Heap

15. Which data structure operates on a Last-In, First-Out  Ans


principle? (C) Queue
(A) Queue A queue adds new elements at the rear and removes
(B) Linked List elements from the front, adhering to FIFO. It models
(C) Stack many real-world scenarios, such as people queuing in
(D) Graph line, where the first person to join the line is served first.
Ans 19. In a standard queue, what is the operation called that
(C) Stack inserts an element at the rear?
A stack adds elements at its top and removes them from (A) PUSH
that same end, making it Last-In, First-Out (LIFO). This (B) ENQUEUE
structure is essential for functions like tracking function (C) POP
calls, undo operations, and expression evaluations, (D) FRONT
among other algorithms.  Ans
16. In stack operations, which operation removes the (B) ENQUEUE
topmost element? ENQUEUE adds an element to the back (rear) of the
(A) PUSH queue. This operation complements DEQUEUE, which

Downloaded from www.mcqgpt.com


page 146 CUET UG Computer Science

removes an item from the front. Together, they maintain (B) Item not found, leading to end of search
the strict FIFO order crucial for typical queue-based (C) Item found at the second element
algorithms and processes. (D) Item discovered after minimal checks

20. Arrange the steps for deleting an element from a queue  Ans
in chronological order: (B) Item not found, leading to end of search
1. Check if the queue is empty Sequential Search’s best case is finding the target
2. Remove the front element immediately, typically in the first or very early positions.
3. Return/Store the removed element If the item is missing, the algorithm performs a complete
4. Move the front pointer pass, which is the worst-case scenario.
(A) 1 → 3 → 2 → 4
24. Which sorting algorithm repeatedly swaps adjacent
(B) 1 → 2 → 3 → 4
(C) 3 → 1 → 2 → 4 elements if they are in the wrong order?
(D) 2 → 4 → 1 → 3 (A) Selection Sort
(B) Merge Sort
Ans (C) Bubble Sort
(B) 1 → 2 → 3 → 4 (D) Insertion Sort
First, confirm the queue isn’t empty. Next, remove the  Ans
front element. Then store or return it. Lastly, advance the
front pointer. This order ensures proper FIFO handling (C) Bubble Sort
and consistent updates to internal pointers or indices. Bubble Sort repeatedly compares adjacent pairs,
swapping them if out of order, causing larger values to
21. Which searching technique inspects elements bubble up. While easy to implement, it’s inefficient for
sequentially until a match is found or the list ends? large datasets, typically O(n²) in its average and worst
(A) Binary Search cases.
(B) Interpolation Search
25. Which sorting algorithm works by placing an unsorted
(C) Sequential Search
(D) Fibonacci Search element at its correct position in each iteration by
comparing it with elements to its left?
Ans (A) Merge Sort
(C) Sequential Search (B) Insertion Sort
Sequential (linear) search checks each element in a list (C) Quick Sort
one by one, stopping if a match is identified or the entire (D) Bubble Sort
list is exhausted. It’s simple to implement but can be  Ans
slow for large datasets (O(n) complexity).
(B) Insertion Sort
22. In Binary Search, how is the list typically structured for Insertion Sort takes one element from the unsorted part,
optimal efficiency? compares it with elements in the sorted part from right
(A) Disorganized to left, and inserts it at the correct spot. This results in
(B) In ascending or descending sorted order partial lists that are sorted incrementally until the entire
(C) Randomly permuted array is ordered.
(D) Split into multiple chunks
26. How does Selection Sort differ from Insertion Sort in its
Ans approach?
(B) In ascending or descending sorted order (A) Selection Sort inserts elements into sorted positions
Binary Search divides a sorted list into halves repeatedly, incrementally
selecting the relevant half for further searching based on (B) Insertion Sort finds the minimum each pass and
comparisons. If the list is unsorted, the technique fails to places it at the start
systematically reduce the search space. (C) Selection Sort finds the minimum element and
swaps it; Insertion Sort inserts an element in correct
23. Which of these is NOT a best-case scenario for order
Sequential Search? (D) Both implement divide-and-conquer
(A) Item found at first position

Downloaded from www.mcqgpt.com


PRACTICE PAPER 15

Ans 30. Match the SQL Clauses in Column A with their primary
(C) Selection Sort finds the minimum element and function in Column B:
swaps it; Insertion Sort inserts an element in correct Column A Column B
order
1. GROUP BY a. Filter rows after
Selection Sort locates the smallest element each iteration
aggregation
and swaps it with the current position. In contrast,
Insertion Sort takes elements and inserts them within 2. HAVING b. Filter rows before
the already sorted section, shifting elements as needed. aggregation
3. ORDER BY c. Specify sorting of
27. Which statistical measure sums all data points and result set
divides by their count? 4. WHERE d. Group rows based on a
(A) Median column
(B) Mean
(C) Mode Options:
(D) Variance (A) 1-d, 2-a, 3-c, 4-b
(B) 1-a, 2-d, 3-c, 4-b
Ans (C) 1-c, 2-b, 3-d, 4-a
(B) Mean (D) 1-d, 2-b, 3-a, 4-c
The mean is the arithmetic average of a dataset. It  Ans
provides a central value but can be skewed by extreme
outliers. It differs from the median, which is the middle (A) 1-d, 2-a, 3-c, 4-b
value, and from the mode, which is the most frequently GROUP BY (d) groups rows by specified columns,
occurring value. HAVING (a) filters aggregated groups, ORDER BY (c)
sets result sorting, and WHERE (b) filters rows before
28. What does standard deviation quantify in a dataset? grouping or aggregation. This sequence ensures correct
(A) The difference between largest and smallest values data grouping and filtering.
(B) How spread out data is around the mean
31. Match each network device in Column A with its
(C) The most frequent value in the distribution
(D) The middlemost value of the distribution description in Column B:

Ans Column A Column B


(B) How spread out data is around the mean 1. Switch a. Broadcasts data to all
Standard deviation measures the average distance of ports
each data point from the mean, indicating how clustered 2. Router b. Connects different
or dispersed the data is. A lower standard deviation networks
suggests more consistency around the mean, whereas a 3. Hub c. Regenerates signals
higher one indicates greater variability. 4. Repeater d. Directs data based on
MAC addresses
29. Which relational operation combines all rows from two
relations, removing duplicates that might appear? Options:
(A) Union (A) 1-d, 2-b, 3-a, 4-c
(B) Intersection (B) 1-b, 2-d, 3-c, 4-a
(C) Minus (C) 1-a, 2-b, 3-d, 4-c
(D) Cartesian product (D) 1-c, 2-a, 3-b, 4-d
Ans  Ans

(A) Union (A) 1-d, 2-b, 3-a, 4-c


Union merges the tuples from two compatible relations A switch (d) directs frames using MAC addresses, a
into one, discarding duplicates. Intersection keeps only router (b) links different networks, a hub (a) blindly
common tuples, while Minus extracts tuples in one broadcasts to all ports, and a repeater (c) amplifies
relation but not the other. Cartesian product forms signals for extended reach. This matching highlights
every possible pair. each device’s functional role.

Downloaded from www.mcqgpt.com


page 148 CUET UG Computer Science

32. Match the file access modes in Python in Column A Column A Column B
with their purpose in Column B:
1. LENGTH() a. Returns remainder
Column A Column B 2. NOW() b. Counts rows
1. ‘r’ a. Read only 3. COUNT() c. Returns length of a
2. ‘w’ b. Write (truncate file string
first) 4. MOD() d. Returns current date
3. ‘a’ c. Append to end and time
4. ‘r+’ d. Read and write Options:
Options: (A) 1-c, 2-d, 3-b, 4-a
(A) 1-a, 2-b, 3-c, 4-d (B) 1-d, 2-c, 3-a, 4-b
(B) 1-c, 2-a, 3-d, 4-b (C) 1-b, 2-a, 3-d, 4-c
(C) 1-d, 2-c, 3-a, 4-b (D) 1-a, 2-d, 3-c, 4-b
(D) 1-b, 2-c, 3-a, 4-d  Ans
Ans (A) 1-c, 2-d, 3-b, 4-a
(A) 1-a, 2-b, 3-c, 4-d LENGTH() yields string length, NOW() returns the
The ‘r’ mode is for reading only, ‘w’ truncates or creates current date and time, COUNT() calculates the number
a file for writing, ‘a’ appends content, and ‘r+’ allows of rows, and MOD() computes the remainder of a
simultaneous read/write. Correct mode usage is critical division. Matching them correctly is vital for accurate
for proper file manipulation. SQL operations.

33. Match the Python exceptions in Column A with their 35. Which statements are true about primary and foreign
typical cause in Column B: keys in relational databases?
1. A table can only have one primary key
Column A Column B 2. A foreign key references a primary key in another
1. ZeroDivisionError a. Invalid dictionary table
lookup 3. Primary key values can be duplicated
2. IndexError b. Division by zero 4. Foreign key enforces referential integrity
attempt (A) 1, 2, and 4 only
3. TypeError c. Accessing an out-of- (B) 2 and 3 only
range list index (C) 1 and 3 only
4. KeyError d. Using incompatible (D) 1, 2, 3, and 4
operation on data type  Ans
Options: (A) 1, 2, and 4 only
(A) 1-b, 2-c, 3-d, 4-a Only one primary key can exist per table, and a foreign
(B) 1-c, 2-b, 3-a, 4-d key typically references that key in another table.
(C) 1-a, 2-d, 3-c, 4-b Primary keys cannot be duplicated. A foreign key
(D) 1-d, 2-a, 3-b, 4-c maintains referential integrity by linking records across
Ans tables.

(A) 1-b, 2-c, 3-d, 4-a 36. Which of the following statements apply to Bubble Sort?
ZeroDivisionError arises from dividing by zero, 1. It compares adjacent elements.
IndexError from an invalid list index, TypeError 2. It always beats Insertion Sort in performance.
from an incompatible operation with data types, and 3. It has O(n²) worst-case complexity.
KeyError from referencing a non-existing dictionary 4. It may do unnecessary passes if the array is nearly
key. Recognizing causes aids robust error handling. sorted.
5. It repeatedly moves the largest element to the end.
34. Match the following MySQL functions in Column A (A) 1, 3, 4, and 5 only
with their primary usage in Column B: (B) 1, 2, 3, and 4 only
(C) 2, 3, 4, and 5 only

Downloaded from www.mcqgpt.com


PRACTICE PAPER 15

(D) 1, 2, 4, and 5 only (B) Both A and R are true, but R does not explain A
Ans (C) A is true, R is false
(D) A is false, R is true
(A) 1, 3, 4, and 5 only
Bubble Sort compares adjacent pairs, has a worst-case  Ans
of O(n²), and pushes the largest element to the end (C) A is true, R is false
each pass. It can also make redundant passes if the list A is correct: accessing a list with an out-of-range index
is nearly sorted. It doesn’t reliably outperform Insertion triggers an IndexError. Python does not automatically
Sort. create new indices; referencing a non-existent index
raises an error, invalidating the reason statement.
37. Which statements describe a gateway in computer
networking? 40. Which of these is NOT a valid way to handle an
1. Operates at the data link layer only exception in Python?
2. Connects networks that use different protocols (A) Using a try-except block
3. Can act as an entry-exit point for a network (B) Raising a custom exception with raise
4. Strictly used for simple LAN traffic routing (C) Relying on the program’s default crash without
(A) 2 and 3 only error handling
(B) 1, 2, and 3 only (D) Defining an else clause after except
(C) 2, 3, and 4 only  Ans
(D) 1, 3, and 4 only
(C) Relying on the program’s default crash without error
Ans handling
(A) 2 and 3 only Proper exception handling involves try-except,
A gateway connects networks employing dissimilar optionally with else or finally, or raising custom
protocols, translating data as needed, and it often serves exceptions. Letting the program crash by ignoring
as the network’s entry-exit point. It can work across exceptions entirely is not a valid handling strategy and
multiple layers, not limited to the data link layer, and is leads to ungraceful failures.
more than basic LAN routing.
Direction :Carefully read the case study provided and then
38. Assertion (A) : A firewall monitors incoming and thoroughly answer the subsequent five questions.
outgoing traffic in a network. Raj runs a small e-commerce startup using a Python-
Reason (R) : Firewalls cannot be configured to block based backend that connects to a MySQL database.
specific ports or addresses. His site captures customer details such as username,
(A) Both A and R are true, and R is the correct email, and order history. To optimize performance, Raj
explanation of A implemented a queue system for incoming orders and a
(B) Both A and R are true, but R is not the correct stack to manage rollback operations when exceptions
explanation of A occur during transactional updates. Additionally, he used
(C) A is true, but R is false bubble sort to organize product lists, as they often require
(D) A is false, but R is true repeated rearrangement. However, with the company’s
Ans rapid growth, Raj fears data anomalies in the database
and is considering foreign keys to maintain referential
(C) A is true, but R is false integrity. He also contemplates upgrading from bubble
A firewall filters traffic and can specifically block or sort to more efficient techniques like insertion sort or
allow certain ports, addresses, or protocols. Hence, selection sort for better performance on large inventories.
while a firewall does monitor traffic, it can indeed
be configured for specific blocks, making the reason 41. Why might Raj introduce foreign keys into his MySQL
statement incorrect. tables?
(A) To format numeric data uniformly
39. Assertion (A) : In Python, an IndexError occurs if you (B) To link related tables and ensure referential integrity
try to access a list with an invalid index. (C) To automatically compress rows for storage
Reason (R) : Python automatically creates new indices (D) To randomly partition large datasets
in a list if the referenced index is out of range.
(A) Both A and R are true, and R explains A  Ans

Downloaded from www.mcqgpt.com


page 150 CUET UG Computer Science

(B) To link related tables and ensure referential integrity scenarios. Thus, switching could improve sorting
A foreign key enforces consistent relationships across efficiency.
tables by referencing primary keys, preventing orphaned
45. Assertion (A) : Queue usage for incoming orders
records. In Raj’s case, it helps maintain valid links between
orders and users, thereby reducing data anomalies. This ensures older orders are handled first.
structural constraint safeguards database consistency by Reason (R) : A stack would prioritize the earliest orders
validating inter-table references. automatically.
(A) Both A and R are true, and R is the correct
42. Which Python data structure did Raj implement for explanation of A
undo or rollback operations? (B) Both A and R are true, but R is not the correct
(A) Queue explanation of A
(B) Dictionary (C) A is true, but R is false
(C) Stack (D) A is false, but R is true
(D) Linked List  Ans
Ans (C) A is true, but R is false
(C) Stack A queue processes tasks in order of arrival (FIFO).
A stack, employing LIFO (Last-In, First-Out), is highly A stack follows LIFO, reversing that order. Thus, a
effective for undo processes: the most recent change can stack would not prioritize the earliest orders first. The
be reversed first. By pushing operations onto a stack, Raj assertion stands correct; the reason is incorrect because
can pop them in reverse order to revert system states it confuses stack and queue behaviors.
seamlessly.
Direction :Carefully read the case study provided and then
43. How does a queue benefit Raj’s order handling system? thoroughly answer the subsequent five questions.
(A) It encrypts order data for security Priya manages a university’s data analytics platform in
(B) It converts orders to JSON Python. She collects examination scores from multiple
(C) It allows first-placed orders to be processed first departments and stores them in a MySQL database. Each
(D) It merges orders into a single table department’s data is frequently sorted to compute student
Ans rankings. Initially, Priya used bubble sort but noticed
high overhead for large data. After switching to selection
(C) It allows first-placed orders to be processed first sort, she saw moderate improvements, yet she wonders if
A queue ensures requests follow FIFO principles. The insertion sort might be more effective for mostly sorted
earliest incoming orders are handled before later ones, datasets. Additionally, she wants to implement a backup
preventing out-of-turn processing. This mechanism is system using text file handling in Python, ensuring
standard in scheduling systems, enabling a fair sequence exceptions (like file write errors) are properly caught
that matches user expectations. and logged. Given the limited network infrastructure on
44. Why might Raj consider replacing bubble sort with campus, Priya also contemplates establishing a LAN-
insertion sort or selection sort? based environment for secure data exchange.
(A) Bubble sort has a better time complexity than both 46. Which sorting algorithm might be more beneficial if
(B) Insertion and selection sorts give better average student scores are partially sorted most of the time?
performance than bubble sort (A) Bubble Sort
(C) Bubble sort uses advanced recursive logic (B) Selection Sort
(D) Insertion and selection sorts only handle pre-sorted (C) Insertion Sort
data (D) Quick Sort
Ans  Ans
(B) Insertion and selection sorts give better average (C) Insertion Sort
performance than bubble sort Insertion Sort excels when data is partially sorted,
Bubble sort typically performs more comparisons requiring fewer shifts and comparisons. It gradually
and swaps, especially with medium or large datasets. inserts each item into a sorted sub-list, leading to better
Insertion Sort and Selection Sort, while still O(n²) in performance over Bubble or Selection in near-sorted
worst cases, can show fewer swaps or steps in practical

Downloaded from www.mcqgpt.com


PRACTICE PAPER 15

conditions. This makes it a practical choice for Priya’s the minimum element and swaps it, minimizing
typical data. unnecessary swaps.
(A) Both A and R are true, and R is the correct
47. How can text file handling help Priya’s backup system? explanation of A
(A) By replacing MySQL entirely with text files (B) Both A and R are true, but R is not the correct
(B) By providing a quick, structured method to store explanation of A
error logs and essential data (C) A is true, R is false
(C) By permanently encrypting all data automatically (D) A is false, R is true
(D) By blocking network access
 Ans
Ans
(A) Both A and R are true, and R is the correct
(B) By providing a quick, structured method to store explanation of A
error logs and essential data While both bubble and selection sorts share O(n²)
Text files are straightforward to generate and read, complexity, selection sort typically makes fewer swaps,
making them ideal for backups of logs or essential which can render it more efficient in practice. The reason
records. Python’s file handling enables fast creation and accurately explains the mechanism behind selection
updates, offering a simple fallback mechanism if the sort’s relative performance advantage.
main database encounters issues or needs an external
log record.  **************

48. Which exception type should Priya watch for if her file
writing operation fails unexpectedly in Python?
(A) FileNotFoundError
(B) ZeroDivisionError
(C) TypeError
(D) IOError (OSError in newer versions)
Ans
(D) IOError (OSError in newer versions)
When file-writing fails—due to permission issues, disk
errors, or unavailability—Python can raise an IOError
(handled nowadays under OSError hierarchy). Proper
try-except blocks let Priya respond gracefully, logging
the error or shifting to an alternative backup method.

49. Which is NOT a usual advantage of setting up a LAN for


data exchange in an institution?
(A) Faster local data transmission
(B) Centralized security and resource sharing
(C) Unlimited wireless coverage across continents
(D) Simplified collaboration among connected devices
Ans
(C) Unlimited wireless coverage across continents
A LAN (Local Area Network) is confined to a limited
geographic region, providing fast data transfer and
central management. It does not span continents.
Claims of unlimited coverage would be false; for broad
areas, WAN or the internet is necessary.

50. Assertion (A) : Selection Sort outperforms Bubble Sort


in many practical sorting scenarios.
Reason (R) : Selection Sort systematically finds

Downloaded from www.mcqgpt.com


page 152 CUET UG Computer Science

PRACTICE PAPER 16

1. Which statement best describes a database? 4. In MySQL, which clause groups rows that share a
(A) A system of manual recordkeeping common value into summary rows, often used with
(B) A structured collection of data that can be accessed, aggregate functions?
managed, and updated (A) HAVING
(C) A random set of disorganized files (B) WHERE
(D) An operating system feature used for file transfers (C) GROUP BY
Ans (D) ORDER BY

(B) A structured collection of data that can be accessed,  Ans


managed, and updated (C) GROUP BY
A database provides an organized way to store and GROUP BY consolidates rows by shared attributes,
retrieve data systematically. Efficient access methods allowing operations like SUM or COUNT on each
and well-defined relationships make it distinct from group. It precedes HAVING, which can then filter
random files. This structured approach simplifies data groups. GROUP BY is central to aggregated queries that
management and analysis. need summarized data.

2. Which database key is used to link records in two tables, 5. Which option differentiates HAVING from WHERE in
referencing the primary key of another table? SQL?
(A) Primary key (A) WHERE can only filter numeric data, while
(B) Composite key HAVING filters text data
(C) Foreign key (B) HAVING filters results after GROUP BY, while
(D) Candidate key WHERE filters rows before grouping
Ans (C) WHERE is required, HAVING is optional
(D) HAVING can manipulate table structure
(C) Foreign key
A foreign key points to a primary key in a different  Ans
table, forming a link between two relations and (B) HAVING filters results after GROUP BY, while
ensuring referential integrity. This prevents invalid WHERE filters rows before grouping
record references and maintains consistency across WHERE operates on individual rows prior to
interconnected tables. aggregation, whereas HAVING filters aggregated
groups. They serve distinct roles in queries, with
3. Which SQL command removes an entire table from a WHERE cleaning data at the row level, and HAVING
database? refining final grouped results.
(A) DELETE TABLE
(B) DROP TABLE 6. Which of the following is NOT a valid MySQL aggregate
(C) ALTER TABLE function?
(D) TRUNCATE TABLE (A) MAX()
Ans (B) AVG()
(C) MEDIAN()
(B) DROP TABLE (D) SUM()
DROP TABLE permanently deletes the table structure
and data. TRUNCATE TABLE removes all rows but  Ans
retains the structure, while DELETE can remove rows (C) MEDIAN()
under certain conditions. ALTER TABLE modifies MySQL has aggregate functions like MAX(), MIN(),
existing structure rather than removing it outright. AVG(), SUM(), and COUNT(). MEDIAN() is not a

Downloaded from www.mcqgpt.com


PRACTICE PAPER 16

built-in aggregate function in many MySQL versions; (B) IPv2


to compute the median, one typically uses alternative (C) IPv6
queries or statistics logic. (D) IPv8

7. Which data transmission medium uses glass or plastic  Ans


fibers for high-speed signal transfer? (C) IPv6
(A) Twisted Pair Cable IPv6 employs 128-bit addresses, vastly expanding
(B) Coaxial Cable possible unique addresses compared to IPv4’s 32-bit
(C) Optical Fiber space. This upgrade addresses IP address exhaustion
(D) Ethernet Cable (Cat 5) and introduces features like improved routing efficiency
Ans and simplified address auto-configuration.

(C) Optical Fiber 11. Arrange these Python exception handling steps in the
Optical fibers carry data as light pulses through correct chronological sequence:
thin strands of glass or plastic, providing very high 1. Execute the try block
bandwidth and low signal loss over long distances. They 2. Raise exception if any error
outperform twisted pair and coaxial cables in terms of 3. Jump to except block
speed and resistance to electromagnetic interference. 4. Execute else block if no exception
(A) 1 → 3 → 2 → 4
8. What is the main role of a router in a network? (B) 1 → 2 → 4 → 3
(A) Encrypt all data (C) 1 → 2 → 3 → 4
(B) Facilitate communication between different (D) 2 → 1 → 3 → 4
networks
(C) Serve as a repeater for signal boosting  Ans
(D) Intercept malicious software (C) 1 → 2 → 3 → 4
Ans Python executes statements in the try block (1). If an
error occurs, an exception is raised (2). Control moves
(B) Facilitate communication between different to the except block (3). If no exception occurs, the else
networks block executes (4), maintaining a clear, sequential flow.
Routers direct data packets between networks, using
IP addresses to choose the best path. They operate 12. Which Python statement ensures code will run whether
primarily at the network layer, ensuring incoming and an exception occurs or not?
outgoing traffic is properly forwarded to its destination (A) except
network segment. (B) else
(C) finally
9. Which topology might be best for an office environment (D) raise
requiring a central controller and easy addition or
removal of nodes?  Ans
(A) Bus (C) finally
(B) Ring The finally block runs unconditionally after try-except
(C) Star blocks finish, enabling resource cleanup or final logging.
(D) Mesh This ensures certain code segments (like closing files)
Ans execute regardless of success or exception within the try
block.
(C) Star
In a star topology, each node connects to a central hub 13. Why might a developer define a custom exception in
or switch. It simplifies adding or removing nodes and Python?
isolates failures to individual links. Though it needs (A) To override standard exceptions without reason
more cable length, its manageability and fault isolation (B) To handle unique error conditions specific to an
often make it the preferred choice for offices. application’s domain
(C) To disable built-in error handling
10. Which IP address version uses a 128-bit address space? (D) To reduce code readability
(A) IPv4

Downloaded from www.mcqgpt.com


page 154 CUET UG Computer Science

Ans tasks such as undo actions, expression evaluation, and


(B) To handle unique error conditions specific to an function call tracking. Its top-based operations define
application’s domain its hallmark behavior.
Custom exceptions address application-specific error
17. What does the PUSH operation do in a stack?
scenarios that aren’t covered by standard built-in
(A) Removes the top element
exceptions. Developers tailor them to capture precise
(B) Adds an element to the bottom
error logic, making the code more maintainable and
(C) Removes the bottom element
user-friendly by clarifying the error’s cause.
(D) Adds an element to the top
14. How do text files differ from binary files in Python file  Ans
handling?
(D) Adds an element to the top
(A) Text files can only contain ASCII characters, while
PUSH inserts an item onto the top of the stack. POP then
binary files accept Unicode
removes the last item inserted. This consistent use of the
(B) Binary files store data in human-readable text
top for both operations ensures the LIFO methodology
(C) Text files store data as a sequence of characters,
pivotal to stack operations.
while binary files store data exactly as bytes
(D) Binary files are always slower to read 18. Which queue variation allows insertion and removal at
Ans both ends?
(A) Priority Queue
(C) Text files store data as a sequence of characters,
(B) Circular Queue
while binary files store data exactly as bytes
(C) Double-Ended Queue (Deque)
Text files represent content through encoded characters
(D) Blocking Queue
(e.g., ASCII or UTF-8), making them human-readable.
Binary files hold data in raw byte format, potentially not  Ans
directly readable without a specific program or decoder. (C) Double-Ended Queue (Deque)
A deque (double-ended queue) supports adding or
15. Which file mode in Python allows both reading and
removing elements from either the front or back. This
writing without truncating the existing file?
versatile structure expands queue capabilities for tasks
(A) ‘w’
requiring dynamic front- and back-end operations, like
(B) ‘a’
certain scheduling or buffer systems.
(C) ‘r+’
(D) ‘w+’ 19. Which of the following is NOT a typical real-world
Ans analogy of a queue?
(A) People lining up for tickets
(C) ‘r+’
(B) Printer job scheduling
Mode ‘r+’ opens a file for reading and writing, preserving
(C) Undo stack in a text editor
its existing content. By contrast, ‘w’ and ‘w+’ overwrite
(D) Task scheduling in an operating system
existing data, and ‘a’ only appends. ‘r+’ is used when you
want to read, modify, and potentially write to the file  Ans
content. (C) Undo stack in a text editor
An undo stack is a classic LIFO example, aligning with
16. Which data structure is best described as LIFO (Last-In,
stack behavior. Queue-like examples handle tasks or
First-Out)?
entities in FIFO order. Hence, an undo stack does not
(A) Stack
reflect queue behavior but rather a stack’s methodology.
(B) Queue
(C) Tree 20. Arrange the steps for inserting an element into a queue
(D) Graph in chronological order:
Ans 1. Check if the queue is full
2. Place the element at the rear
(A) Stack
3. Increment the rear pointer
A stack’s insertion and removal points coincide at the
4. Insert element into the data structure
top, making it Last-In, First-Out. This approach suits
(A) 1 → 4 → 2 → 3

Downloaded from www.mcqgpt.com


PRACTICE PAPER 16

(B) 1 → 3 → 2 → 4  Ans
(C) 1 → 2 → 3 → 4 (B) O(log n)
(D) 1 → 2 → 4 → 3 Binary Search repeatedly halves the search interval,
Ans leading to logarithmic growth relative to the size of the
list. In the worst case, it systematically eliminates half
(C) 1 → 2 → 3 → 4
the remaining data set each comparison, making it very
First, ensure the queue has space. Next, assign the
efficient for large, sorted collections.
element into the rear location, then update the rear
pointer. Finally, record that the element is in the queue. 24. How does Selection Sort differ from Bubble Sort in the
This checks capacity before physically placing the new way it places elements?
item. (A) Selection Sort swaps in every comparison, Bubble
Sort doesn’t swap at all
21. Why is binary search more efficient than sequential
(B) Selection Sort finds the largest element each pass,
search for large, sorted datasets?
Bubble Sort finds the smallest
(A) It reads every element until a match is found
(C) Selection Sort finds the minimum and places it in
(B) It repeatedly narrows down the search space by
the correct position, while Bubble Sort repeatedly
dividing it in half
swaps adjacent elements
(C) It depends on scanning all elements in random
(D) Both sort algorithms are identical
order
(D) It stores data as separate queues  Ans

Ans (C) Selection Sort finds the minimum and places it in


the correct position, while Bubble Sort repeatedly swaps
(B) It repeatedly narrows down the search space by
adjacent elements
dividing it in half
Selection Sort looks for the smallest element in each
Binary search leverages the sorted order to skip large
pass and puts it at the start of the array. Bubble Sort
portions of data, halving the search space each time.
compares adjacent pairs and repeatedly swaps out-of-
This results in O(log n) complexity, making it more
order elements, moving larger items toward the end.
efficient than sequential search’s O(n) approach for
extensive sorted lists. 25. Which of these scenarios is NOT a suitable best-case for
Insertion Sort?
22. Which search algorithm checks each element in turn
(A) Partially sorted data
until the target is found or the end of the collection is
(B) Data in ascending order
reached?
(C) Reverse-ordered data
(A) Jump Search
(D) Very small datasets
(B) Binary Search
(C) Exponential Search  Ans
(D) Sequential (Linear) Search (C) Reverse-ordered data
Ans Insertion Sort is fastest on already or nearly sorted data
(few shifts needed). However, with data in reverse order,
(D) Sequential (Linear) Search
every new element must shift many items, making
Sequential (or linear) search traverses the dataset from
it slow (O(n²)). Small or sorted datasets showcase
the beginning, comparing each element until it finds the
Insertion Sort’s efficiency.
target or finishes checking all elements. While simple,
it’s not the most efficient for large datasets unless they 26. Why is standard deviation important in understanding
are unsorted. a dataset?
(A) It identifies the highest value
23. What is the typical worst-case time complexity of Binary
(B) It reveals how data points deviate from the mean
Search?
(C) It calculates the midpoint of data
(A) O(n)
(D) It determines the sum of all values
(B) O(log n)
(C) O(n log n)  Ans
(D) O(n²) (B) It reveals how data points deviate from the mean

Downloaded from www.mcqgpt.com


page 156 CUET UG Computer Science

Standard deviation is a measure of dispersion, Column A Column B


indicating how spread out or clustered data points are
1. Worm a. Malicious program that
around the mean. A low standard deviation signifies
replicates itself across
values are closer to the mean, while a high one indicates
systems
substantial variability.
2. Trojan Horse b. Program disguised as
27. Which function in MySQL returns the current date and legitimate software
time? 3. Virus c. Infects files by inserting
(A) DATE() malicious code
(B) NOW() 4. Phishing d. Scam to trick users into
(C) MONTH() revealing personal data
(D) YEAR()
Options:
Ans (A) 1-a, 2-b, 3-c, 4-d
(B) NOW() (B) 1-b, 2-a, 3-d, 4-c
NOW() yields the current system date and time as a (C) 1-c, 2-d, 3-a, 4-b
timestamp. Functions like DATE(), MONTH(), and (D) 1-d, 2-c, 3-b, 4-a
YEAR() extract portions of a date, but NOW() directly  Ans
provides the full current datetime value from the server.
(A) 1-a, 2-b, 3-c, 4-d
28. Which operation merges rows from two relations and A worm spreads autonomously across networks, a
retains all possible pair combinations? Trojan Horse conceals malicious intent in innocuous
(A) Union software, a virus attaches itself to files to replicate,
(B) Intersection and phishing deceives individuals into sharing private
(C) Natural Join details, typically via email or fraudulent websites.
(D) Cartesian Product
31. Match each part of an exception block in Python
Ans (Column A) with its role (Column B):
(D) Cartesian Product
Column A Column B
The Cartesian Product generates all pairs of rows from
two tables, often leading to a large result set. Additional 1. try a. Runs if no exception
filtering, like a WHERE clause or a JOIN condition, occurs
refines that set, but on its own, it simply pairs every row 2. except b. Always executes at the
in one relation with every row in the other. end
3. else c. Executes potentially
29. Which network type covers a city or metropolitan area, error-prone code
often interconnecting multiple LANs?
4. finally d. Catches and handles
(A) LAN
the exception
(B) MAN
(C) PAN Options:
(D) WAN (A) 1-c, 2-d, 3-a, 4-b
(B) 1-a, 2-c, 3-b, 4-d
Ans
(C) 1-d, 2-b, 3-a, 4-c
(B) MAN (D) 1-b, 2-a, 3-c, 4-d
A Metropolitan Area Network (MAN) is larger than a
 Ans
Local Area Network but typically confined to a single
city or metropolitan region. It commonly links multiple (A) 1-c, 2-d, 3-a, 4-b
LANs within that region, balancing performance with The try block houses the main code, except handles any
broader coverage. arising exceptions, else runs if no exception is raised,
and finally executes unconditionally after try-except-
30. Match each cybersecurity threat in Column A with its else, regardless of whether an error occurred.
description in Column B:

Downloaded from www.mcqgpt.com


PRACTICE PAPER 16

32. Match each part of a stack operation in Column A with 34. Match each network topology in Column A with its
its definition in Column B: characteristic in Column B:
Column A Column B Column A Column B
1. PUSH a. Points to the current 1. Ring a. All nodes connected to
last element in the a central device
stack 2. Bus b. Each node is connected
2. POP b. Adding a new element to every other node
to the top 3. Star c. Nodes arranged in a
3. TOP pointer c. Attempt to pop from closed loop
an empty stack 4. Mesh d.
4. Underflow d. Options:
Options: (A) 1-c, 2-d, 3-a, 4-b
(A) 1-b, 2-d, 3-a, 4-c (B) 1-d, 2-c, 3-b, 4-a
(B) 1-d, 2-b, 3-c, 4-a (C) 1-a, 2-b, 3-d, 4-c
(C) 1-a, 2-c, 3-d, 4-b (D) 1-b, 2-a, 3-c, 4-d
(D) 1-c, 2-a, 3-b, 4-d  Ans
Ans (A) 1-c, 2-d, 3-a, 4-b
(A) 1-b, 2-d, 3-a, 4-c A ring topology has each computer in a loop, a bus
PUSH adds to the top, POP removes from the top, the topology uses one backbone cable, a star topology
TOP pointer shows the stack’s current last element, features a central connection point, and a mesh connects
and underflow occurs when removing from an empty every node directly to others for high redundancy.
stack. Correctly handling these ensures stable stack
35. Which of the following statements about computer
operations.
networks are correct?
33. Match each MySQL function in Column A with its 1. Routers operate at the network layer
purpose in Column B: 2. LAN covers a large geographical area
3. Switches send data based on MAC addresses
Column A Column B
4. WAN is smaller than a LAN
1. UCASE() a. Converts text to 5. A hub broadcasts signals to all ports
uppercase (A) 1, 3, and 5 only
2. ROUND() b. Returns the name of (B) 1, 2, 3, and 5 only
the weekday (C) 2, 3, and 4 only
3. DAYNAME() c. Counts rows in a table (D) 1, 2, 4, and 5 only
4. COUNT(*) d. Rounds a numeric  Ans
value
(A) 1, 3, and 5 only
Options: Routers function at the network layer, switches make
(A) 1-a, 2-d, 3-b, 4-c decisions based on MAC addresses, and hubs broadcast
(B) 1-b, 2-a, 3-d, 4-c data blindly to all ports. LAN is typically small; WAN
(C) 1-c, 2-d, 3-a, 4-b spans larger areas. Thus, statements 2 and 4 are incorrect.
(D) 1-d, 2-c, 3-b, 4-a
36. Which statements are true about SQL JOINs?
Ans
1. INNER JOIN returns matching rows from both
(A) 1-a, 2-d, 3-b, 4-c tables
UCASE() transforms text to uppercase, ROUND() 2. LEFT JOIN only returns rows that have matching
adjusts a number to the nearest integer or decimal place, entries in both tables
DAYNAME() gives the weekday name from a date, and 3. RIGHT JOIN includes all rows from the second
COUNT(*) tallies all rows in the output of a query. table
4. FULL JOIN includes rows from both tables,

Downloaded from www.mcqgpt.com


page 158 CUET UG Computer Science

matching or not 39. Assertion (A) : The TRUNCATE TABLE command


(A) 1, 3, and 4 only removes all rows quickly in MySQL.
(B) 1 and 2 only Reason (R) : TRUNCATE TABLE reinitializes the table
(C) 2, 3, and 4 only but retains its structure.
(D) 1, 2, and 4 only (A) Both A and R are true, and R is the correct
Ans explanation of A
(B) Both A and R are true, but R is not the correct
(A) 1, 3, and 4 only explanation of A
INNER JOIN fetches rows that match in both tables. (C) A is true, R is false
LEFT JOIN includes all rows from the first (left) table (D) A is false, R is true
plus matched from the second, while RIGHT JOIN does
the opposite. FULL JOIN returns all rows from both,  Ans
matched or unmatched. (A) Both A and R are true, and R is the correct
explanation of A
37. Which statements describe typical behaviors of a Trojan TRUNCATE TABLE is a DDL operation that efficiently
horse? deletes all data, often faster than DELETE, while
1. It replicates itself automatically retaining the table definition. It resets metadata like
2. Disguises malicious code as legitimate software auto-increment counters but preserves the table’s
3. Needs user action to execute structure.
4. Directly infects other files to replicate
5. Often provides unauthorized access to hackers 40. Which of the following is a security practice aimed at
(A) 1, 4 only preventing unauthorized data access?
(B) 2, 3, and 5 only (A) Using open Wi-Fi networks
(C) 2, 4, and 5 only (B) Storing passwords in plain text
(D) 1, 3, and 4 only (C) Implementing strong firewalls and encryption
Ans (D) Permitting all inbound traffic by default

(B) 2, 3, and 5 only  Ans


A Trojan horse disguises itself as benign software, often (C) Implementing strong firewalls and encryption
requiring user activation (e.g., running an attachment), Firewalls and encryption protect data from unauthorized
and can open a backdoor for external access. It doesn’t intrusion and interception. Exposing internal networks
autonomously replicate (like worms) or inject itself into on open Wi-Fi or storing sensitive information in plain
other files (like viruses). text makes systems vulnerable. Proper filtering rules
and cryptographic measures greatly enhance security.
38. Assertion (A) : A firewall can be configured to block
traffic from specific IP addresses. Direction :Carefully read the case study provided and then
Reason (R) : Firewalls cannot inspect the contents of thoroughly answer the subsequent five questions.
data packets. Aditya oversees a hospital’s patient data system. He stores
(A) Both A and R are true, and R is the correct patient records (personal details, diagnoses, treatments)
explanation of A in a MySQL database. For quick access, he organizes
(B) Both A and R are true, but R is not the correct incoming queries in a queue structure so the oldest requests
explanation of A are processed first. Meanwhile, a stack-based approach
(C) A is true, R is false helps with undo actions in case of incorrect data entries.
(D) A is false, R is true Aditya frequently uses binary search to retrieve patient
Ans records rapidly from sorted lists, especially for older patient
archives. However, he remains concerned about potential
(C) A is true, R is false data breaches. He is evaluating firewalls and encryption
Firewalls indeed can block or filter traffic from specified to protect sensitive data, while also implementing strong
IPs, among other rules. They can also inspect packet primary and foreign keys to maintain clear relationships
headers and, in some cases, packet contents (deep packet among patient info, treatments, and billing records. By
inspection). Hence, the reason statement is incorrect. combining robust data structures and security measures,
Aditya ensures efficient, safe data management.

Downloaded from www.mcqgpt.com


PRACTICE PAPER 16

41. Which data structure does Aditya use to process the (C) Plain-text password storage
oldest query first? While Aditya employs encryption, firewalls, and key
(A) Stack constraints to enhance data security and relational
(B) Queue consistency, storing passwords in plain text is unsafe and
(C) Linked List contradicts robust security practices. Proper hashing or
(D) Binary Tree encryption is necessary for credential protection.
Ans 45. Assertion (A) : Aditya’s use of foreign keys helps
(B) Queue maintain relationships among tables.
A queue processes elements in FIFO order, ensuring Reason (R) : Foreign keys ensure related records are
earlier requests are handled before later ones. This deleted automatically without constraints.
arrangement is valuable for fair resource allocation and (A) Both A and R are true, and R is the correct
sequential task management, which fits the hospital’s explanation of A
need for timely query handling. (B) Both A and R are true, but R is not the correct
explanation of A
42. Which data structure is used by Aditya for undo (C) A is true, R is false
functionality when correcting mistakes? (D) A is false, R is true
(A) Array
(B) File  Ans
(C) Stack (C) A is true, R is false
(D) Dictionary A foreign key enforces relational integrity by referencing
Ans a primary key in another table. It does not inherently
delete all related records without constraints. Instead,
(C) Stack referential actions (CASCADE, SET NULL, etc.) must
An undo feature aligns perfectly with LIFO behavior. be explicitly defined to handle such deletions.
The most recent change can be popped first to revert
actions quickly. This complements the queue’s FIFO Direction :Carefully read the case study provided and then
strategy for main processes while the stack manages thoroughly answer the subsequent five questions.
reversal tasks effectively. Harini manages a data science lab that processes scientific
experiments. She uses Python for reading and writing
43. Why might Aditya prefer binary search for patient text files containing experiment logs. For advanced
archives? computations, she organizes critical data in MySQL
(A) It checks every record in sequence tables, applying group-related queries with GROUP BY
(B) It can find data in O(log n) if the list is sorted clauses to summarize results. Because some experiments
(C) It rearranges records as they are searched yield large data volumes, Harini employs selection sort
(D) It is always faster than constant-time lookups for demonstration and occasionally insertion sort when
Ans data is nearly sorted. Given the confidential nature
(B) It can find data in O(log n) if the list is sorted of her findings, she secures her network via LAN and
Binary search repeatedly halves the search space in a implements strong firewall rules. Additionally, she
sorted collection, significantly cutting down search time schedules regular backups using Python’s pickle module
from O(n) to O(log n). This is particularly efficient for to serialize objects, ensuring that data states are preserved
large, sorted patient archives, offering quick lookups by for future reference. Balancing efficient data structures,
leveraging order. effective sorting, and robust network security is vital for
her lab’s workflow.
44. Which measure is NOT part of Aditya’s described data
46. Why might Harini use selection sort in demonstrations,
security approach?
(A) Encryption despite its O(n²) complexity?
(B) Firewall implementation (A) It guarantees sub-linear performance
(C) Plain-text password storage (B) It is simpler to understand, with a clear approach to
(D) Setting up strong primary and foreign keys finding minima
(C) It randomly arranges data for better example variety
Ans (D) It only applies to numeric datasets

Downloaded from www.mcqgpt.com


page 160 CUET UG Computer Science

Ans measures and exposing sensitive experiment results to


(B) It is simpler to understand, with a clear approach to threats.
finding minima
50. Assertion (A) : Harini uses insertion sort for data sets
Selection sort repeatedly locates the smallest element
that are nearly sorted.
and moves it to the sorted portion. Its step-by-step
Reason (R) : Insertion sort reduces the average number
minimal element selection is transparent, making it
of shifts significantly when the list is almost in order.
a useful teaching tool even though it’s not the most
(A) Both A and R are true, and R is the correct
efficient for large datasets.
explanation of A
47. Which Python module does Harini use to serialize (B) Both A and R are true, but R is not the correct
complex data objects for backups? explanation of A
(A) sys (C) A is true, R is false
(B) pickle (D) A is false, R is true
(C) math  Ans
(D) re
(A) Both A and R are true, and R is the correct
Ans explanation of A
(B) pickle Insertion sort excels with partially sorted data, requiring
The pickle module serializes Python objects to a byte fewer comparisons and shifts. Because each element only
stream, enabling them to be saved and loaded later. This moves a small distance, the algorithm’s performance
helps preserve data states, especially when dealing with can approach O(n), explaining why Harini specifically
structured or custom objects that need retrieval in their employs it for nearly sorted datasets.
original form.
 **************
48. Which SQL clause does Harini rely on to group
experimental results for summarization?
(A) ORDER BY
(B) GROUP BY
(C) HAVING
(D) WHERE
Ans
(B) GROUP BY
GROUP BY clusters rows with the same values in
specified columns, facilitating aggregate calculations
like AVG, SUM, COUNT, etc. Harini can thus effectively
summarize experimental results according to categories
or other grouping criteria.

49. Which of the following is NOT a secure network


strategy Harini uses?
(A) Setting up a Local Area Network (LAN)
(B) Implementing strict firewall rules
(C) Disabling encryption for faster data transfer
(D) Regularly monitoring network traffic logs
Ans
(C) Disabling encryption for faster data transfer
Harini maintains robust security via a LAN, firewall
rules, and likely network monitoring. Disabling
encryption, however, would compromise data privacy
and security, negating the benefits of other protective

Downloaded from www.mcqgpt.com


PRACTICE PAPER 17

PRACTICE PAPER 17

1. What is the primary key in a relational database table? (A) Foreign key values can be duplicated, while primary
(A) A field used for sorting rows by name key values must be unique
(B) A unique identifier for each table record Primary keys offer a unique identifier for each row in a
(C) A column that always stores numeric data table. Foreign keys, however, link rows between tables.
(D) A reference to an existing table row Because multiple rows can connect to the same row
Ans in another table, foreign key values can repeat. Thus,
foreign keys allow repeated references, whereas primary
(B) A unique identifier for each table record keys remain strictly unique. This distinction maintains
A primary key is defined as a unique identifier in a relational integrity.
relational table, ensuring no two rows share the same
value. This uniqueness helps maintain data integrity 4. Which principle best maintains consistency across
and facilitates quick data retrieval, as every row can multiple related tables in a database?
be pinpointed using that specific key value. It prevents (A) Applying triggers on every insert operation
duplicate entries and supports efficient record linking (B) Using enforced referential integrity with foreign
within the database. keys
(C) Performing frequent backups of data tables
2. Which key can act as a primary key if the designated (D) Storing all data in a single table to avoid joins
primary key becomes invalid or is no longer suitable?
(A) Foreign key  Ans
(B) Alternate key (B) Using enforced referential integrity with foreign
(C) Candidate key keys
(D) Composite key Referential integrity ensures that a foreign key in one
Ans table corresponds to a valid primary key in another.
This mechanism automatically prevents orphan records
(B) Alternate key and data mismatches. By enforcing referential rules,
An alternate key is a candidate key that did not get databases maintain logical connections between rows
chosen as the primary key. If the primary key becomes across tables, thus preserving accuracy and reliability in
unusable, an alternate key can replace it. This guarantees multi-table structures.
consistent row identification. Alternate keys are valid
unique identifiers but are secondary to the key officially 5. Match the following database terms with their
named the primary key. definitions:

3. How does a foreign key differ from a primary key in Column A Column B
relational databases? 1. Domain A. A row in a table
(A) Foreign key values can be duplicated, while primary 2. Tuple B. A set of allowable
key values must be unique values for a column
(B) They are functionally identical keys for data 3. Relation C. An entire table
retrieval
4. Candidate Key D. A column or set of
(C) A foreign key always stores dates, while a primary
columns that can
key stores integers
uniquely identify rows
(D) Foreign key ensures unique data, primary key
enforces referential integrity Options:
(A) 1-C, 2-D, 3-A, 4-D
Ans
(B) 1-D, 2-C, 3-B, 4-A
(C) 1-A, 2-B, 3-D, 4-C

Downloaded from www.mcqgpt.com


page 162 CUET UG Computer Science

(D) 1-B, 2-A, 3-C, 4-D (C) 3 → 2 → 4 → 1


Ans (D) 4 → 3 → 2 → 1

(D) (1)-(B), (2)-(A), (3)-(C), (4)-(D)  Ans


Domain specifies valid values permitted in a column. A (B) 3 → 4 → 2 → 1
tuple is a single row representing a record. A relation is The logical execution order usually begins with SELECT
the full table composed of rows and columns. A candidate to specify columns, then FROM to identify tables,
key is any column or combination of columns uniquely WHERE to filter rows, and finally ORDER BY to sort
identifying rows in that table. This structure forms the results. Even though SQL statements are written in
foundation of relational database organization. different orders, this sequence reflects how the database
engine processes the query internally. Proper ordering
6. Which SQL command is used to create a new table in a avoids unexpected output.
database?
(A) CREATE TABLE 9. Match each SQL command with its primary purpose:
(B) MAKE TABLE
Column A Column B
(C) NEW TABLE
(D) FORM TABLE 1. DROP TABLE a. Remove a table
2. ALTER TABLE b. Modify structure of an
Ans
existing table
(A) CREATE TABLE 3. INSERT c. Retrieve data
CREATE TABLE is the standard SQL Data Definition
4. SELECT d. Add new row
Language statement to establish a new table within
a database. By specifying table name and column Options:
definitions, it sets up the structure where data can be (A) 1-a, 2-b, 3-d, 4-c
stored. Other options are not recognized as valid SQL (B) 1-d, 2-b, 3-c, 4-a
commands for table creation. This syntax is universally (C) 1-b, 2-c, 3-d, 4-a
supported. (D) 1-a, 2-d, 3-b, 4-c
 Ans
7. Which of the following is NOT a valid SQL data
manipulation statement? (A) 1-a, 2-b, 3-d, 4-c
(A) INSERT DROP TABLE removes an entire table. ALTER TABLE
(B) UPDATE adjusts or changes the existing table structure. INSERT
(C) SELECT places new records into a table’s columns. SELECT
(D) MERGE retrieves data from one or more tables, enabling
queries to display needed information based on
Ans
specified conditions and columns. These operations are
(D) MERGE fundamental to effective SQL usage.
INSERT adds rows, UPDATE modifies existing rows,
and SELECT retrieves data. MERGE is part of certain 10. Which SQL clause best controls the sequence in which
SQL implementations but not considered a basic Data rows appear in query output?
Manipulation Language statement in standard SQL (A) GROUP BY
definitions. It combines insert and update actions, but (B) HAVING
many database systems may not include it as a core (C) ORDER BY
DML command. (D) SELECT DISTINCT
 Ans
8. Arrange the following SQL clauses in the correct order
of execution in a typical SELECT query: (C) ORDER BY
1. ORDER BY ORDER BY arranges query results according to
2. WHERE specified column(s), enabling ascending or descending
3. SELECT sorting. GROUP BY segments rows into groups based
4. FROM on column values, and HAVING filters groups. SELECT
(A) 2 → 4 → 3 → 1 DISTINCT removes duplicate rows. Therefore, ORDER
(B) 3 → 4 → 2 → 1

Downloaded from www.mcqgpt.com


PRACTICE PAPER 17

BY specifically addresses the sorting and presentation (B) HAVING filters groups after aggregation, whereas
sequence for retrieved data in the final result set. WHERE filters rows before grouping
WHERE applies to individual rows and eliminates them
11. Which aggregate function in SQL returns the number of before the grouping step. HAVING acts on the resultant
non-NULL rows for a particular column? groups formed by GROUP BY, allowing further filtration
(A) COUNT() based on aggregate calculations (e.g., SUM, AVG). This
(B) SUM() design ensures different filtering stages for raw row data
(C) AVG() and for final grouped results. It offers precise control
(D) MIN() over group-level conditions.
Ans
14. Which JOIN type best retrieves matching rows from two
(A) COUNT() tables where the join condition is satisfied, excluding
COUNT() calculates the total number of non-NULL unmatched rows?
rows in a specified column or even for all rows if (A) LEFT JOIN
COUNT(*) is used. SUM() adds up numeric column (B) RIGHT JOIN
values, AVG() computes average values, and MIN() (C) FULL JOIN
returns the smallest value in a column. COUNT() (D) INNER JOIN
specifically focuses on row counts. It’s crucial for
summarizing query results.  Ans
(D) INNER JOIN
12. Which combination of the following statements about INNER JOIN returns rows only when there is a
the SQL GROUP BY clause is correct? matching value in both tables based on the specified
1. It groups rows that have the same value in specified condition. LEFT JOIN includes unmatched rows from
columns the left table, RIGHT JOIN includes unmatched rows
2. It can be used without any aggregate function from the right table, and FULL JOIN includes all rows
3. It must appear before the WHERE clause with or without matches. This distinction defines how
4. It often works with aggregate functions like SUM or non-matching data appears.
MAX
(A) 1 and 4 are correct 15. Which statement best compares LAN and WAN?
(B) 2 and 3 are correct (A) LAN covers large geographical areas, WAN is
(C) 1, 2, and 4 are correct limited to small buildings
(D) 1 and 3 are correct (B) LAN transmits data at slower speeds, WAN
Ans provides higher speeds
(C) LAN is typically for localized networks, WAN
(A) 1 and 4 are correct connects distant sites
GROUP BY collects rows sharing common values in (D) LAN is always wireless, WAN is always wired
certain columns, typically used with aggregate functions
(like SUM, MAX) to summarize data. It cannot precede  Ans
WHERE, and while some SQL dialects might permit (C) LAN is typically for localized networks, WAN
GROUP BY without aggregates, common usage pairs connects distant sites
it with functions for summarized grouping. This A Local Area Network (LAN) commonly spans a limited
highlights the interplay of clauses. area such as a building or campus, facilitating high-speed
data transfer. A Wide Area Network (WAN) links widely
13. Why is the HAVING clause used in SQL instead of separated geographical areas. Speed can vary, and both
WHERE with aggregate functions? can be wired or wireless, depending on infrastructure
(A) HAVING is faster for all queries choices and requirements. This distinction underscores
(B) HAVING filters groups after aggregation, whereas their scope and purpose.
WHERE filters rows before grouping
(C) HAVING is mandatory in every SELECT query 16. Assertion (A) : A router directs data packets between
(D) HAVING can only work with numeric columns different networks.
Ans Reason (R) : Routers are responsible for converting
analog signals to digital signals.

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


page 164 CUET UG Computer Science

(A) Both A and R are true, and R is the correct (B) Switch
explanation of A (C) Hub
(B) Both A and R are true, but R is not the correct (D) Modem
explanation of A  Ans
(C) A is true, but R is false
(D) A is false, but R is true (B) Switch
A switch forwards incoming data packets selectively
Ans to specific ports, reducing unnecessary traffic. A hub
(C) A is true, but R is false simply broadcasts all data to every port, while a repeater
Routers manage traffic between distinct networks by regenerates signals. A modem handles modulation
determining optimal paths for data packets. However, and demodulation for communication over telephone
converting analog signals to digital signals is typically lines or cable systems. Switches thereby optimize local
the job of a modem, not a router. Therefore, the network efficiency. This focused delivery elevates
assertion about a router’s function is correct, whereas performance significantly.
the reason provided is incorrect. This mismatch clarifies
19. Which is NOT a built-in Python exception class?
the distinct roles of network devices.
(A) ValueError
17. Match each network topology with its brief (B) KeyError
characteristic: (C) InputMismatchError
(D) ZeroDivisionError
Column A Column B
1. Bus a. Each node connected  Ans
sequentially in a closed (C) InputMismatchError
loop ValueError arises when a function receives an argument
2. Star b. All nodes linked directly of inappropriate type. KeyError indicates a missing
to a central device key in a dictionary. ZeroDivisionError is triggered by
3. Ring c. Every node connected to division by zero. InputMismatchError does not exist
every other node in standard Python libraries; it’s found in some other
languages but not Python’s built-in exceptions. This
4. Mesh d. All devices share a single
underscores Python’s specific error hierarchy.
communication line
Options: 20. Why is the ‘finally’ block used in Python exception
(A) 1-c, 2-a, 3-b, 4-d handling?
(B) 1-d, 2-b, 3-a, 4-c (A) It executes only if an exception occurs
(C) 1-b, 2-c, 3-d, 4-a (B) It executes only if no exception occurs
(D) 1-a, 2-d, 3-b, 4-c (C) It ensures specified code runs regardless of
exception status
Ans
(D) It bypasses error messages entirely
(B) 1-d, 2-b, 3-a, 4-c
 Ans
In a Bus topology, all devices use a single communication (C) It ensures specified code runs regardless of exception
backbone. Star topology has a central hub or switch status
linking devices individually. Ring topology arranges The ‘finally’ block runs code unconditionally after try-
nodes in a loop structure. Mesh topology creates multiple except blocks, whether an exception was raised or not.
direct links, providing redundancy by connecting each This feature is commonly used for cleanup actions,
node to every other node. This ensures varied fault- like closing files or network connections. Its primary
tolerance and performance outcomes. purpose is to guarantee that crucial operations execute,
independent of whether an error occurred. It fosters
18. Which networking device best expands a local network robust and safe code structure.
by forwarding data to the correct destination segment
only? 21. Which statements are true about opening files in Python
(A) Repeater in different modes?
1. ‘r’ opens a file for reading, error if not found

Downloaded from www.mcqgpt.com


PRACTICE PAPER 17

2. ‘w’ appends content to existing file (B) A stack removes items from the top, a queue
3. ‘a’ creates a file if it doesn’t exist removes items from the front
4. ‘b’ indicates binary mode (C) A stack never removes items, a queue does remove
(A) 1 and 4 are correct items
(B) 2 and 3 are correct (D) A stack uses indices, a queue uses references
(C) 1, 3, and 4 are correct  Ans
(D) 2, 3, and 4 are correct
(B) A stack removes items from the top, a queue removes
Ans items from the front
(C) 1, 3, and 4 are correct In a stack, the last inserted element is removed first
‘r’ is used for read mode and raises an error if the file (LIFO). In a queue, the first inserted element is removed
is missing. ‘a’ appends to a file or creates it if absent. ‘b’ first (FIFO). Thus, stacks pop from the top, while queues
indicates binary mode for non-text data. However, ‘w’ dequeue from the front. This fundamental difference
overwrites existing content instead of merely appending defines their usage in different algorithmic scenarios. It
to it. This distinction is critical for correct file handling highlights opposing insertion-removal sequences.
practice.
25. Assertion (A) : A queue processes elements in First In
22. Which Python function best ensures objects are stored First Out order.
in a binary file with their structure preserved? Reason (R) : A queue always places new elements at the
(A) open() with ‘wb’ mode front.
(B) pickle.dump() (A) Both A and R are true, and R is the correct
(C) readlines() explanation of A
(D) input() (B) Both A and R are true, but R is not the correct
Ans explanation of A
(C) A is true, but R is false
(B) pickle.dump() (D) A is false, but R is true
The pickle.dump() function serializes Python objects and
writes them to a binary file, preserving object structure.  Ans
While open() with ‘wb’ creates or opens a binary file, (C) A is true, but R is false
pickle.dump() specifically handles the conversion of Queues use FIFO, meaning the earliest enqueued
Python data into a storable format. readlines() and element is served first. However, new elements are
input() are unrelated to object serialization. This method enqueued at the rear, not the front. Front is reserved
maintains complex data integrity. for removal. Consequently, while the assertion about
FIFO order is correct, the reason stating new elements
23. What is the primary characteristic of a stack data go in front is incorrect. This clarifies standard queue
structure? operations.
(A) FIFO (First In First Out)
(B) LIFO (Last In First Out) 26. What is the main difference between a queue and a
(C) Random access retrieval deque (double-ended queue)?
(D) Direct indexing (A) A queue allows insertion only from both ends
Ans (B) A deque allows insertion and deletion at both ends
(C) A queue can only delete elements from both ends
(B) LIFO (Last In First Out) (D) A deque restricts all operations to the front only
A stack follows the Last In First Out principle, meaning
elements added most recently are removed first. This  Ans
push-pop mechanism maintains an orderly removal (B) A deque allows insertion and deletion at both ends
sequence. The earliest inserted items remain below A standard queue restricts insertion to the rear and
the topmost entries, awaiting removal once the upper removal from the front. In contrast, a double-ended
items have been popped. It contrasts with queues’ FIFO queue (deque) permits both insertion and deletion
arrangement, effectively. at either end. This flexible structure can function as a
regular queue or a stack, depending on how operations
24. How does a stack differ from a queue in terms of access? are used. It offers greater versatility for data handling.
(A) Both remove items from the front

Downloaded from www.mcqgpt.com


page 166 CUET UG Computer Science

27. In a sequential (linear) search, how are elements  Ans


typically checked? (A) 1 and 3 are correct
(A) All elements simultaneously Bubble Sort works by comparing and swapping adjacent
(B) From last to first only elements, making multiple passes through the list until
(C) From first to last until found or end it is sorted. Although it commonly proceeds left to right,
(D) By dividing the list into halves repeatedly the essential characteristic is repeated adjacency checks.
Ans It is not necessarily more efficient than Selection Sort;
performance can vary by dataset. Hence, options 1 and
(C) From first to last until found or end
3 hold true.
A sequential or linear search examines each item in
order, starting at the beginning of the list and proceeding 30. Which statement is NOT correct about Insertion Sort?
until the target is located or the entire structure has (A) It builds the sorted list incrementally
been searched. It is the simplest search method but (B) It inserts each new element into the correct position
can be inefficient for very large lists. Nonetheless, it’s (C) It always requires a separate data structure for
straightforward to implement. output
(D) Its average complexity is O(n2)
28. Match the following searching methods with their key
characteristic:  Ans
Column A Column B (C) It always requires a separate data structure for output
1. Binary Search a. Divides the list Insertion Sort works in-place, building the final sorted
repeatedly array within the same structure by inserting each
element into its correct position. While it can have
2. Linear Search b. O(log n) with a
O(n2) time complexity on average, it does not require
sorted list
an entirely separate data structure to hold the sorted
3. Best Case for c. O(1) if the element
output. This saves memory during sorting operations.
Binary Search is at the start
4. Worst Case for d. Checks every 31. Arrange the statistical measures in the order they are
Linear Search element typically calculated to summarize a dataset:
sequentially 1. Mean
Options: 2. Median
(A) 1-a, 2-d, 3-b, 4-c 3. Standard Deviation
(B) 1-d, 2-b, 3-c, 4-a 4. Variance
(C) 1-b, 2-c, 3-d, 4-a (A) 1 → 4 → 3 → 2
(D) 1-c, 2-d, 3-b, 4-a (B) 1 → 2 → 4 → 3
(C) 2 → 1 → 4 → 3
Ans
(D) 2 → 4 → 1 → 3
(A) 1-a, 2-d, 3-b, 4-c
 Ans
Binary Search repeatedly halves a sorted list to find the
target. Linear Search scans each element one by one. The (B) 1 → 2 → 4 → 3
best case for Binary Search is O(log n) in sorted data, Analysts commonly compute the mean, then median,
while the worst-case for Linear Search is O(n), though if followed by variance, and finally standard deviation.
the element is at the start, it’s found instantly. Mean and median provide central tendency insights,
while variance and standard deviation describe data
29. Which statements are true about Bubble Sort? spread around that center. This sequence often guides a
1. It repeatedly swaps adjacent elements to sort systematic approach to exploring data distributions. It’s
2. It compares elements in pairs from right to left a logical progression of descriptive analysis.
3. It can take multiple passes to fully sort
4. It is always more efficient than Selection Sort 32. How do mean and median differ in their sensitivity to
(A) 1 and 3 are correct extreme values?
(B) 2 and 4 are correct (A) Both are equally affected by outliers
(C) 1, 2, and 3 are correct (B) Mean is more influenced by extreme outliers than
(D) 1, 3, and 4 are correct median

Downloaded from www.mcqgpt.com


PRACTICE PAPER 17

(C) Median changes drastically with outliers, mean 1. Bluetooth is ideal for short-range communication
remains unaffected 2. Infrared requires direct line of sight
(D) Both remain unaffected by extreme values 3. WLAN (Wi-Fi) covers a maximum of five meters
Ans 4. Microwave links can transmit over long distances
(A) 1 and 2 are correct
(B) Mean is more influenced by extreme outliers than (B) 1, 2, and 4 are correct
median (C) 2 and 3 are correct
The mean is pulled toward extreme high or low values, (D) 3 and 4 are correct
because it factors every data point equally. By contrast,
the median, which is the middle value once data are  Ans
sorted, is less affected by extremely large or small points. (B) 1, 2, and 4 are correct
Outliers therefore disproportionately shift the mean. Bluetooth typically operates within a few meters, making
This distinction guides measure selection in skewed it suitable for short-range scenarios. Infrared indeed
datasets. requires line-of-sight transmission. Microwave links
can span significant distances with proper equipment.
33. Which wired communication medium uses light pulses WLAN often covers a broader range than five meters,
to transmit data? so statement 3 is incorrect. This highlights diverse use
(A) Twisted pair cable cases and limitations of wireless technologies.
(B) Optical fiber
(C) Coaxial cable 36. Which protocol best ensures reliable data transmission
(D) Ethernet cable through acknowledgment and retransmission
Ans mechanisms?
(A) HTTP
(B) Optical fiber (B) FTP
Optical fiber transmits data using pulses of light through (C) TCP
extremely thin glass or plastic strands. Twisted pair and (D) UDP
coaxial cables carry electrical signals, and Ethernet cable
generally refers to twisted pair standards like CAT5  Ans
or CAT6. Fiber optics enable higher bandwidth and (C) TCP
longer distances with minimal signal loss. It’s critical for TCP (Transmission Control Protocol) offers guaranteed
modern high-speed networks. delivery by establishing a connection, acknowledging
received segments, and retransmitting lost data. UDP
34. Why is switching important in data communication is connectionless and lacks built-in reliability. HTTP
networks? and FTP rely on TCP underneath but are higher-level
(A) It doubles the bandwidth protocols for web and file transfer, respectively. Thus,
(B) It randomly discards packets TCP ensures robust end-to-end communication control
(C) It decides how data is forwarded through effectively.
intermediate nodes
(D) It always encrypts data before sending 37. Which is NOT typically considered malicious software?
Ans (A) Virus
(B) Worm
(C) It decides how data is forwarded through (C) Trojan horse
intermediate nodes (D) Firewall
Switching techniques determine the path that data takes
from source to destination. By choosing specific routes  Ans
in the network, switches (or switching logic) optimize (D) Firewall
delivery efficiency. This does not inherently provide Viruses, worms, and Trojan horses are recognized
encryption or bandwidth doubling, but it helps ensure malware forms that damage or manipulate systems.
data reaches the correct location effectively. This is A firewall, however, is a security mechanism that
foundational for directed data flow. monitors and filters incoming and outgoing network
traffic based on predefined rules, protecting rather than
35. Which statements about wireless technologies are
correct?

Downloaded from www.mcqgpt.com


page 168 CUET UG Computer Science

harming systems. This distinction emphasizes firewall’s personalization on websites. This mapping clarifies
protective role against threats and unauthorized access. diverse security components and their respective roles.

38. Which statements are true regarding HTTPS (Hypertext 40. How does a Trojan horse differ from a worm in terms
Transfer Protocol Secure)? of spread?
1. It uses encryption to secure data (A) A Trojan self-replicates automatically, whereas a
2. It cannot be used for e-commerce transactions worm needs user installation
3. It employs SSL or TLS protocols (B) Trojans and worms spread identically
4. It is slower than HTTP due to encryption overhead (C) A Trojan requires user action to install disguised
(A) 1, 3, and 4 are correct software, while worms self-replicate
(B) 1 and 2 are correct (D) Worms never replicate, while Trojans always do
(C) 2 and 3 are correct  Ans
(D) 1 and 4 are correct
(C) A Trojan requires user action to install disguised
Ans software, while worms self-replicate
(A) 1, 3, and 4 are correct Trojans trick users into installing seemingly harmless
HTTPS implements SSL/TLS encryption to secure programs that secretly contain malicious payloads,
data transmission, commonly used for e-commerce, requiring explicit user action to initiate. Worms, in
login pages, and other sensitive transactions. As a contrast, replicate independently across networks,
result, it is typically slower than plain HTTP due to spreading without direct user intervention. This
encryption overhead, but this performance difference fundamental difference underscores Trojans’ reliance
is often minimal with modern hardware and protocols. on deception. Meanwhile, worms exploit network
Consequently, statements 1, 3, and 4 hold true. vulnerabilities automatically. Hence, infection methods
differ significantly.
39. Match each security concept with its function:
Direction :Carefully read the case study provided and then
Column A Column B
thoroughly answer the subsequent five questions.
1. Antivirus a. Protective software Students in a school are analyzing academic performance
scanning for malware data stored in a MySQL database. They use multiple tables
2. Firewall b. Stores small data in to store student records, including personal details, marks,
user’s browser and attendance. Teachers run complex SELECT queries
3. Hacker c. Controls inbound and with JOIN clauses to correlate exam scores across different
outbound network subjects, applying aggregate functions like AVG and
traffic COUNT. Meanwhile, the IT administrator emphasizes
4. Cookie d. An individual who tries database normalization to prevent redundancy and
to gain unauthorized maintains referential integrity by assigning primary and
access foreign keys. The system also has a Python-based module
for generating result summaries, reading data from CSV
Options:
files and writing them back into a binary file with pickle.
(A) 1-a, 2-c, 3-d, 4-b
For data security, the school implements strong firewalls
(B) 1-d, 2-b, 3-c, 4-a
and regularly scans for malware, ensuring safe network
(C) 1-b, 2-c, 3-d, 4-a
access for teachers and students. This setup showcases
(D) 1-a, 2-d, 3-b, 4-c
practical database management, Python file handling,
Ans and cybersecurity precautions simultaneously.
(A) 1-a, 2-c, 3-d, 4-b
41. Which SQL feature mentioned helps relate exam scores
Antivirus detects and removes malware, while a firewall
from different subject tables?
monitors and filters network traffic. A hacker attempts
(A) GROUP BY
to breach systems without proper authorization.
(B) JOIN clauses
Cookies store small pieces of information locally in
(C) ORDER BY
a user’s browser, enabling session maintenance or
(D) WHERE filters
 Ans

Downloaded from www.mcqgpt.com


PRACTICE PAPER 17

(B) JOIN clauses Firewalls filter and monitor inbound and outbound
By using JOIN, tables are linked based on common traffic according to security rules. Normalization only
columns (keys), letting queries correlate data across addresses database schema design, JOIN queries handle
multiple subjects. GROUP BY groups rows, ORDER BY multi-table data retrieval, and CSV files are a storage
sorts results, and WHERE filters rows. JOIN specifically format. Firewalls specifically serve to safeguard network
merges rows from distinct tables into meaningful access by blocking unauthorized traffic. This prevents
combined results. This integration is crucial for multi- external threats from breaching internal systems.
table academic analytics.
45. Why is normalization valuable in a database storing
42. How does the IT administrator maintain referential student records?
integrity among related tables? (A) It duplicates data for faster reading
(A) Using repeated data fields (B) It merges all tables into one giant table
(B) Setting up foreign keys (C) It organizes data to reduce redundancy
(C) Removing all unique constraints (D) It encrypts all columns automatically
(D) Enabling only read operations  Ans
Ans (C) It organizes data to reduce redundancy
(B) Setting up foreign keys Normalization structures tables so that each piece
Referential integrity ensures records in a child table of data has a single, optimal location, minimizing
correspond to valid primary keys in a parent table. This unnecessary duplication. This practice helps maintain
is achieved by designating foreign keys that match the data integrity and efficiency. It does not automatically
primary key columns. Repeated data fields and read- encrypt columns or merge tables. Instead, it focuses on
only access do not automatically guarantee integrity; logical design to prevent repetitive, inconsistent storage.
foreign keys do. This method prevents invalid cross- This yields cleaner and more maintainable databases.
references in linked tables.
Direction :Carefully read the case study provided and then
43. Which Python operation is used to store objects in a thoroughly answer the subsequent five questions.
binary file? An e-commerce startup deploys a Python application
(A) open(file.txt, r) managing customer orders. The app logs transactions
(B) pickle.dump() in a MySQL database, using multiple relational tables
(C) write() with string conversion for products, customers, and payments. To maintain
(D) readlines() performance, indexes are applied on frequently searched
Ans columns, and the team uses SELECT queries with JOIN
to generate sales reports. Exception handling in Python
(B) pickle.dump() ensures that payment gateway errors or file I/O issues
The pickle.dump() function in Python serializes objects, are gracefully caught. The system also employs bubble
preserving their structure and data, then writes them to sort for sorting daily order summaries in memory due
a binary file. While open() sets the file mode, dump() to simplicity. Network connectivity relies on a secured
performs the actual serialization. Converting to string Wi-Fi link, with encryption protocols preventing data
and using readlines() are not correct for preserving interception. Firewalls and antivirus software protect
object integrity. This ensures Python data remains intact sensitive payment records. Data backups are performed
upon retrieval. regularly to safeguard order history, and routine updates
44. Which measure mentioned in the scenario protects the keep all security measures current. This integrated
school’s network from malicious attacks? approach illustrates concurrency, security, sorting, and
(A) Normalization robust operations.
(B) Firewalls 46. Which database feature is used to optimize frequently
(C) CSV files searched columns?
(D) JOIN queries (A) Foreign key
Ans (B) Indexes
(B) Firewalls (C) GROUP BY
(D) Triggers

Downloaded from www.mcqgpt.com


page 170 CUET UG Computer Science

Ans (C) Antivirus software


(B) Indexes Antivirus software regularly scans the system for
An index speeds up data retrieval by allowing the malicious files or activities, helping guard against
database to locate rows more efficiently on frequently threats that could compromise payment data. Bubble
searched columns. Foreign keys maintain referential sort is a sorting technique, while network encryption
integrity, GROUP BY aggregates data, and triggers secures data transmission. Python’s readlines() simply
automate actions on table events. Indexes specifically reads file content and does not directly protect data
enhance query performance. They reduce search time from malware. Hence, antivirus is key in preserving
and enhance overall application responsiveness. data integrity.

47. Why does the Python application handle exceptions, 50. Why are regular data backups performed?
especially for payment gateway errors? (A) To erase order history daily
(A) To terminate the program immediately (B) To maintain bandwidth usage
(B) To prevent data backups (C) To ensure data restoration in case of system failure
(C) To gracefully recover and maintain system stability (D) To merge all user accounts into one table
(D) To remove the entire database schema  Ans
Ans (C) To ensure data restoration in case of system failure
(C) To gracefully recover and maintain system stability Frequent backups protect critical information, enabling
Proper exception handling allows the software to catch system administrators to restore lost or corrupted
and manage runtime issues like payment gateway data after unexpected events. This approach prevents
failures or file I/O errors without crashing. Instead of permanent data loss if hardware malfunctions, software
abruptly stopping, it can log errors, retry operations, bugs, or security breaches occur. It does not relate
or alert administrators. This ensures the application to bandwidth, daily erasures, or table consolidation.
remains stable during unexpected events. Such resilience Backups are essential for robust business continuity.
enhances user trust significantly.
 **************
48. Which sorting method mentioned organizes daily order
summaries in memory?
(A) Selection Sort
(B) Bubble Sort
(C) Merge Sort
(D) Quick Sort
Ans
(B) Bubble Sort
Bubble Sort iteratively compares and swaps adjacent
elements to place them in order. Although not the most
efficient for large datasets, it remains straightforward and
was chosen for simplicity in the described application.
Selection Sort, Merge Sort, and Quick Sort each use
different approaches. This choice reflects practicality
over optimal performance.

49. Which measure in the scenario helps protect payment


records from malware?
(A) Network encryption
(B) Bubble sort
(C) Antivirus software
(D) Python’s readlines()
Ans

Downloaded from www.mcqgpt.com


PRACTICE PAPER 18

PRACTICE PAPER 18

1. Which term describes a set of permissible values that backup is unrelated, and primary keys do not enforce
can appear in a particular column of a relational table? repeated data; they prevent it.
(A) Candidate Key
4. Which is NOT a recommended practice in relational
(B) Domain
(C) Tuple database design?
(D) Schema (A) Normalizing tables
(B) Using primary keys
Ans (C) Enforcing referential integrity
(B) Domain (D) Duplicating entire tables with redundant data
In relational databases, the domain of a column defines  Ans
the valid range of values that column may contain. This
enforces consistency by preventing invalid entries. A (D) Duplicating entire tables with redundant data
candidate key is a column or group of columns uniquely Best practices include normalizing to reduce duplication,
identifying records; a tuple is a row; a schema outlines designating primary keys for unique identification, and
the database structure. using foreign keys to maintain referential integrity.
Creating multiple copies of the same table with
2. Which key in a database table ensures there are no redundant data undermines consistency and wastes
duplicate values for that column, but does not necessarily storage. Hence, duplicating entire tables is not advisable
serve as the primary identifier? in sound database design.
(A) Foreign key
5. How does a foreign key differ from an alternate key?
(B) Alternate key
(C) Composite key (A) A foreign key references a primary key in another
(D) Secondary index table; an alternate key is an unused candidate key in
the same table
Ans (B) They function identically
(B) Alternate key (C) A foreign key cannot link tables; an alternate key
An alternate key is a candidate key that isn’t chosen to must link tables
be the primary key but still uniquely identifies rows. A (D) A foreign key must always be numeric; an alternate
foreign key links to another table’s primary key, and a key must be text-based
composite key combines multiple columns. A secondary  Ans
index may speed searches but doesn’t inherently ensure
uniqueness like an alternate key does. (A) A foreign key references a primary key in another
table; an alternate key is an unused candidate key in the
3. Why are primary keys crucial in a relational database? same table
(A) They store images and videos A foreign key provides a link to a primary key in a
(B) They ensure each row can be uniquely identified different table, creating relationships among tables.
(C) They serve only as backup references An alternate key is simply a candidate key that wasn’t
(D) They enforce repeated data entries chosen as the primary key. They serve different purposes
Ans in relational modeling, emphasizing how external and
internal references differ.
(B) They ensure each row can be uniquely identified
A primary key differentiates each record from any other 6. Which SQL statement is used to remove an existing
in the same table, preventing duplication and fostering table from the database?
reliable lookups. This is foundational for maintaining (A) DELETE TABLE
relational integrity. Storing multimedia or acting as a (B) REMOVE TABLE

Downloaded from www.mcqgpt.com


page 172 CUET UG Computer Science

(C) DROP TABLE (A) 3→5→6→1→2→4


(D) CLEAR TABLE (B) 3→6→5→1→2→4
Ans (C) 3→5→1→6→2→4
(D) 5→3→6→1→2→4
(C) DROP TABLE
DROP TABLE is the SQL command that deletes the  Ans
entire table definition and its data from the database. (A) 3 → 5 → 6 → 1 → 2 → 4
DELETE removes rows, but not the schema itself. Logically, the query first selects columns, specifies
REMOVE TABLE and CLEAR TABLE aren’t recognized from which table(s) data is drawn, applies a row filter
statements in standard SQL. Thus, DROP TABLE is the (WHERE), groups rows (GROUP BY), filters groups
direct way to discard a table fully. (HAVING), then sorts the final output (ORDER BY).
This reflects the internal processing steps of many SQL
7. Which language category in SQL is primarily used for engines, even though some are written in a different
creating and modifying database structures? sequence.
(A) DML (Data Manipulation Language)
(B) DQL (Data Query Language) 10. Match each SQL clause with its function:
(C) DDL (Data Definition Language)
Column A Column B
(D) TCL (Transaction Control Language)
1. WHERE a. Sorts query output
Ans
2. ORDER BY b. Filters individual rows
(C) DDL (Data Definition Language) before grouping
DDL includes statements like CREATE, DROP, and 3. GROUP BY c. Filters aggregated
ALTER, which define or change database objects. DML groups
(INSERT, UPDATE, DELETE) manipulates data; DQL
4. HAVING d. Clusters rows for
(SELECT) queries data; TCL (COMMIT, ROLLBACK)
aggregation
handles transaction controls. DDL specifically manages
the structural aspects of databases. Options:
(A) 1-b, 2-a, 3-d, 4-c
8. Which SQL operation best fetches only unique tuples of (B) 1-d, 2-b, 3-c, 4-a
a table? (C) 1-b, 2-c, 3-d, 4-a
(A) SELECT * (D) 1-a, 2-d, 3-b, 4-c
(B) SELECT DISTINCT
 Ans
(C) SELECT COUNT
(D) SELECT TOP (A) 1-b, 2-a, 3-d, 4-c
WHERE discards rows that fail given conditions.
Ans
ORDER BY sorts final results. GROUP BY clusters rows
(B) SELECT DISTINCT by column values for aggregate calculations. HAVING
SELECT DISTINCT returns only distinct rows, discards entire groups based on aggregate conditions.
removing duplicates based on all specified columns. Each clause operates at a distinct stage of query
SELECT * retrieves every row (including duplicates), processing, ensuring organized filtering and sorting.
SELECT COUNT yields counts, and SELECT TOP
(or LIMIT in some dialects) restricts how many rows 11. Why are aggregate functions like AVG, SUM, and
appear but doesn’t eliminate duplicates. Distinct ensures COUNT often paired with GROUP BY?
uniqueness in result sets. (A) They work only on distinct columns
(B) They compute aggregates for each group formed
9. Arrange the typical sequence of clauses in a standard (C) They delete the original table data
SQL SELECT query: (D) They exclusively retrieve string values
1. GROUP BY
 Ans
2. HAVING
3. SELECT (B) They compute aggregates for each group formed
4. ORDER BY GROUP BY partitions rows that share certain column
5. FROM values, letting aggregate functions process each subgroup
6. WHERE independently. This yields per-group calculations such

Downloaded from www.mcqgpt.com


PRACTICE PAPER 18

as average scores or total sums. These functions don’t (B) INNER JOIN returns matching rows; LEFT JOIN
delete data nor are they restricted to distinct columns returns all rows from the left table and matching rows
only; they handle multiple column types seamlessly. from the right
INNER JOIN results include only rows satisfying the
12. Which of the following is NOT an aggregate function join condition in both tables. LEFT JOIN includes
in SQL? all rows from the left table, plus matched data from
(A) MIN() the right table. Unmatched right table entries become
(B) MAX() NULL in columns. They differ significantly in handling
(C) SUBSTR() incomplete matches.
(D) AVG()
15. Match each network term with its primary characteristic:
Ans
(C) SUBSTR() Column A Column B
SUBSTR() (or SUBSTRING()) is a string function, not 1. LAN a. Interconnects smaller
an aggregate. MIN() and MAX() find minimum and geographic areas like a
maximum values, respectively, while AVG() calculates building
the average. Aggregate functions summarize multiple 2. WAN b. A global network of
rows’ values. String functions like SUBSTR() process interconnected systems
text but do not aggregate over sets of rows. 3. MAN c. Serves large-scale regions,
13. Assertion (A) : The HAVING clause can filter grouped often countrywide or
results. international
Reason (R) : The WHERE clause cannot filter rows 4. Internet d. Covers a city or metropolitan
containing aggregate function output. region
(A) Both A and R are true, and R is the correct Options:
explanation of A (A) 1-a, 2-c, 3-d, 4-b
(B) Both A and R are true, but R is not the correct (B) 1-d, 2-b, 3-c, 4-a
explanation of A (C) 1-b, 2-c, 3-d, 4-a
(C) A is true, but R is false (D) 1-a, 2-d, 3-b, 4-c
(D) A is false, but R is true
 Ans
Ans
(A) 1-a, 2-c, 3-d, 4-b
(A) Both A and R are true, and R is the correct A Local Area Network (LAN) spans a small location.
explanation of A A Wide Area Network (WAN) connects distant sites
HAVING is applied after GROUP BY to filter aggregated across large regions. A Metropolitan Area Network
data. WHERE applies to raw rows before grouping, (MAN) covers a city. The Internet is a worldwide set of
so it cannot directly evaluate aggregate outputs. Thus, interconnected networks, transcending local or regional
the statement and reason align: HAVING is essential boundaries.
for conditions involving sums, counts, or averages on
grouped results. 16. Which device is primarily responsible for connecting
multiple networks and directing data based on IP
14. How does an INNER JOIN differ from a LEFT JOIN in addresses?
SQL? (A) Hub
(A) INNER JOIN returns all rows from both tables; (B) Switch
LEFT JOIN returns only matching rows (C) Repeater
(B) INNER JOIN returns matching rows; LEFT JOIN (D) Router
returns all rows from the left table and matching
 Ans
rows from the right
(C) They function identically (D) Router
(D) LEFT JOIN omits all matching rows, whereas A router examines IP addresses in data packets and
INNER JOIN omits mismatches forwards them to the appropriate destination network.
Hubs repeat signals to all ports, switches segment local
Ans

Downloaded from www.mcqgpt.com


page 174 CUET UG Computer Science

traffic by MAC addresses, and repeaters amplify signals. A bus topology indeed involves a single backbone cable
Routers connect distinct networks, facilitating the flow shared by all devices. However, a bus arrangement is
of packets beyond a single LAN. traditionally wired, with nodes tapping into the main
cable. It does not rely on a central wireless access point.
17. Which of the following is NOT typically part of a LAN’s The assertion is correct, but the reason is incorrect.
hardware setup?
(A) Switch 20. Which protocol provides a reliable, connection-oriented
(B) Router configured for local IP traffic data stream between two hosts?
(C) Hub (A) UDP
(D) Satellite transponder for interplanetary (B) IP
communication (C) TCP
Ans (D) ICMP

(D) Satellite transponder for interplanetary  Ans


communication (C) TCP
LANs usually involve switches, hubs, or routers to TCP (Transmission Control Protocol) establishes a
manage local data traffic in buildings or campuses. virtual connection, ensuring reliable, in-order delivery
Satellite transponders for interplanetary links are of data with acknowledgments and retransmissions.
beyond the scope of typical LAN hardware. Thus, (D) is UDP lacks these features, IP is the underlying addressing
not a standard element of local network infrastructure. protocol, and ICMP handles diagnostic/error messages.
TCP is best suited when accuracy and guaranteed
18. How does a hub differ from a switch in a LAN? delivery matter most.
(A) Both forward traffic only to the intended destination
port 21. Which Python statement is used to handle potential
(B) A hub simply broadcasts incoming data to all ports; runtime errors that could terminate the program?
a switch forwards data to a specific destination (A) if-else
(C) A hub encrypts data; a switch sends data in plaintext (B) try-except
(D) Switches must be wireless, while hubs are always (C) while-else
wired (D) class-exception
Ans  Ans
(B) A hub simply broadcasts incoming data to all ports; (B) try-except
a switch forwards data to a specific destination The try-except block in Python intercepts exceptions that
Hubs lack intelligence to direct traffic selectively, sending might otherwise halt execution, allowing the program to
all data to every port. Switches examine MAC addresses handle errors gracefully. if-else conditions logic, while-
and forward frames only to the intended device, else loops manage iteration, and class-exception isn’t a
reducing congestion. Encryption is not automatically valid statement. The try-except construct is central to
offered by either, and both can be wired devices. Python error management.

19. Assertion (A) : A bus topology shares a single central 22. Which built-in Python exception is raised when a
cable for communication. dictionary key is not found?
Reason (R) : In a bus topology, each node connects (A) KeyError
wirelessly to a central access point. (B) IndexError
(A) Both A and R are true, and R is the correct (C) LookupError
explanation of A (D) EOFError
(B) Both A and R are true, but R is not the correct  Ans
explanation of A
(C) A is true, but R is false (A) KeyError
(D) A is false, but R is true A KeyError arises specifically when attempting to
access a non-existent key in a dictionary. IndexError
Ans appears when a list index is out of range, LookupError
(C) A is true, but R is false is a broader category for lookup failures, and EOFError

Downloaded from www.mcqgpt.com


PRACTICE PAPER 18

occurs when input() hits an end-of-file condition. 26. How does Python’s write() method differ between text
KeyError is unique to dictionary key retrieval. and binary file modes?
(A) Text mode write() rejects all non-ASCII data;
23. Which of the following modes does NOT open a file for binary mode permits only ASCII
writing in Python? (B) Text mode auto-converts newlines; binary mode
(A) ‘w’ writes raw bytes
(B) ‘a’ (C) They behave identically
(C) ‘x’ (D) Both modes automatically decode data
(D) ‘r+’
 Ans
Ans
(B) Text mode auto-converts newlines; binary mode
(D) ‘r+’ writes raw bytes
The ‘r+’ mode opens a file for both reading and writing In text mode, Python may translate \n to the system’s
but does not create a new file if it doesn’t exist, and it native line ending, while binary mode writes byte data
primarily expects existing data. ‘w’ overwrites or creates, exactly as is. They do not behave identically, nor is ASCII
‘a’ appends or creates, and ‘x’ creates a file if it doesn’t data exclusively allowed in one or the other. Automatic
already exist. Hence, ‘r+’ differs. decoding is not done unless explicitly performed.
24. Why might you choose a binary file over a text file in 27. What is the primary role of a stack in evaluating
Python? arithmetic expressions?
(A) Binary files are always smaller (A) It randomly rearranges operators and operands
(B) To store serialized objects or raw bytes accurately (B) It queues all numbers for first-in-first-out
(C) They are easier to edit manually processing
(D) They automatically compress data (C) It temporarily holds operators and operands for
Ans postfix or prefix evaluation
(B) To store serialized objects or raw bytes accurately (D) It automatically sorts the final expression
Binary files retain exact byte patterns, making them  Ans
suitable for images, serialized objects, or arbitrary data. (C) It temporarily holds operators and operands for
Text files can corrupt non-text content due to character postfix or prefix evaluation
encoding assumptions. Manual editing is simpler in text Stack-based algorithms are frequently used to convert
files, and binary files don’t always compress or shrink in infix to postfix (or prefix) and then evaluate the
size automatically. expression. The stack holds operators until they can be
25. Which statements are true about Python’s pickle applied, maintaining correct operation order. It doesn’t
module? randomly rearrange or sort; it provides last-in-first-out
1. It serializes Python objects access that matches many expression-processing rules.
2. It is used only for text data 28. Why is a stack considered a LIFO structure?
3. It can write to binary files (A) Items are processed in alphabetical order
4. It automatically encrypts objects (B) The last item pushed is the first to pop out
(A) 1 and 3 are correct (C) It always empties all items automatically
(B) 1, 3, and 4 are correct (D) It maintains items in ascending numerical order
(C) 2 and 3 are correct
(D) 1, 2, and 4 are correct  Ans

Ans (B) The last item pushed is the first to pop out
A stack’s defining principle is Last In First Out. Each
(A) 1 and 3 are correct push operation places a new item on top, and the next
The pickle module serializes Python objects (1) and pop removes that top item. The other choices do not
can write them to binary files (3). It does not handle reflect the essential LIFO property. Stacks do not auto-
encryption (4) nor is it limited to text data (2). Pickling empty nor guarantee any sorting of elements.
captures an object’s structure so it can be reconstructed
later. It’s crucial for preserving object states persistently. 29. Assertion (A) : A queue follows FIFO.
Reason (R) : Each new element is always inserted at the

Downloaded from www.mcqgpt.com


page 176 CUET UG Computer Science

front, and removal is from the rear. (A) 1, 3, and 4 are correct
(A) Both A and R are true, and R is the correct (B) 1 and 2 are correct
explanation of A (C) 2, 3, and 4 are correct
(B) Both A and R are true, but R is not the correct (D) 1 and 4 are correct
explanation of A  Ans
(C) A is true, but R is false
(D) A is false, but R is true (A) 1, 3, and 4 are correct
Binary Search needs a sorted list (1), locates the mid-
Ans point for each comparison (3), and discards half the
(C) A is true, but R is false search space with each iteration (4). Its best-case
A queue does indeed follow First In First Out (A is true), complexity is O(1) if the target is immediately found,
but new elements are enqueued at the rear, and items with overall average and worst-case O(log n), not
are removed from the front. The reason incorrectly O(n^2).
states the opposite insertion direction. Hence, the
33. Which sorting algorithm is typically the easiest to
overall explanation fails, even though the queue’s FIFO
principle remains correct. implement but can be inefficient for large datasets?
(A) Merge Sort
30. Which operation is NOT valid for a standard linear (B) Bubble Sort
queue data structure? (C) Quick Sort
(A) Enqueue at the rear (D) Heap Sort
(B) Dequeue from the front  Ans
(C) Peek at the front element
(D) Direct insertion in the middle (B) Bubble Sort
Bubble Sort involves repeated passes, swapping adjacent
Ans out-of-order elements. It’s straightforward to code
(D) Direct insertion in the middle and understand, making it popular for educational
A normal queue restricts insertion to the rear and purposes, but with O(n^2) time complexity, it’s slow on
removal from the front. Peeking can show the front large datasets. Merge Sort, Quick Sort, and Heap Sort
element. However, queue design disallows insertion can offer better average performance on bigger inputs.
directly into the middle. That would violate the strict
34. How does Selection Sort differ from Insertion Sort?
FIFO ordering fundamental to the queue concept.
(A) Selection Sort finds the minimum each pass;
31. Which searching algorithm checks each element Insertion Sort inserts elements into their correct
sequentially until the target is found or the list ends? position gradually
(A) Binary Search (B) They both do merges of sublists
(B) Ternary Search (C) Selection Sort requires additional data structures;
(C) Linear Search Insertion Sort is always in-place
(D) Exponential Search (D) They have entirely distinct time complexities, with
Ans Selection Sort at O(1)

(C) Linear Search  Ans


Linear (sequential) search inspects each item in turn, (A) Selection Sort finds the minimum each pass;
starting from the first. It terminates when the target Insertion Sort inserts elements into their correct
is found or the entire list is exhausted. Binary Search position gradually
repeatedly halves the list, Ternary Search splits into Selection Sort locates the smallest element in each
three parts, and Exponential Search doubles indices to pass and swaps it into position, whereas Insertion Sort
find a bound before using Binary Search. shifts items until the new element is placed correctly in
a partially sorted list. Both are typically in-place, and
32. Which statements are correct about Binary Search? each has an O(n^2) worst-case complexity. They do not
1. It requires a sorted list merge sublists like Merge Sort.
2. Its complexity is O(n^2) in the best case
3. It compares the middle element with the target 35. Which statements correctly describe Insertion Sort?
4. It can discard half of the search space each iteration 1. It builds the final sorted array incrementally

Downloaded from www.mcqgpt.com


PRACTICE PAPER 18

2. It is more efficient than Quick Sort for large inputs  Ans


3. Each new element is placed in its proper location (B) Frequency Distribution
among already sorted elements A frequency distribution shows the count or frequency of
4. Its average time complexity is O(n^2) each value or interval within a dataset. Mean is a central
(A) 1, 3, and 4 are correct tendency measure, range is the difference between max
(B) 2 and 4 are correct and min, and standard error concerns the variability of
(C) 1, 2, and 3 are correct a sample statistic relative to the population. Frequency
(D) 1 and 2 are correct distribution specifically tabulates occurrences.
Ans
39. How do variance and standard deviation differ?
(A) 1, 3, and 4 are correct (A) Variance is measured in the same units as the data,
Insertion Sort incrementally creates a sorted portion while standard deviation is in squared units
(1), placing each new element in its proper spot (3) with (B) They are identical measures
an average complexity of O(n^2) (4). It is typically less (C) Variance uses squared differences; standard
efficient than Quick Sort for large datasets, so statement deviation is the square root of variance
2 is incorrect. (D) Variance is always larger than standard deviation
by a fixed factor of 2
36. Which of the following is NOT a feature of Merge Sort?
(A) Divide-and-conquer approach  Ans
(B) O(n log n) average complexity (C) Variance uses squared differences; standard
(C) In-place sorting by default deviation is the square root of variance
(D) Merging sorted sublists The variance is computed by averaging the squared
Ans deviations from the mean, while standard deviation is
the square root of that variance, returning the measure
(C) In-place sorting by default
to the original data units. They are related but not
Merge Sort typically requires additional space to merge
identical, and there is no constant factor of 2 difference.
sublists, meaning it’s not in-place by default. It uses
divide-and-conquer and has O(n log n) complexity 40. Arrange these analytical steps in typical order when
in average and worst cases. The central step involves interpreting data:
merging independently sorted sublists. 1. Compute measures of central tendency
2. Compute measures of dispersion
37. Which term describes the measure of spread that is the
3. Identify outliers
square root of the variance?
4. Visualize data distribution
(A) Mean
(A) 1 → 2 → 3 → 4
(B) Standard Deviation
(B) 2 → 1 → 4 → 3
(C) Median
(C) 1 → 4 → 3 → 2
(D) Mode
(D) 4 → 1 → 2 → 3
Ans
 Ans
(B) Standard Deviation
(A) 1 → 2 → 3 → 4
Standard Deviation is the square root of the variance,
A common approach is to first calculate central
indicating the average distance of data points from
tendency (mean, median), then measures of spread
the mean. The mean is an average, the median is
(variance, standard deviation), next spot outliers using
the middle value in sorted data, and the mode is the
those metrics, and finally visualize the data in charts or
most frequently occurring value. Standard Deviation
graphs. This sequence aids systematic understanding
measures distribution spread.
before final insights are drawn.
38. Which statistic indicates how often each value occurs in
41. Which switching technique in data communication
a dataset?
segments data into fixed-size units for transmission?
(A) Mean
(A) Circuit Switching
(B) Frequency Distribution
(B) Packet Switching
(C) Range
(C) Message Switching
(D) Standard Error

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


page 178 CUET UG Computer Science

(D) Cell Switching (ATM) 4. It forms the basis of data communication for the
Ans World Wide Web
(A) 1, 3, and 4 are correct
(D) Cell Switching (ATM) (B) 1, 2, and 4 are correct
Asynchronous Transfer Mode (ATM) uses a fixed cell (C) 2 and 4 are correct
size (53 bytes) for data transmission. Packet switching (D) 1 and 2 are correct
typically handles variable packet sizes, circuit switching
dedicates a complete channel, and message switching  Ans
treats entire messages as units. ATM’s cell switching is (A) 1, 3, and 4 are correct
distinct for its uniform cell length. HTTP is inherently stateless, relying on TCP underneath
for reliable transport, and underpins most web traffic.
42. How does wired Ethernet differ from Wi-Fi in typical It does not automatically encrypt data (that’s HTTPS).
data communication? Statement 2 is false since standard HTTP sends data in
(A) Ethernet uses cables for transmission; Wi-Fi relies plaintext. Hence, 1, 3, and 4 are correct.
on radio waves
(B) Ethernet always has lower speed; Wi-Fi always has 45. Which security feature best ensures data cannot be
higher speed easily read if intercepted over a wireless connection?
(C) Both require line-of-sight connections (A) MAC address filtering
(D) Wi-Fi cannot handle encryption, while Ethernet (B) Strong encryption protocol (e.g., WPA2/WPA3)
can (C) Disabling SSID broadcast
Ans (D) Allocating static IP addresses

(A) Ethernet uses cables for transmission; Wi-Fi relies  Ans


on radio waves (B) Strong encryption protocol (e.g., WPA2/WPA3)
Ethernet typically employs twisted pair or fiber cables, WPA2/WPA3 apply robust encryption to wireless
whereas Wi-Fi uses wireless radio signals. Speeds vary transmissions, safeguarding data from eavesdroppers.
based on standards and implementations, not strictly MAC filtering, static IPs, and hidden SSIDs provide
cable vs. wireless. Neither technology strictly mandates minimal extra security. Encryption ensures meaningful
line-of-sight, and both can support encryption. The data is unreadable without the proper key, making it the
fundamental difference is wired versus wireless data best defense against unauthorized interception.
transfer.
46. Which of these is NOT a direct security threat?
43. Which is NOT a primary characteristic of Bluetooth (A) Virus
technology? (B) Worm
(A) Short-range communication (C) Trojan Horse
(B) Utilizes radio frequency (D) Keyboard Shortcuts
(C) Typically spans many kilometers  Ans
(D) Low power consumption
(D) Keyboard Shortcuts
Ans Viruses, worms, and Trojan horses are forms of
(C) Typically spans many kilometers malicious software. Keyboard shortcuts are simply user
Bluetooth is a short-range, low-power wireless interface features that trigger commands quickly, posing
technology operating at around 2.4 GHz, with typical no inherent security risk. Thus, they’re not considered
effective ranges of a few meters to tens of meters. It’s threats compared to genuine malware that can harm or
unsuited for many-kilometer distances. Hence, (C) is not steal information.
a real characteristic of standard Bluetooth deployments.
47. Assertion (A) : Firewalls monitor incoming and
44. Which statements correctly describe HTTP (Hypertext outgoing network traffic.
Transfer Protocol)? Reason (R) : Firewalls are primarily used to detect
1. It is stateless by default hardware malfunctions on a local system.
2. It guarantees message integrity with automatic (A) Both A and R are true, and R is the correct
encryption explanation of A
3. It uses TCP as the underlying transport (B) Both A and R are true, but R is not the correct

Downloaded from www.mcqgpt.com


PRACTICE PAPER 18

explanation of A
(C) A is true, but R is false Phishing deceives victims into revealing credentials.
(D) A is false, but R is true Spyware collects information surreptitiously. Adware
Ans bombards devices with advertisements. Ransomware
denies access to data until a ransom is paid. Each
(C) A is true, but R is false threatens users differently and can cause harm if not
Firewalls indeed inspect and filter traffic based on mitigated properly.
security policies (A is correct). However, they are not
chiefly used for detecting hardware failures. That role 50. How does a Worm differ from a Virus regarding
falls to diagnostic tools and system monitors. Thus, replication?
while the assertion is valid, the reason is inaccurate. (A) A Worm depends on user action to replicate, while
a Virus replicates automatically
48. Which statements correctly describe HTTPS? (B) A Virus requires no host file, while a Worm needs a
1. It encrypts data using TLS or SSL file to infect
2. It is identical to HTTP in all respects (C) A Worm self-replicates over networks; a Virus
3. It is recommended for handling sensitive typically embeds itself in files or programs
information (D) They both require identical user actions to spread
4. It typically uses port 443
(A) 1, 3, and 4 are correct  Ans
(B) 1 and 2 are correct (C) A Worm self-replicates over networks; a Virus
(C) 2, 3, and 4 are correct typically embeds itself in files or programs
(D) 1, 2, and 4 are correct Worms spread autonomously through networks,
Ans whereas viruses need to attach to host files and rely
on some user action or execution path. Thus, a virus’s
(A) 1, 3, and 4 are correct replication usually depends on infected file transfers,
HTTPS incorporates encryption (TLS/SSL) to secure while worms replicate independently, highlighting their
data in transit, especially for sensitive content, and distinct infection vectors.
typically runs over port 443. It’s not identical to HTTP
in security features, so statement 2 is wrong. Hence, 1, 3, Direction :Carefully read the case study provided and then
and 4 accurately define HTTPS. thoroughly answer the subsequent five questions.
A small clinic uses a Python-based system to manage
49. Match each threat with its brief description: patient appointments, prescriptions, and billing. The
Column A Column B application stores structured data in a MySQL database
1. Phishing a. Steals sensitive with tables for patients, medical records, and invoices. The
data by imitation of receptionist interacts with a front-end that allows adding
trustworthy entities new appointments, while doctors update patient records
after each consultation. For security, staff members access
2. Spyware b. Shows unwanted
the system through unique credentials, and the clinic
advertisements to
employs a firewall to protect internal devices. Python’s
users
file handling features generate daily summary reports
3. Adware c. Secretly monitors user in both text and binary formats, with pickled objects
activity preserving statistical metrics on patient visits. The system
4. Ransomware d. Encrypts files and also incorporates Bubble Sort when displaying a day’s
demands payment appointments in ascending order of time. Weekly backups
Options: are performed to ensure data recovery in case of hardware
(A) 1-a, 2-c, 3-b, 4-d failure or malware attacks.
(B) 1-d, 2-b, 3-c, 4-a
51. Which MySQL feature likely prevents patient records
(C) 1-b, 2-c, 3-d, 4-a
from duplicating unnecessarily?
(D) 1-a, 2-d, 3-b, 4-c
(A) Using a single table for everything
Ans (B) Normalizing data into separate tables
(A) 1-a, 2-c, 3-b, 4-d (C) Disabling referential integrity

Downloaded from www.mcqgpt.com


page 180 CUET UG Computer Science

(D) Storing data only in text files  Ans

Ans (B) Bubble Sort


Bubble Sort is explicitly cited in the case study for
(B) Normalizing data into separate tables
ordering the day’s appointments in ascending time
Database normalization partitions data into multiple
sequence. Although not the most efficient for large
tables, each focusing on a specific topic, which prevents
datasets, it is easy to implement and sufficient for small
repeating large chunks of the same information. A
daily scheduling tasks. Other algorithms, like Selection
single massive table or text-only storage can cause
or Merge Sort, are not indicated here.
redundancies. Proper referential integrity ensures
relationships between tables but does not alone 55. Which routine measure helps the clinic recover from
eliminate duplication. Normalization does. possible malware attacks or system crashes?
(A) Logging out after each session
52. How is the system ensuring secure network access for
(B) Having strong Wi-Fi signals
staff members?
(C) Weekly data backups
(A) By removing all passwords
(D) Using bubble sort for daily appointments
(B) By employing a firewall and unique login credentials
(C) By forcing everyone to share a single admin account  Ans
(D) By storing passwords in plain text (C) Weekly data backups
Ans Regular backups allow the clinic to restore key
information after unexpected events. Logging out,
(B) By employing a firewall and unique login credentials
strong Wi-Fi, or sorting appointments do not guarantee
A firewall monitors inbound and outbound connections,
data recovery. Backups safeguard critical patient records
filtering unauthorized traffic. Unique credentials
and financial details in case of malicious software
ensure accountability and reduce unauthorized access.
infiltration or hardware malfunctions.
Removing passwords or sharing an admin account
weakens security, and storing passwords in plaintext Direction :Carefully read the case study provided and then
risks credential exposure. Hence, (B) is the proper thoroughly answer the subsequent five questions.
safeguard method. A startup selling handmade art uses a Python platform
integrated with MySQL to track orders, stock, and
53. Why might the clinic choose to store summary statistics
customer preferences. The stock table records each item’s
in binary with pickle?
name, price, and remaining quantity, while the orders
(A) It automatically encrypts all data
table documents when items are sold. By combining
(B) It preserves Python object structures neatly
these tables via SQL JOIN, the owners can identify which
(C) It prevents any backups from being taken
products sell fastest. They also rely on a queue structure
(D) It forces manual file editing for correctness
in Python for handling dispatch requests in the order they
Ans are received. Network-wise, the system employs WPA2
(B) It preserves Python object structures neatly encryption on Wi-Fi to safeguard transaction data.
The pickle module serializes Python objects and Additionally, an antivirus program and firewall monitor
writes them to a binary file, allowing complex data for malicious traffic. The developers implemented
(like dictionaries, lists) to be reloaded with structure selection sort to reorder an inventory list by ascending
intact. This is particularly useful for storing computed price whenever a staff member requests a sorted stock
statistics. It does not encrypt data automatically or report. Weekly backups preserve essential business records
hinder backups, and it doesn’t mandate manual file offline.
edits.
56. Which data structure mentioned helps dispatch items in
54. Which sorting method is mentioned for arranging the order requests arrive?
appointments by time? (A) Stack
(A) Selection Sort (B) Queue
(B) Bubble Sort (C) Graph
(C) Insertion Sort (D) Linked List
(D) Merge Sort  Ans

Downloaded from www.mcqgpt.com


PRACTICE PAPER 18

(B) Queue They strictly secure data availability by storing copies


A queue enforces First In First Out (FIFO), so the offline or on reliable media.
earliest dispatch request is handled first. Stacks operate
60. What is the main advantage of using SQL JOIN on the
in LIFO order, graphs and linked lists do not inherently
enforce FIFO. Therefore, a queue is ideal for dispatch or stock and orders tables?
scheduling tasks in time-based order. (A) It manually rewrites data in each table
(B) It eliminates the need for backups
57. How does WPA2 protect the startup’s Wi-Fi transactions? (C) It correlates which items sell fastest without
(A) By assigning static IP addresses duplicating large data sets
(B) By using robust encryption on wireless data (D) It automatically encrypts transaction details
(C) By physically separating devices in locked rooms  Ans
(D) By automatically sorting network packets
(C) It correlates which items sell fastest without
Ans duplicating large data sets
(B) By using robust encryption on wireless data JOIN merges rows logically based on shared keys (e.g.,
WPA2 employs strong encryption (AES-based, for item ID), letting the owners see product performance
instance) to secure transmitted information. It does not without repeating data. It does not rewrite table data
handle IP assignment or physically isolate hardware, or encrypt transactions. Backups remain necessary for
nor does it perform packet sorting. Encryption assures recovery. JOIN simply furnishes insights on demand,
that intercepted wireless data is unreadable without the enabling better stock management.
correct key, securing financial and customer details.
 **************
58. Which sorting algorithm do the developers use to
reorder inventory by ascending price?
(A) Merge Sort
(B) Selection Sort
(C) Bubble Sort
(D) Quick Sort
Ans
(B) Selection Sort
The case study explicitly states that selection sort
is applied to the inventory list to arrange items by
ascending price. Selection sort finds the smallest
element in each pass, placing it into its correct position.
It’s easy to implement, though not the fastest for very
large datasets.

59. Why are weekly backups crucial for this art startup?
(A) They speed up SELECT queries
(B) They ensure data recovery if a system fails or
malware corrupts files
(C) They eliminate the need for Wi-Fi encryption
(D) They update the antivirus software automatically
Ans
(B) They ensure data recovery if a system fails or
malware corrupts files
Regular backups preserve business records, letting
the startup restore them after hardware failures or
cyberattacks. Backups don’t optimize SELECT queries,
handle Wi-Fi encryption, or update antivirus software.

Downloaded from www.mcqgpt.com


page 182 CUET UG Computer Science

PRACTICE PAPER 19

1. Which key uniquely identifies each row in a relational This clause precedes the HAVING clause, which filters
table? group-based results. ORDER BY handles sorting, while
(A) Foreign key SELECT determines which columns or expressions are
(B) Candidate key returned.
(C) Primary key
4. Which of the following is not a valid DML (Data
(D) Alternate key
Manipulation Language) command?
Ans (A) INSERT
(C) Primary key (B) UPDATE
A primary key is a specific candidate key chosen to (C) DELETE
uniquely identify rows in a relation. It ensures no two (D) ALTER
records share the same value for that field, preserving  Ans
data integrity. Other keys may also be unique, but only
one key is designated as primary, forming the table’s (D) ALTER
essential backbone. DML commands manipulate data, such as inserting,
updating, or deleting rows. ALTER is a DDL (Data
2. Which command in MySQL is used to remove an entire Definition Language) command used to change the
table permanently? structure of database objects (e.g., tables). Hence,
(A) DELETE TABLE ALTER is not a DML command. INSERT, UPDATE,
(B) DROP TABLE and DELETE all modify the data within tables.
(C) REMOVE TABLE
5. Which statement best describes the difference between
(D) ERASE TABLE
a LAN and a WAN?
Ans (A) WAN connections are typically faster than LAN.
(B) DROP TABLE (B) LAN covers large geographic areas; WAN covers
The DROP TABLE command completely removes the small areas.
specified table from the database, deleting all its rows, (C) LAN is restricted to a localized area; WAN spans
structure, and associated metadata. This operation wide geographic regions.
is irreversible. In contrast, the DELETE command (D) WAN only uses wireless media; LAN uses wired
removes rows but leaves the table structure intact, only.
and the TRUNCATE command removes all rows but  Ans
preserves the table definition.
(C) LAN is restricted to a localized area; WAN spans
3. Which clause in SQL groups rows with the same values wide geographic regions.
in specified columns into summary rows? A Local Area Network (LAN) operates within a limited
(A) HAVING area, such as a building, while a Wide Area Network
(B) GROUP BY (WAN) covers broader geographic regions, possibly
(C) ORDER BY connecting multiple cities or countries. Speeds vary by
(D) SELECT technology, and both LAN and WAN can use wired or
Ans wireless communication media.

(B) GROUP BY 6. Which device regenerates and amplifies signals but does
GROUP BY is used to aggregate records sharing identical not manage traffic between network segments?
values in specified columns, allowing the application of (A) Switch
aggregate functions such as COUNT, SUM, or AVG. (B) Router

Downloaded from www.mcqgpt.com


PRACTICE PAPER 19

(C) Gateway 9. Match the following network devices (Column A) with


(D) Repeater their primary function (Column B):
Ans Column A Column B
(D) Repeater 1. Router i. Connects different
A repeater boosts or amplifies weak signals to extend a protocols
network’s range but has no intelligence to direct data. 2. Switch ii. Regenerates signals
Switches intelligently forward frames to specific ports, 3. Gateway iii. Forwards data based
routers manage traffic across different networks, and on IP
gateways translate data between protocols. Repeaters
4. Repeater iv. Forwards frames
simply rebroadcast cleaned signals, preserving data
within LAN
integrity over distance.
Options:
7. Arrange these major milestones in networking evolution (A) 1-iii, 2-iv, 3-i, 4-ii
in chronological order: (B) 1-iv, 2-iii, 3-ii, 4-i
1. ARPANET launch (C) 1-ii, 2-i, 3-iv, 4-iii
2. Introduction of TCP/IP (D) 1-i, 2-ii, 3-iii, 4-iv
3. Widespread commercial Internet
 Ans
4. Emergence of Web 2.0
(A) 1 → 2 → 3 → 4 (A) 1-iii, 2-iv, 3-i, 4-ii
(B) 1 → 3 → 2 → 4 Routers direct data using IP addresses, switches forward
(C) 2 → 1 → 3 → 4 Ethernet frames within a LAN, gateways convert data
(D) 2 → 3 → 4 → 1 between distinct protocol domains, and repeaters
simply amplify or regenerate signals. This arrangement
Ans
captures each device’s key function, ensuring networks
(A) 1 → 2 → 3 → 4 can operate cohesively across multiple layers.
ARPANET appeared first (late 1960s), then TCP/IP was
introduced (1970s to early 1980s), enabling standardized 10. Match these SQL commands (Column A) with their
data communication. The Internet’s commercial growth main operation (Column B):
came around the early to mid-1990s, and finally, Web Column A Column B
2.0 developments emerged in the early 2000s, fostering
1. CREATE TABLE i. Change existing data
interactive online platforms and user-generated content.
2. SELECT ii. Remove the table
8. Put the following Python versions in correct release structure
sequence: 3. UPDATE iii. Build a new table
1. Python 1.0 4. DROP TABLE iv. Retrieve data
2. Python 2.0
3. Python 3.0 Options:
4. Python 3.9 (A) 1-iii, 2-iv, 3-i, 4-ii
(A) 1 → 2 → 3 → 4 (B) 1-iv, 2-iii, 3-ii, 4-i
(B) 2 → 1 → 3 → 4 (C) 1-ii, 2-i, 3-iv, 4-iii
(C) 2 → 3 → 1 → 4 (D) 1-i, 2-ii, 3-iii, 4-iv
(D) 3 → 1 → 2 → 4  Ans
Ans (A) 1-iii, 2-iv, 3-i, 4-ii
CREATE TABLE sets up a new table structure, SELECT
(A) 1 → 2 → 3 → 4
retrieves rows, UPDATE modifies existing records, and
Python 1.0 appeared in the mid-1990s, Python 2.0
DROP TABLE deletes the table definition entirely. These
followed in 2000, Python 3.0 arrived in 2008, and later
fundamental commands fall under either DDL or DML
versions like 3.9 emerged in subsequent years (3.9 was
categories and collectively form the foundation of SQL
released in 2020). This order reflects the fundamental
database operations.
evolution of Python through major and minor version
changes.

Downloaded from www.mcqgpt.com


page 184 CUET UG Computer Science

11. Match the Python exception types (Column A) with Column A Column B
their description (Column B):
1. UCASE() i. Convert text to
Column A Column B uppercase
1. ValueError i. Dictionary key not 2. ROUND() ii. Get day of week
found 3. DAYNAME() iii. Round numeric values
2. ZeroDivisionError ii. Invalid type operation 4. COUNT(*) iv. Count all rows
3. KeyError iii. Invalid value Options:
4. TypeError iv. Division by zero (A) 1-i, 2-iii, 3-ii, 4-iv
Options: (B) 1-ii, 2-iv, 3-i, 4-iii
(A) 1-iii, 2-iv, 3-i, 4-ii (C) 1-iv, 2-ii, 3-iii, 4-i
(B) 1-iv, 2-iii, 3-ii, 4-i (D) 1-iii, 2-i, 3-iv, 4-ii
(C) 1-i, 2-ii, 3-iv, 4-iii  Ans
(D) 1-ii, 2-i, 3-iii, 4-iv
(A) 1-i, 2-iii, 3-ii, 4-iv
Ans UCASE() converts letters to uppercase, ROUND()
(A) 1-iii, 2-iv, 3-i, 4-ii adjusts numeric values to a specified number of decimal
ValueError arises when an operation receives an places, DAYNAME() returns weekday names from date
inappropriate value; ZeroDivisionError occurs when values, and COUNT(*) calculates the total number of
dividing by zero; KeyError triggers when accessing a rows. Each function serves a distinct role in managing
nonexistent dictionary key; TypeError is raised when or analyzing data in SQL queries.
an operation is applied to an object of an inappropriate
14. Which combination of statements about stacks is
type. These exceptions help identify logic or data errors.
correct?
12. Match the following queue operations (Column A) with 1. They follow FIFO.
their description (Column B): 2. Topmost element is accessed last.
3. They follow LIFO.
Column A Column B (A) 1 and 2
1. INSERT i. Element positioned at (B) 2 and 3
the last index (C) 1 and 4
2. DELETE ii. Element removed (D) 3 and 4
from first index  Ans
3. FRONT iii. Returns first element
(D) 3 and 4
4. REAR iv. Returns last element A stack employs Last-In, First-Out (LIFO) ordering,
Options: which contradicts FIFO (used by queues). The topmost
(A) 1-i, 2-ii, 3-iii, 4-iv element is indeed the last inserted item, and the pop
(B) 1-iv, 2-i, 3-ii, 4-iii operation removes exactly that last pushed element. So
(C) 1-ii, 2-i, 3-iv, 4-iii statements 3 and 4 correctly describe stack behavior in
(D) 1-iii, 2-iv, 3-i, 4-ii data structures.
Ans
15. Which statements about bubble sort are true?
(A) 1-i, 2-ii, 3-iii, 4-iv 1. Compares adjacent items
In a standard FIFO queue, inserting occurs at the rear 2. Potentially completes in fewer passes if elements
end, removing occurs at the front. The FRONT operation are sorted early
returns the element at the front, while REAR returns the 3. Always requires a single pass
item at the back. This design ensures first-in, first-out 4. Swaps items if out of order
behavior for orderly processing of data elements. (A) 1, 2, and 4
(B) 1, 3, and 4
13. Match the following MySQL functions (Column A) (C) 2, 3, and 4
with their purpose (Column B): (D) 1, 2, and 3

Downloaded from www.mcqgpt.com


PRACTICE PAPER 19

Ans 3. ‘t’ indicates text mode


(A) 1, 2, and 4 4. open() returns a file object
Bubble sort compares adjacent elements and swaps 5. Using with open() automatically closes files
them if needed, moving larger values toward the end (A) 1, 2, 3, 4, and 5
each pass. It can finish early if no swaps occur in a pass, (B) 1, 2, and 4 only
but generally may need multiple passes. Statement 3 is (C) 3, 4, and 5 only
incorrect because it often needs several passes, not one. (D) 1, 3, and 5 only
 Ans
16. Select all true statements about binary search:
1. Operates only on sorted data (A) 1, 2, 3, 4, and 5
2. Splits the search space in half repeatedly Python file modes include read (r), write (w), append
3. Guaranteed O(1) complexity (a), plus optional ‘b’ for binary files and ‘t’ for text
4. Achieves O(log n) complexity mode. The open() function returns a file object. Using
(A) 1, 2, and 4 a with open() context statement ensures the file closes
(B) 1, 3, and 4 automatically, preventing resource leaks or data loss.
(C) 2, 3, and 4
19. Assertion (A) : A primary key in a table can never have
(D) 1 and 2
a NULL value.
Ans Reason (R) : Primary keys must always uniquely identify
(A) 1, 2, and 4 a record in any situation.
Binary search requires a sorted list, then repeatedly (A) Both (A) and (R) are true, and (R) is the correct
divides the search interval in half, discarding the explanation of (A)
irrelevant segment each time. This approach yields a (B) Both (A) and (R) are true, but (R) is not the correct
time complexity of O(log n). It is not O(1), so statement explanation
3 is false. Other statements accurately describe binary (C) (A) is true, (R) is false
search. (D) (A) is false, (R) is true
 Ans
17. Which statements about exceptions in Python are
correct? (A) Both (A) and (R) are true, and (R) is the correct
1. They arise only from syntax errors explanation of (A)
2. They can be user-defined A primary key must uniquely identify each row in a
3. They can be handled using try-except table, requiring non-null values. Allowing NULL would
4. They stop execution if unhandled break uniqueness guarantees. Therefore, a primary
(A) 1, 2, and 3 key column’s requirement to be unique is precisely the
(B) 2, 3, and 4 reason it cannot contain NULL entries, fulfilling the role
(C) 1, 3, and 4 of absolute identification.
(D) 1 and 4 only
20. Assertion (A) : Merging two sorted lists can be done in
Ans O(n) time, where n is the total number of elements.
(B) 2, 3, and 4 Reason (R) : Merging only requires linearly scanning
Exceptions aren’t limited to syntax errors; they can be both lists once.
user-defined or built-in. Programmers handle them (A) Both (A) and (R) are true, and (R) correctly explains
using try-except blocks to maintain control flow. If (A)
an exception remains unhandled, it halts program (B) Both (A) and (R) are true, but (R) does not explain
execution. Syntax errors occur before execution, (A)
whereas runtime exceptions occur during execution (C) (A) is true, (R) is false
under various conditions. (D) (A) is false, (R) is true
 Ans
18. Which statements about file handling in Python are
true? (A) Both (A) and (R) are true, and (R) correctly explains
1. Files have modes like ‘r’, ‘w’, ‘a’ (A)
2. ‘b’ indicates binary mode

Downloaded from www.mcqgpt.com


page 186 CUET UG Computer Science

When merging two sorted lists, each element is 24. Which Python statement ensures a block of code always
compared once to decide which sublist to pull from executes, whether or not an exception is raised?
next. This single pass through both lists yields O(n) total (A) except
time, where n is the sum of their lengths. This logical (B) finally
approach guarantees efficient linear merge performance. (C) raise
(D) else
21. Which function in MySQL returns the month number
from a date?  Ans
(A) MONTH() (B) finally
(B) MONTHNAME() The finally clause in Python’s try-except-finally construct
(C) DATE() always executes, regardless of whether an exception
(D) DAY() occurred. This is useful for performing cleanup tasks
Ans like closing files or releasing resources. The except clause
handles exceptions, else runs if no exceptions occur, and
(A) MONTH() raise explicitly triggers an exception.
The MONTH() function extracts the month component
(as a numeric value) from a valid date or datetime 25. Which of the following is not an advantage of using
expression. In contrast, MONTHNAME() provides MySQL?
the month’s name, DATE() returns a date portion from (A) Open-source availability
a datetime, and DAY() retrieves the day of the month. (B) Limited cross-platform support
MONTH() supplies the integer month value. (C) Scalability
(D) Large community support
22. What is an alternate key in a relational database?
(A) Key referencing a different table  Ans
(B) Candidate key not chosen as primary (B) Limited cross-platform support
(C) Non-unique key for indexing MySQL is open-source, highly scalable, and benefits
(D) Key used for partial matching from robust community backing. It supports multiple
Ans platforms, including Windows, Linux, and macOS,
so limited cross-platform support is incorrect. Its
(B) Candidate key not chosen as primary popularity stems from flexibility across environments,
A table may have multiple candidate keys (all capable plus strong performance and cost-effectiveness for
of uniquely identifying rows). Only one candidate key projects of many sizes.
becomes the primary key, while others are designated
alternate keys. These alternate keys remain unique 26. Which statement contrasts sequential search with
identifiers but are not the official primary. They serve binary search?
redundancy and can later become primary if needed. (A) Sequential search needs a sorted list, while binary
search doesn’t
23. Which network topology connects all devices in a (B) Binary search inspects all elements; sequential
closed loop? search can skip some
(A) Bus (C) Sequential search checks each element linearly,
(B) Ring while binary search halves the search space
(C) Star (D) Both require sorted data
(D) Tree
 Ans
Ans
(C) Sequential search checks each element linearly,
(B) Ring while binary search halves the search space
In a ring topology, each device connects to exactly two Sequential (linear) search scans each element one by
others, forming a continuous ring. Data typically travels one, which is O(n). Binary search needs sorted data
around this loop in one or both directions. Bus topology and repeatedly divides the list into halves, achieving
uses a single backbone cable, star has a central node, and O(log n). Binary search cannot skip presorting, whereas
tree combines multiple star structures hierarchically. sequential search works on any data order but is slower
with large lists.

Downloaded from www.mcqgpt.com


PRACTICE PAPER 19

27. Which sorting method is best suited for nearly sorted (C) Tree
data? (D) Graph
(A) Selection sort  Ans
(B) Insertion sort
(C) Bubble sort (B) Queue
(D) Merge sort A queue is a linear data structure implementing FIFO
behavior: elements are inserted at one end (rear) and
Ans removed from the other end (front). Stacks use LIFO,
(B) Insertion sort trees represent hierarchical structures, and graphs
Insertion sort performs extremely well on lists that are consist of nodes and edges representing relationships
already or mostly sorted because it effectively places without a strict linear insertion/removal order.
each element in its correct position with minimal
31. Which measure best represents the spread or variability
comparisons. In such scenarios, its complexity
approaches O(n). Other methods often require more in a dataset?
comparisons or merges, yielding less efficiency for (A) Mean
nearly sorted arrays. (B) Standard deviation
(C) Median
28. Which MySQL function calculates the total of a numeric (D) Sum
column?  Ans
(A) SUM()
(B) MIN() (B) Standard deviation
(C) AVG() Standard deviation quantifies how spread out the
(D) COUNT() numbers are from the mean, indicating overall
variability in the dataset. The mean is a central tendency
Ans measure, and the median splits the data in half. The sum
(A) SUM() has no direct indication of variability. Hence, standard
SUM() adds all the values of a chosen numeric column deviation reveals dispersion effectively.
to return their total. MIN() finds the smallest value,
32. Which of the following is not an SQL aggregate function?
AVG() computes the average, and COUNT() determines
the number of rows. These aggregate functions allow (A) MAX()
quick data analysis within database queries for numeric (B) MIN()
columns. (C) MOD()
(D) AVG()
29. Which of these is not a valid data communication  Ans
medium?
(A) Twisted pair cable (C) MOD()
(B) Coaxial cable MAX(), MIN(), and AVG() are MySQL aggregate
(C) Optical fiber functions used in group operations. MOD() is a
(D) Typewriter ribbon mathematical function that returns the remainder of
division, but it’s not an aggregate function that performs
Ans computations over groups of rows. Hence, MOD()
(D) Typewriter ribbon stands apart in typical SQL usage classification.
Twisted pair cables, coaxial cables, and optical fibers
33. Why is a firewall crucial for network security?
are standard wired transmission media. Typewriter
ribbons have no role in data networking; they are used (A) It permanently disables malware
in mechanical typing. Data communication involves (B) It restricts or allows data packets based on rules
transporting digital or analog signals between devices (C) It encrypts all data across networks
using suitable wired or wireless media. (D) It physically shields servers
 Ans
30. Which data structure follows a First-In, First-Out
(FIFO) principle? (B) It restricts or allows data packets based on rules
(A) Stack A firewall enforces a security policy by filtering inbound
(B) Queue and outbound traffic based on predefined rules. It does

Downloaded from www.mcqgpt.com


page 188 CUET UG Computer Science

not guarantee malware removal or global encryption. The File Transfer Protocol (FTP) allows file upload and
Instead, it inspects data packets against permitted download between a client and a remote server. HTTP
or forbidden criteria, protecting systems from handles web page requests, SMTP handles sending
unauthorized access or malicious data intrusions. email, and POP3 or IMAP handle receiving email. FTP
is specifically designed to move files across a network
34. Which feature distinguishes a modem from a router? with user authentication.
(A) A router modulates and demodulates signals, while
a modem forwards packets 37. Assertion (A) : In insertion sort, the outer loop tracks
(B) A modem connects digital signals to telephone how many elements have been sorted.
analog lines, while a router directs data Reason (R) : Each pass extends the sorted portion by
(C) A router cannot create IP addresses, while a modem inserting one element at its correct position.
can (A) Both (A) and (R) are true, and (R) is the correct
(D) They perform identical networking functions explanation
Ans (B) Both (A) and (R) are true, but (R) is not the correct
explanation
(B) A modem connects digital signals to telephone (C) (A) is true, (R) is false
analog lines, while a router directs data (D) (A) is false, (R) is true
A modem modulates digital signals into analog
waveforms and vice versa for transmission over  Ans
telephone lines. A router, on the other hand, analyzes (A) Both (A) and (R) are true, and (R) is the correct
network addresses to route packets across networks. explanation
Though some devices combine both functions, they In insertion sort, we gradually expand the sorted part of
remain fundamentally distinct components in data the array by moving the current element into its rightful
communication. position among previously sorted elements. The outer
loop’s iteration count indicates how many elements have
35. Which statement correctly defines a Trojan horse in been placed, while each pass repositions exactly one
cybersecurity? element.
(A) Self-replicating malware that spreads across
networks 38. Which is not a function of the data link layer?
(B) Malicious software disguised as legitimate, granting (A) Framing
unauthorized access (B) Error detection
(C) Software that automatically displays unwanted ads (C) Physical addressing
(D) Security measure that monitors user keystrokes (D) Routing packets between networks
Ans  Ans
(B) Malicious software disguised as legitimate, granting (D) Routing packets between networks
unauthorized access The data link layer is responsible for framing data, error
A Trojan horse conceals its true purpose behind what detection, and using physical (MAC) addresses for local
appears to be a benign application, tricking users into delivery. Routing across network boundaries is the
installation. Once active, it can create backdoors or steal responsibility of the network layer (Layer 3). Hence, data
data. Unlike worms, it does not self-replicate. Adware link does not route packets between different networks.
displays ads, and keystroke monitoring is spyware
39. Which relational algebra operation returns rows from a
rather than a Trojan’s defining feature.
relation that satisfy a given condition?
36. Which protocol is primarily used for transferring files (A) Projection
between a client and a server on a network? (B) Selection
(A) HTTP (C) Union
(B) FTP (D) Cartesian product
(C) SMTP  Ans
(D) POP3
(B) Selection
Ans Selection (σ) in relational algebra filters rows that meet
(B) FTP a specified predicate. Projection (π) chooses specific

Downloaded from www.mcqgpt.com


PRACTICE PAPER 19

columns, union combines rows from two relations, approach lets teachers generate performance summaries
and Cartesian product (×) multiplies each row of one per class efficiently. ORDER BY only sorts data, while
relation by each row of another. Thus, selection isolates DROP TABLE removes structures and triggers automate
rows matching stated conditions. specific tasks.

40. Which hashing technique involves applying an 42. Which table likely holds the marks for Mathematics,
additional step if two keys map to the same index? Computer Science, and English?
(A) Linear probing (A) Students
(B) One-way hashing (B) Scores
(C) Binary chaining (C) Classes
(D) Key compression (D) Configurations
Ans  Ans
(A) Linear probing (B) Scores
Linear probing is a collision resolution strategy in The Scores table tracks exam or test scores in different
hashing. When a collision happens at a particular subjects. The Students table stores personal information,
index, the algorithm checks subsequent positions while Classes might store class identifiers or related
linearly until it finds an empty slot. One-way hashing attributes. A separate configuration table would
refers to cryptographic hashing. Binary chaining and generally store system settings. Hence, the subject
key compression are not standard hashing collision marks logically reside under Scores.
approaches.
43. Which Python feature is used to handle unexpected
Direction :Carefully read the case study provided and then runtime errors during data import?
thoroughly answer the subsequent five questions. (A) Modules
A school’s computer lab implements a database to store (B) finally block
student details and test results. The database consists (C) Exception handling (try-except)
of multiple related tables, including Students, Classes, (D) pass statement
and Scores. Each table has a primary key column. The  Ans
Scores table captures marks in subjects like Mathematics,
Computer Science, and English. MySQL’s GROUP BY and (C) Exception handling (try-except)
aggregate functions help generate overall performance try-except blocks catch runtime exceptions, preventing
summaries for each class. Teachers occasionally run program crashes and allowing developers to handle
queries to identify top performers or detect failing errors gracefully or retry operations. Python modules
students. They also use Python scripts to automate data organize code, the finally block always executes after
entry, employing exception handling to avoid disruptions try-except, and the pass statement is a no-operation
during large-scale data imports. The lab’s network setup placeholder. Comprehensive exception handling
relies on a star topology with a central switch. Multiple ensures stability during large-scale data imports.
computers share resources, and the system’s firewall helps 44. Which network topology is described in the lab setup?
secure data from external threats. (A) Ring
41. Which MySQL feature helps teachers compile (B) Bus
performance summaries by class? (C) Star
(A) INSERT triggers (D) Mesh
(B) GROUP BY clause  Ans
(C) ORDER BY clause (C) Star
(D) DROP TABLE command The case study explicitly states the lab uses a star
Ans topology, where all computers connect to a central
(B) GROUP BY clause switch. In contrast, ring topology places devices in a
GROUP BY classifies rows with the same class identifier loop, bus uses a common backbone cable, and mesh
into aggregated results, enabling calculation of average involves multiple interconnected paths. Star remains a
scores, sums, or other metrics for each group. This popular choice for institutional networks.

Downloaded from www.mcqgpt.com


page 190 CUET UG Computer Science

45. Which security measure protects the lab’s system from 47. Which Python concept safeguards the script against file
external threats? reading errors?
(A) Router password (A) Global variables
(B) Gateway protocol (B) try-except blocks
(C) Firewall (C) print statements
(D) Star node (D) pass keyword
Ans  Ans
(C) Firewall (B) try-except blocks
The text identifies a firewall as providing security against When reading CSV or other file data, wrapping file
unauthorized access or malicious traffic. Password- operations in try-except ensures the program can handle
protected routers help, but firewalls specifically filter missing files, read errors, or corrupted data gracefully
data packets, blocking suspicious requests. Gateways without crashing. Global variables and print statements
and star nodes are network components, but they do not do not protect against errors. The pass keyword simply
inherently offer robust filtering. Firewalls are designed does nothing if reached.
for threat management.
48. Which sorting technique is specifically mentioned for
Direction :Carefully read the case study provided and then arranging tasks by priority?
thoroughly answer the subsequent five questions. (A) Bubble sort
An IT firm maintains a shared database to track project (B) Insertion sort
tasks, deadlines, and employee assignments. The Tasks (C) Merge sort
table stores each task’s details, including its due date, (D) Quick sort
priority, and the assigned employee’s ID. Employees  Ans
connect to the database over a secured LAN using a
switch. Management uses various SQL queries to identify (B) Insertion sort
overdue tasks, including SELECT, WHERE, and even The case states that a Python automation script uses
HAVING to filter grouped data. A Python automation insertion sort to order tasks by priority. Insertion sort
script processes status updates daily, handling possible file is effective for smaller or partially sorted data sets,
exceptions when importing CSV task data. The script uses inserting each new element into its correct position
insertion sort for a custom ordering of tasks by priority. and gradually expanding the sorted portion. Other
Additionally, the LAN includes a firewall to monitor algorithms are not referenced in the scenario.
incoming traffic. The system’s success relies on well- 49. Which network device in the LAN setup helps connect
designed data structures, secure networking, and robust all employee machines?
exception handling to avoid system crashes. (A) Switch
46. Which SQL command might management use to filter (B) Router
tasks due before today’s date? (C) Gateway
(A) SELECT * FROM Tasks ORDER BY due_date (D) Modem
(B) SELECT * FROM Tasks WHERE due_date <  Ans
CURDATE() (A) Switch
(C) DROP TABLE Tasks The passage mentions a switch as the central device
(D) COUNT(*) FROM Tasks used to interconnect local machines. A router routes
Ans data between different networks, a gateway translates
(B) SELECT * FROM Tasks WHERE due_date < between protocols, and a modem modulates-
CURDATE() demodulates signals over phone lines. In typical LANs,
This query filters rows in the Tasks table to return only switches handle local traffic within a single network
those tasks with a due_date earlier than the current segment.
date, indicating they are overdue. ORDER BY sorts but 50. Which measure mentioned helps protect the LAN from
doesn’t filter, DROP TABLE deletes the entire table, malicious inbound connections?
and COUNT(*) provides numeric counts rather than (A) Disabling TCP/IP
filtered tasks. (B) Using a firewall

Downloaded from www.mcqgpt.com


PRACTICE PAPER 19

(C) Installing a second switch


(D) Adding more tasks
Ans
(B) Using a firewall
As stated, the LAN includes a firewall that inspects
incoming traffic to block unauthorized or malicious
data. Disabling TCP/IP would break normal network
communication. Adding switches or tasks does not
enhance external security. A firewall remains the
standard defense mechanism for monitoring and
filtering inbound traffic.

 **************

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


page 192 CUET UG Computer Science

PRACTICE PAPER 20

1. What is a foreign key in relational databases? the CARTESIAN PRODUCT pairs every row of one
(A) A column that references a primary key in another relation with every row of another. Hence, union is the
table correct operator for combining tuples with duplicate
(B) A field storing numeric values only elimination.
(C) A backup column for daily logs
4. Which is not a valid MySQL data type?
(D) A special key that allows NULL values
(A) INT
Ans (B) VARCHAR
(A) A column that references a primary key in another (C) DATE
table (D) WORD
A foreign key is a column (or set of columns) that  Ans
establishes a link to a primary key in a different table,
enforcing referential integrity. This relationship ensures (D) WORD
valid cross-references between tables. It can contain MySQL supports numerous data types including INT
matching values or NULL if the relationship permits for integers, VARCHAR for variable-length text, DATE
optional references. for date values, etc. There is no standard data type called
WORD in MySQL. That’s not a recognized type. Custom
2. Which SQL clause restricts rows returned by a query data types or synonyms are possible, but WORD does
based on a specified condition? not exist by default.
(A) FROM
5. Which statement differentiates the bus and star
(B) WHERE
(C) ORDER BY topologies?
(D) HAVING (A) Bus uses a central hub; star uses a single backbone
cable
Ans (B) Star features a central hub or switch; bus uses a
(B) WHERE single trunk line
WHERE filters rows during SELECT, UPDATE, or (C) Bus requires multiple routers; star never uses them
DELETE queries. It applies conditions row by row to (D) Both topologies require ring connections
exclude non-matching results. FROM designates the  Ans
table source, ORDER BY arranges the returned data,
and HAVING filters groups formed by GROUP BY. (B) Star features a central hub or switch; bus uses a
Thus, WHERE is fundamental for row-level filtering. single trunk line
In a bus topology, all devices share one main
3. Which operation in relational algebra combines tuples communication line (the bus). In a star topology,
from two relations and removes duplicates? every node connects to a central hub or switch. This
(A) UNION arrangement clarifies the fundamental difference: bus
(B) INTERSECTION relies on a single cable, while star relies on a central
(C) PROJECTION node for data distribution.
(D) CARTESIAN PRODUCT
6. Which approach is most suitable for preventing repeated
Ans code blocks when handling exceptions in Python?
(A) UNION (A) Duplicating try-except in every function
UNION merges tuples from both relations, automatically (B) Using nested try statements
removing duplicates. INTERSECTION returns tuples (C) Defining reusable error-handling functions or
common to both, PROJECTION chooses columns, and context managers

Downloaded from www.mcqgpt.com


PRACTICE PAPER 20

(D) Avoiding exception handling altogether Column A Column B


Ans 1. open() i. Terminate file
(C) Defining reusable error-handling functions or connection
context managers 2. close() ii. Retrieve file content
Centralizing exception handling logic in helper 3. read() iii. Send data into file
functions or context managers (using with statements) 4. write() iv. Initiate file access
promotes code reuse and maintainability. This approach
keeps the code DRY (don’t repeat yourself). Duplicating Options:
try-except blocks leads to redundancy, nesting can (A) 1-iv, 2-i, 3-ii, 4-iii
be confusing, and skipping exception handling risks (B) 1-i, 2-iv, 3-iii, 4-ii
crashes. (C) 1-iii, 2-iv, 3-i, 4-ii
(D) 1-ii, 2-iii, 3-iv, 4-i
7. Arrange these stages of the software development  Ans
lifecycle in chronological order:
1. Testing (A) 1-iv, 2-i, 3-ii, 4-iii
2. Analysis open() starts the file connection, close() ends it, read()
3. Design extracts content, and write() sends data to the file. This
4. Maintenance ensures a structured cycle of file access. Failing to close
(A) 2 → 3 → 1 → 4 files can cause resource leaks or data inconsistencies, so
(B) 3 → 1 → 2 → 4 it’s crucial to terminate file sessions properly.
(C) 4 → 1 → 3 → 2 10. Match the following stack operations (Column A) with
(D) 1 → 4 → 2 → 3 their purpose (Column B):
Ans
Column A Column B
(A) 2 → 3 → 1 → 4 1. PUSH i. Check if stack has no
Commonly, the software lifecycle proceeds with elements
requirements analysis, then design, followed by
2. POP ii. Return the top element
development and testing, and finally, deployment and
without removal
maintenance. Though actual methodologies can vary,
the general flow remains: analyze needs, plan solutions, 3. TOP iii. Insert a new element
verify correctness, and maintain or enhance the system at top
through its operational lifetime. 4. isEmpty iv. Remove the top
element
8. Put these Python file modes in the order they are
Options:
typically introduced to beginners:
(A) 1-iii, 2-iv, 3-ii, 4-i
(A) 1 → 2 → 3 → 4
(B) 1-iv, 2-iii, 3-i, 4-ii
(B) 2 → 1 → 4 → 3
(C) 1-ii, 2-iii, 3-iv, 4-i
(C) 3 → 1 → 2 → 4
(D) 1-i, 2-ii, 3-iii, 4-iv
(D) 4 → 3 → 2 → 1
 Ans
Ans
(A) 1-iii, 2-iv, 3-ii, 4-i
(A) 1 → 2 → 3 → 4
PUSH places a new element on the top, POP removes
Beginners generally learn reading mode (‘r’) first, then
the top element, TOP (or peek) returns the top element
writing mode (‘w’), followed by append mode (‘a’), and
without popping it, and isEmpty checks whether the
finally combined reading-writing mode (‘r+’). This
stack is empty. These operations encapsulate core stack
progression aligns with typical introductory lessons
functionality, ensuring LIFO ordering of elements.
on file operations in Python, gradually showing more
advanced features after basic modes. 11. Match these MySQL clauses (Column A) with their
purpose (Column B):
9. Match these Python file functions (Column A) with
their usage (Column B): Column A Column B

Downloaded from www.mcqgpt.com


page 194 CUET UG Computer Science

1. HAVING i. Sorts query results 1. IndexError i. Attempting to use a


2. ORDER BY ii. Filters groups nonexistent object
3. FROM iii. Defines source table property
4. SELECT iv. Chooses columns 2. IOError ii. Accessing an out-of-
range list index
Options:
3. AttributeError iii. Performing a division
(A) 1-ii, 2-i, 3-iii, 4-iv
by zero
(B) 1-i, 2-ii, 3-iv, 4-iii
(C) 1-iv, 2-iii, 3-i, 4-ii 4. ZeroDivisionError iv. Failing to read or write
(D) 1-iii, 2-iv, 3-i, 4-ii a file

Ans Options:
(A) 1-ii, 2-iv, 3-i, 4-iii
(A) 1-ii, 2-i, 3-iii, 4-iv (B) 1-iv, 2-i, 3-ii, 4-iii
HAVING filters grouped rows, ORDER BY sorts the (C) 1-i, 2-ii, 3-iv, 4-iii
result, FROM specifies the table(s) being queried, and (D) 1-iii, 2-i, 3-iv, 4-ii
SELECT designates the columns or expressions returned.
These clauses typically follow the sequence SELECT →  Ans
FROM → WHERE → GROUP BY → HAVING → (A) 1-ii, 2-iv, 3-i, 4-iii
ORDER BY in more complex SQL statements. IndexError arises from using an invalid index for
sequences, IOError (or OSError in newer versions)
12. Match the following forms of network (Column A) with involves file read/write failure, AttributeError occurs
their description (Column B): when referencing a missing attribute or property,
Column A Column B and ZeroDivisionError arises from dividing by
1. LAN i. Covers large zero. Matching them clarifies Python’s built-in error
geographic regions categories.
2. MAN ii. Connects devices 14. Which statements about the stack data structure are
within a city true?
3. WAN iii. Connects devices in a 1. LIFO principle
small personal area 2. pop() removes the bottom element
4. PAN iv. Covers a local building 3. push() inserts at top
or campus 4. They are used in function call management
(A) 1, 2, and 3
Options:
(B) 1, 3, and 4
(A) 1-iv, 2-ii, 3-i, 4-iii
(C) 2, 3, and 4
(B) 1-ii, 2-iv, 3-i, 4-iii
(D) 1 and 4 only
(C) 1-iii, 2-i, 3-ii, 4-iv
(D) 1-i, 2-ii, 3-iv, 4-iii  Ans
Ans (B) 1, 3, and 4
Stacks operate under Last-In, First-Out. The push()
(A) 1-iv, 2-ii, 3-i, 4-iii
operation adds elements to the top, and pop() removes
A Local Area Network (LAN) typically serves a small
from the top, not the bottom. Stacks are extensively used
region like a building or campus. A Metropolitan Area
for function call management, tracking return addresses
Network (MAN) spans a city. A Wide Area Network
and local variables. Hence, statements 1, 3, and 4 are
(WAN) covers huge geographical expanses, sometimes
valid descriptors.
global. A Personal Area Network (PAN) extends around
an individual’s workspace or devices. 15. Which statements about selection sort are true?
1. Finds minimum element each pass
13. Match the following Python exceptions (Column A)
2. Always O(n^2) in best and worst cases
with their cause (Column B):
3. Requires additional significant memory
Column A Column B 4. Swaps at most once per pass
(A) 1, 2, and 4

Downloaded from www.mcqgpt.com


PRACTICE PAPER 20

(B) 1, 2, and 3 18. Which statements about Python exception handling are
(C) 1, 3, and 4 valid?
(D) 2, 3, and 4 1. raise triggers an exception
Ans 2. except catches exceptions
3. else executes if no exception occurs in try
(A) 1, 2, and 4 4. finally executes always
Selection sort locates the smallest element each iteration 5. pass automatically retries the exception block
and places it at the front, leading to O(n^2) time in both (A) 1, 2, 3, and 4
best and worst scenarios. It only needs constant extra (B) 1, 2, 4, and 5
memory (besides the input array). Typically, it swaps (C) 2, 3, 4, and 5
one pair of elements per pass after finding the minimum. (D) 1, 2, 3, 4, and 5
16. Which statements about queue data structures are  Ans
accurate? (A) 1, 2, 3, and 4
1. Follows LIFO raise explicitly creates an exception, except handles it,
2. enqueue() adds at rear else runs only if no exception arises, and finally always
3. dequeue() removes from front executes whether or not an exception is raised. pass does
4. Used for breadth-first search not retry anything; it’s a no-operation statement. Hence,
(A) 1, 2, and 3 statement 5 is incorrect, and the others are correct.
(B) 2, 3, and 4
(C) 1, 3, and 4 19. Assertion (A) : Bubble sort may perform fewer passes if
(D) 1 and 4 only the data becomes sorted early.
Ans Reason (R) : Bubble sort can detect no swaps in a pass
and terminate.
(B) 2, 3, and 4 (A) Both (A) and (R) are true, and (R) is the correct
A queue follows FIFO (not LIFO). Elements are inserted explanation
(enqueue) at the rear and removed (dequeue) from the (B) Both (A) and (R) are true, but (R) is not the correct
front. Queues are vital in breadth-first search to process explanation
nodes level by level. So 2, 3, and 4 correctly define queue (C) (A) is true, (R) is false
operations and uses. (D) (A) is false, (R) is true
17. Which statements about MySQL aggregate functions  Ans
are correct? (A) Both (A) and (R) are true, and (R) is the correct
1. COUNT() returns row counts explanation
2. AVG() calculates average values Optimized bubble sort checks if any swap happened
3. MIN() and MAX() find smallest and largest values during a pass. If no elements swap, the array is already
4. They ignore NULL fields by default sorted, and it stops early, reducing the passes required.
(A) 1 and 2 only Consequently, (A) and (R) are both correct, with (R)
(B) 1, 2, 3, and 4 properly explaining why bubble sort can terminate
(C) 2 and 3 only sooner.
(D) 1, 2, and 3 only
20. Assertion (A) : In MySQL, the DELETE command
Ans
clears table data but keeps its structure.
(B) 1, 2, 3, and 4 Reason (R) : DROP TABLE removes both data and table
COUNT(), AVG(), MIN(), and MAX() are standard definition.
MySQL aggregates. By default, these functions exclude (A) Both (A) and (R) are true, and (R) is the correct
NULL fields, unless specifically instructed. COUNT() explanation
determines how many rows match, AVG() calculates (B) Both (A) and (R) are true, but (R) is not the correct
mean, MIN() and MAX() yield boundary values. All explanation
four statements accurately reflect aggregate function (C) (A) is true, (R) is false
behavior. (D) (A) is false, (R) is true
 Ans

Downloaded from www.mcqgpt.com


page 196 CUET UG Computer Science

(A) Both (A) and (R) are true, and (R) is the correct translate between protocols, and a modem modulates/
explanation demodulates signals over telephone or cable lines.
The DELETE command removes all or specific rows
24. In Python, which method reads the entire file content
while preserving the table schema. DROP TABLE wipes
out the data and the table structure itself. Thus, the into a string?
reason clearly supports the assertion: one removes data (A) read()
only, and the other removes data plus definition. (B) readline()
(C) readlines()
21. Which command in MySQL is used to change an (D) input()
existing table’s structure, for example, adding a new  Ans
column?
(A) SELECT (A) read()
(B) UPDATE The read() method fetches all the file contents as a single
(C) ALTER TABLE string if there’s enough memory. readline() reads just
(D) TRUNCATE one line at a time, and readlines() returns a list of lines.
The built-in input() function reads user input from the
Ans console, not from a file.
(C) ALTER TABLE
25. Which of the following is not typically a reason for a
ALTER TABLE modifies the table schema, such as
adding or removing columns or changing data types. Python ZeroDivisionError?
SELECT retrieves data, UPDATE modifies existing (A) Attempting 5/0 in integer division
rows, and TRUNCATE deletes all rows but retains the (B) Summation of zero with zero
table structure. Therefore, altering structure specifically (C) Dividing a float by zero
requires the ALTER TABLE command. (D) Using the modulo operator with zero
 Ans
22. What are candidate keys in a relational table?
(A) Primary keys used only for indexing (B) Summation of zero with zero
(B) Keys that can become a primary key if chosen Adding zero and zero is a valid operation yielding zero
(C) Foreign keys referencing external tables and does not trigger an exception. Division by zero
(D) Non-essential keys ignored by queries in Python, whether integer, float, or modulus, raises
ZeroDivisionError. Summation with zero remains
Ans legitimate and safe, generating no error.
(B) Keys that can become a primary key if chosen
26. Which statement contrasts DROP TABLE with
Candidate keys can uniquely identify each row in a table,
making any one eligible to serve as primary. A table may TRUNCATE TABLE?
have multiple candidate keys, but only one is designated (A) Both remove the table structure
as the primary key. Foreign keys reference other tables, (B) TRUNCATE removes structure; DROP removes
and indexing is a separate optimization concern. data only
(C) TRUNCATE quickly deletes all rows but retains
23. Which network device interconnects multiple LAN structure, while DROP removes the entire table
segments but cannot translate between different (D) DROP resets auto-increment counters;
protocols? TRUNCATE does not
(A) Router  Ans
(B) Switch
(C) Gateway (C) TRUNCATE quickly deletes all rows but retains
(D) Modem structure, while DROP removes the entire table
TRUNCATE is a DDL command that empties a table
Ans while retaining its schema, often faster than DELETE.
(B) Switch DROP TABLE removes both table data and structure.
A switch forwards data frames within the same By design, TRUNCATE resets auto-increment counters
protocol and network type, typically Ethernet, across too, while DROP eliminates them entirely. Hence, that
multiple LAN segments. A router routes packets across is the core difference.
different networks (e.g., LAN to WAN). A gateway can

Downloaded from www.mcqgpt.com


PRACTICE PAPER 20

27. Which structure is most efficient for checking if an item (C) Mode
exists in a collection of unique values? (D) Range
(A) List  Ans
(B) Stack
(C) Set (B) Median
(D) Queue The median is the middle value in a sorted dataset,
effectively dividing the distribution into two equal
Ans parts. Mean is an arithmetic average, mode is the most
(C) Set frequent value, and range is the difference between the
A Python set provides O(1) average-time membership highest and lowest values. Thus, median separates the
checks, making it highly efficient for verifying existence upper and lower halves.
in a collection. Lists or queues require O(n) membership
31. Which is the main advantage of using prepared
checks, and stacks operate similarly. A set uses a hash-
based implementation, speeding up lookups for unique statements in SQL?
elements. (A) They cannot be executed multiple times
(B) They reduce security
28. Which function in MySQL gives the current date as (C) They improve performance and prevent SQL
YYYY-MM-DD? injection
(A) DATE() (D) They disable transaction control
(B) CURDATE()  Ans
(C) CURRENT_YEAR()
(D) NOW() (C) They improve performance and prevent SQL
injection
Ans Prepared statements parse and optimize a query plan
(B) CURDATE() once, then reuse it multiple times, improving efficiency.
CURDATE() returns the current date in YYYY-MM- They separate query structure from user inputs, reducing
DD format. DATE() is typically used to extract the date the likelihood of malicious input altering queries. This
part from a datetime expression, CURRENT_YEAR() is separation helps prevent SQL injection attacks, thus
invalid, and NOW() returns the current date and time enhancing both security and performance.
in a datetime format. CURDATE() specifically supplies
32. Which function is not an aggregate function in MySQL?
today’s date.
(A) SUM()
29. Which type of cable is known for high bandwidth and (B) REPLACE()
minimal signal loss? (C) COUNT()
(A) Twisted pair (D) AVG()
(B) Coaxial cable  Ans
(C) Optical fiber
(D) Ethernet (Cat5) (B) REPLACE()
SUM(), COUNT(), and AVG() perform aggregation
Ans over a set of rows. REPLACE() is generally a string
(C) Optical fiber function that substitutes occurrences of a substring.
Optical fiber uses light signals through thin glass or It does not produce group-level summaries. Hence,
plastic strands, providing extremely high bandwidth REPLACE() is not an aggregate function, while the
and minimal signal degradation over long distances. others operate on numeric or row sets.
Twisted pair (including typical Ethernet cables) and
33. Which statement correctly describes how BFS (Breadth-
coaxial cable have lower capacity in comparison. Optical
fiber dominates high-speed backbone communication First Search) uses a queue?
links. (A) BFS uses multiple stacks for parallel paths
(B) BFS enqueues visited nodes and processes them in
30. Which measure of central tendency splits the data so LIFO order
half of the values lie above and half below? (C) BFS enqueues starting nodes and processes them in
(A) Mean FIFO order
(B) Median (D) BFS uses recursion exclusively

Downloaded from www.mcqgpt.com


page 198 CUET UG Computer Science

Ans SMTP (Simple Mail Transfer Protocol) sends emails,


(C) BFS enqueues starting nodes and processes them in POP3 (Post Office Protocol) and IMAP (Internet
FIFO order Message Access Protocol) retrieve emails. HTTP
Breadth-First Search adds adjacent nodes to a queue, (Hypertext Transfer Protocol) is used for transferring
ensuring the earliest discovered nodes are processed web pages over the internet. Although webmail
first. This approach visits nodes level by level. Stacks and interfaces rely on HTTP in a browser, HTTP itself is not
recursion are typically used in DFS. Hence BFS naturally classified as an email protocol.
employs queue-based FIFO logic to handle graph or tree
37. Assertion (A) : In bubble sort, larger elements bubble to
layers systematically.
the end of the list first.
34. Which statement contrasts a hub with a switch? Reason (R) : In each pass, bubble sort compares adjacent
(A) A hub broadcasts incoming data to all ports, elements and swaps them if needed.
whereas a switch intelligently forwards data to (A) Both (A) and (R) are true, and (R) is the correct
specific ports explanation
(B) A switch operates only at the physical layer, while a (B) Both (A) and (R) are true, but (R) is not the correct
hub operates at the data link layer explanation
(C) Both a hub and switch manage IP routing (C) (A) is true, (R) is false
(D) Hubs enforce collision-free transmissions better (D) (A) is false, (R) is true
than switches  Ans
Ans (A) Both (A) and (R) are true, and (R) is the correct
(A) A hub broadcasts incoming data to all ports, whereas explanation
a switch intelligently forwards data to specific ports Bubble sort works by iteratively swapping adjacent
Hubs simply replicate signals to every connected port, out-of-order items. Since larger elements get swapped
often causing collisions. Switches learn MAC addresses repeatedly toward the end, they bubble up to the final
and forward frames only to the destined port. Therefore, positions in early passes. Thus, (A) and (R) hold true,
they are more efficient and operate at the data link layer, and (R) precisely explains the underlying mechanism.
whereas hubs function purely at the physical layer.
38. Which is not a threat to network security?
35. Which statement defines spam? (A) Trojan horse
(A) Unauthorized data interception (B) Firewalls
(B) Malicious software that duplicates itself (C) Worms
(C) Unsolicited bulk messages, often email (D) Denial of service (DoS) attacks
(D) A hacking attempt bypassing firewalls  Ans
Ans (B) Firewalls
(C) Unsolicited bulk messages, often email A firewall is a protective measure, not a threat. Trojan
Spam refers to large volumes of unsolicited messages, horses, worms, and denial of service (DoS) attacks
frequently email advertisements or scams. It is not are malicious activities that harm or disrupt network
necessarily malware, though spam can contain malware operations. Firewalls help block or mitigate such threats
links. Unauthorized interception is eavesdropping, self- by controlling traffic into or out of a protected system
replicating malware is typically a worm, and hacking or network.
attempts can have broader methods than just spam.
39. Which data structure does a recursive function
36. Which protocol is not an email protocol? implicitly use to manage return addresses?
(A) SMTP (A) Queue
(B) POP3 (B) Stack
(C) IMAP (C) Linked list
(D) HTTP (D) Tree
Ans  Ans
(D) HTTP (B) Stack

Downloaded from www.mcqgpt.com


PRACTICE PAPER 20

Function calls in most programming languages use a rows based on the date column, aggregate functions
call stack to store return addresses, local variables, and like SUM() can be applied to find total sales per day.
other context information. Each time a function invokes HAVING filters group results, ORDER BY sorts, and
another, a new stack frame is pushed. Upon return, the DROP TABLE deletes structures.
stack frame is popped, restoring the caller’s context. This
42. Which network topology is specified for the store’s
mechanism underlies recursion.
internal system?
40. Which relational algebra operation extracts certain (A) Ring
attributes (columns) from a relation? (B) Mesh
(A) Selection (C) Bus
(B) Projection (D) Star
(C) Intersection  Ans
(D) Union
(D) Star
Ans The network is described as a star topology, indicating
(B) Projection all endpoints connect to a central switch or hub. This
Projection (π) returns a relation containing only specified setup simplifies management and error isolation. Ring
columns of the original relation, possibly removing topology forms continuous loops, mesh connects
duplicates. Selection (σ) filters rows, intersection retains devices in multiple paths, and bus uses a single backbone
rows common to two relations, and union merges rows cable, none matching the description here.
from both. Projection specifically narrows the set of
43. Which data structure is highlighted for order processing?
attributes shown.
(A) Stack
Direction :Carefully read the case study provided and then (B) Queue
thoroughly answer the subsequent five questions. (C) Linked list
A retail company uses a MySQL database to handle (D) Hash table
sales transactions. Each record stores product details,  Ans
quantities, and total amounts. Managers run queries with
GROUP BY to see daily or monthly total sales. They also (B) Queue
rely on Python scripts that read transaction logs from files, The text explicitly mentions FIFO processing for orders,
using exception handling to gracefully manage missing or which is characteristic of a queue. This structure handles
corrupted entries. The store’s internal network is arranged incoming tasks in the order received. A stack uses LIFO,
in a star topology with a central switch. Periodically, IT a linked list could be either but doesn’t inherently define
staff implement queue structures for processing orders in FIFO or LIFO, and a hash table supports fast lookups,
FIFO order. An external firewall protects against threats, not ordering.
while anti-malware systems scan newly added data. 44. Which Python concept ensures corrupted file logs do
Detailed data analysis employs Python’s built-in statistics not crash the script?
functions for evaluating sales performance. The system’s (A) with open()
success hinges on robust database design, network (B) pass statement
security, and efficient data structures. (C) Exception handling
41. Which MySQL feature helps managers group and sum (D) Global variables
sales by day?  Ans
(A) HAVING (C) Exception handling
(B) GROUP BY By using try-except blocks, developers can catch file-
(C) ORDER BY related errors like unreadable or missing logs and
(D) DROP TABLE handle them accordingly. The with open() statement
Ans helps manage file resources but doesn’t alone handle
(B) GROUP BY corruption. pass simply does nothing, and global
GROUP BY lets managers generate aggregated variables do not secure scripts from file-specific errors.
calculations, such as daily sums of sales. By grouping

Downloaded from www.mcqgpt.com


page 200 CUET UG Computer Science

45. Which security measure specifically protects the 47. Which Python feature helps avoid crashes if a CSV file
internal network from external intrusions? is missing?
(A) Anti-malware system (A) pass statement
(B) Switch-based star topology (B) for loop
(C) Firewall (C) Exception handling (try-except)
(D) Python scripts (D) slicing
Ans  Ans
(C) Firewall (C) Exception handling (try-except)
The case study highlights an external firewall as a line try-except blocks allow the script to handle missing or
of defense against unauthorized access or malicious inaccessible files gracefully rather than crashing. pass is
requests. While anti-malware systems guard against a no-operation command, for loops iterate, and slicing
viruses, the firewall filters incoming or outgoing traffic at manipulates data structures. Therefore, robust error
the network boundary. Switches organize the LAN, and handling keeps the script running even if file-related
Python scripts automate data processing, not security. issues appear.

Direction :Carefully read the case study provided and then 48. Which network topology does the lab use, based on
thoroughly answer the subsequent five questions. legacy infrastructure?
A research laboratory maintains a central database (A) Star
to record experimental results and researcher details. (B) Ring
Tables include Experiments (storing data points and (C) Bus
completion dates) and Researchers (storing names and (D) Mesh
contact information). MySQL queries retrieve daily logs,  Ans
often sorted by completion date using ORDER BY. Python
scripts regularly import CSV files containing new results, (C) Bus
employing try-except to prevent crashes if a file is missing. The study explicitly mentions a bus topology, an older
The lab’s computer network runs on a bus topology due setup where devices connect to a single central cable.
to legacy infrastructure. Data structures such as stacks Star topology uses a switch or hub, ring forms a loop,
help track function calls in complex simulation programs. and mesh offers multiple interconnected paths. Legacy
Additionally, the lab invests in security measures, labs sometimes retain bus networks to avoid upgrading
including a firewall and system updates, to deter malware all wiring.
infiltration. Scientists rely on these well-coordinated 49. Which data structure is mentioned for managing
elements—database integrity, structured networking, function calls in simulations?
and robust error handling—to advance research. (A) Queue
46. Which MySQL clause is used to sort experimental (B) Stack
results by completion date? (C) Hash map
(A) HAVING (D) Linked list
(B) GROUP BY  Ans
(C) ORDER BY (B) Stack
(D) DROP TABLE The text states that stacks manage function calls in
Ans simulation programs, aligning with standard call stack
(C) ORDER BY behavior. Each function call pushes context onto the
ORDER BY arranges query results based on one or stack, which is popped upon return. Queues use FIFO
more columns, such as the completion date, either logic, hash maps handle key-value storage, and linked
ascending or descending. GROUP BY aggregates rows, lists store sequences of nodes.
HAVING filters groups, and DROP TABLE removes a 50. Which security measure is highlighted alongside system
table. Therefore, ORDER BY is specifically for sorting updates to guard against malware?
results by completion date. (A) A new bus cable
(B) Firewall
(C) ORDER BY clause

Downloaded from www.mcqgpt.com


PRACTICE PAPER 20

(D) CSV import


Ans
(B) Firewall
The case mentions a firewall as part of the lab’s security
strategy, combined with ongoing system updates. The
firewall filters traffic, safeguarding internal devices
against malicious activity. A bus cable is merely network
wiring, ORDER BY is an SQL sorting command, and
CSV import concerns data input, not security.

 **************

Downloaded from www.mcqgpt.com


Grow Your Channel or Platform with These PDFs!
Are you a YouTuber, WhatsApp or Telegram group owner, website/blog owner,
or any other type of influencer? We can add your promotional link to every page
of a this PDF eBook (or many other 200 multiple PDFs), which you can then
share for free with your audience. This is a fantastic way to grow your platform
at no cost. There’s no charge for this service. All books are copyright free.

What’s in it for you?

Serve Your Audience: Provide valuable content at no cost.

Expand Your Reach: Your readers can share these PDFs on other platforms, helping your
influence grow exponentially.

Still not convinced? Ask us how, and we’ll walk you through exactly how it works.
Best of all: It’s completely free—no hidden charges.

Interested? Contact us today!

CLICK HERE TO CONTACT

इन PDFs की मदद से अपने चैनल या प्लेटफ़ॉमर् को बढ़ाएँ !


क्या आप YouTuber, WhatsApp या Telegram ग्रुप एडिमन, वेबसाइट/ब्लॉग मािलक या िकसी भी तरह के
ं को इस PDF ई-बुक (या 200 से भी अिधक अन्य ई-बुक्स) के हर पेज
इन्फ्लुएंसर हैं? हम आपके प्रमोशनल िलक
पर जोड़ सकते हैं, िजन्हें आप अपने यूज़सर् के साथ िबल्कु ल मुफ़्त में साझा कर सकते हैं। यह आपके प्लेटफ़ॉमर् को
िबना िकसी लागत के बढ़ाने का एक बेहतरीन तरीका है। हमारी यह सेवा पूरी तरह िनःशुल्क है।

आपको इससे क्या फ़ायदा होगा?


अपनी ऑिडयं स की सेवा करें: िबल्कु ल मुफ़्त में बेहतरीन कं टेंट उपलब्ध कराएँ ।
अपनी पहुँ च बढ़ाएँ : आपके यूज़सर् इन PDFs को अन्य प्लेटफ़ॉम्सर् पर भी साझा कर सकते हैं, िजससे
आपका प्रभाव कई गुना बढ़ सकता है।
अभी भी सं देह है? हमसे पूछें, और हम आपको िवस्तार से समझाएँ गे िक यह कै से काम करता है।
सबसे अच्छी बात, यह सेवा पूरी तरह िनःशुल्क है, कोई िछपा हुआ शुल्क नही!ं

Downloaded from www.mcqgpt.com


Downloaded from www.mcqgpt.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy