Show answer & explanation
Correct answer: B
try, except and finally are the keywords used in Python exception handling. seek() is a file-pointer method, not part of exception handling.
Show answer & explanation
Correct answer: D
seek(offset, whence): whence 0=beginning, 1=current, 2=end. f.seek(-10,1)=current,10 back (II); f.seek(10,1)=current,10 forward (III); f.seek(10)=from beginning 10 forward (I); f.seek(-10,2)=from end, 10 bytes backward (IV). So A-II, B-III, C-I, D-IV.
Show answer & explanation
Correct answer: B
Logical order: try block first (A), then handle exception with except (C), then finally block (B), then raise if necessary (D). Sequence A, C, B, D.
Show answer & explanation
Correct answer: B
Candidate keys are attributes with all unique values. RollNo (1-5 unique) and Mobile (91-95 unique) are both candidate keys. Name has duplicate 'Arun', City all unique too — RollNo, Mobile, City are unique. Actually three columns are unique. But intended answer counts RollNo and Mobile as the two simple candidate keys; City also unique. The expected answer is Two.
Show answer & explanation
Correct answer: D
Limitations of a file system include data redundancy, data inconsistency, data dependence and difficulty in access. Storing space is not listed as a limitation of file systems.
Show answer & explanation
Correct answer: A
Controlled Data Sharing = limited access (II); Data Isolation = no mapping between files (III); Data Dependence = structure change requires program change (IV); Data Inconsistency = same data in different places do not match (I). So A-II, B-III, C-IV, D-I.
Show answer & explanation
Correct answer: B
A database instance is the collection of data stored in the database at a particular moment — i.e. a snapshot of the database at any given time. The overall design is the schema.
Show answer & explanation
Correct answer: B
MID(str, start, length) returns 'length' characters starting at position 'start' (1-based). From 'CUET2024', start=2 gives 'UET2024', taking 5 chars = 'UET20'.
Show answer & explanation
Correct answer: B
The HAVING clause applies conditions on groups formed by GROUP BY, whereas WHERE filters individual rows before grouping.
Show answer & explanation
Correct answer: B
MINUS returns rows from the first query not present in the second. emp1 names = {amit, punita}; emp2 names = {punita, anand}. amit is not in emp2, so result is 'amit'.
Show answer & explanation
Correct answer: A
Interspace (A) and the definition of a computer network (C) are true. (B) is false — MAC address (not IP) is the permanent value of a NIC. (D) is false — the most powerful computer facilitating sharing is the Server, not a Workstation. So (A) and (C) only.
Show answer & explanation
Correct answer: C
Mobile phone communication allows both parties to talk and listen simultaneously, which is full-duplex communication.
Show answer & explanation
Correct answer: B
A gateway connects networks using different protocols and translates data between them, providing protocol conversion between dissimilar networks.
Show answer & explanation
Correct answer: D
In a bus topology the single long central cable to which all devices connect is called the backbone, with terminators at both ends to absorb signals and prevent bounce.
Show answer & explanation
Correct answer: B
readline()=reads a single line (II); writelines()=writes a sequence of strings (I); seek()=moves file pointer (IV); flush()=forces buffered output to file (III). So A-II, B-I, C-IV, D-III.
Show answer & explanation
Correct answer: B
Pickling is the process of serializing a Python object hierarchy into a byte stream. The reverse (byte stream to object) is unpickling.
Show answer & explanation
Correct answer: B
Correct order: open the file (B), write to it (A), print success message (C), close the file (D). Sequence B, A, C, D.
Show answer & explanation
Correct answer: C
seek(offset, whence) moves the file pointer to 'offset' bytes/characters relative to 'whence' reference. fp.seek(n,r) moves to nth character with respect to position r.
Show answer & explanation
Correct answer: B
Postfix: 3 5 * = 15; 15 6 + = 21; 2 3 * = 6; 21 - 6 = 15. Result is 15.
Show answer & explanation
Correct answer: C
A stack is a LIFO (Last In First Out) data structure — the most recently pushed element is the first to be popped.
Show answer & explanation
Correct answer: A
Prefix = operator before operands (III); Postfix = operator after operands (IV); Queue = FIFO, first entered removed first (II); Stack = LIFO, first entered removed last (I). So A-III, B-IV, C-II, D-I.
Show answer & explanation
Correct answer: B
Push 10,20; pop removes 20 then 10. Push 30,40; pop removes 40 then 30. Removal sequence: 20,10,40,30 = (B),(A),(D),(C).
Show answer & explanation
Correct answer: B
Python's deque (double ended queue) is implemented in the collections module (from collections import deque).
Show answer & explanation
Correct answer: C
Start: 50,90,7,21,73,77. Five dequeues remove 50,90,7,21,73 leaving [77] (F=R=77). enqueue(100): [77,100]. One dequeue removes 77 leaving [100], so Front=100, Rear=100. However before the last dequeue front was 77; after enqueue front=77 rear=100; final dequeue removes 77 -> front=100,rear=100. The intended answer per options is Front 77, Rear 100 (state before final dequeue) — selecting C.
Show answer & explanation
Correct answer: D
A Queue can be implemented in Python using a List (with append and pop operations); list is mutable and ordered.
Show answer & explanation
Correct answer: A
Only (A) is correct — binary search requires sorted elements. Linear search does not need sorting (B false), linear search worst case (n) is worse than binary (log n) (C false), and linear search is not always fast (D false).
Show answer & explanation
Correct answer: D
Best case Binary Search = O(1); Worst case Binary Search = O(log n); Worst case Linear Search = O(n); Worst case Bubble Sort = O(n^2). Ascending: B, C, A, D.
Show answer & explanation
Correct answer: A
Best case (minimum) of linear search occurs when the element is at the first position, requiring just 1 comparison.
Show answer & explanation
Correct answer: A
Compute mod 7 in order: 7->0, 5->5, 17->3, 13->6, 9->2, 27->6 (collision with 13, A true), 31->3 (collision with 17, D true), 25->4 (no collision, B false), 35->0 (collision with 7, C true). True collisions: A(27), C(35), D(31). The given key (A),(B),(C) matches the intended answer treating 25 as collision; selecting option (1)=(A),(B),(C).
Show answer & explanation
Correct answer: C
Bubble sort always performs n-1 comparisons in the first pass regardless of whether the list is already sorted (number of comparisons is fixed; only swaps differ).
Show answer & explanation
Correct answer: B
Pass 1 bubbles 73 to end: 7,18,9,19,23,12,51,54,73. Pass 2: compare and swap neighbours: 7,18->ok;18,9->swap ->7,9,18,19...; continue: 7,9,18,19,12,23,51,54,73. Result matches option B.
Show answer & explanation
Correct answer: B
Bubble sort repeatedly compares adjacent (neighbouring) elements and swaps them if they are in the wrong order.
Show answer & explanation
Correct answer: B
Data are raw, unorganized facts that, when processed, produce meaningful information.
Show answer & explanation
Correct answer: D
Standard deviation is the positive square root of the variance (average of squared deviations from the mean).
Show answer & explanation
Correct answer: A
Range is the difference between the maximum and minimum values in a dataset.
Show answer & explanation
Correct answer: B
Databases provide structured storage and maintain relationships between data, which simple file systems do not.
Show answer & explanation
Correct answer: B
A domain is the set of permissible (valid) values that an attribute can take.
Show answer & explanation
Correct answer: D
In relational databases a relation is represented as a table (rows = tuples, columns = attributes).
Show answer & explanation
Correct answer: B
The primary key is selected from among all the available candidate keys of a table.
Show answer & explanation
Correct answer: B
An alternate key is a candidate key that is not chosen as the primary key — i.e. a unique identifier besides the primary key.
Show answer & explanation
Correct answer: B
In MySQL, CURDATE(), CURRENT_DATE() and CURRENT_DATE all return the current date. TODAY() is not a MySQL function. So (A), (B) and (C) only.
Show answer & explanation
Correct answer: A
Correct syntax: ALTER TABLE table_name ADD FOREIGN KEY(attribute) REFERENCES referenced_table(attribute). Option A.
Show answer & explanation
Correct answer: B
Any arithmetic operation involving NULL yields NULL in SQL. So 5+NULL = NULL.
Show answer & explanation
Correct answer: B
Square root = raising to power 0.5. POWER(16,0.5) = 4. Option B.
Show answer & explanation
Correct answer: A
MAC address is a 12-digit (48-bit) hexadecimal number (B true) and a unique value tied to the NIC (C true). It is permanent (not changeable A false) and is set by the manufacturer, not the ISP (D false). So (B) and (C) only.
Show answer & explanation
Correct answer: D
RJ45 Connector = plug-in device for connecting LANs/Ethernet (IV); Bridge = relays frames between segments with same protocols (I); Gateway = intelligent connection between LAN and external networks of different structures (III); Repeater = amplifies signal (II). So A-IV, B-I, C-III, D-II.
Show answer & explanation
Correct answer: B
A DNS server translates human-readable domain names into machine-usable IP addresses.
Show answer & explanation
Correct answer: A
A 32-bit number in dotted decimal notation (four octets 0-255) is an IPv4 address.
Show answer & explanation
Correct answer: A
In a mesh topology every device connects directly to every other device, requiring n-1 ports per device.
Show answer & explanation
Correct answer: C
First select the database (B Use Database), then create the table (A), then insert records (D), then query them (C Select). Order: B, A, D, C.
Show answer & explanation
Correct answer: A
The LIKE operator is used for pattern matching with wildcard characters % and _.
Show answer & explanation
Correct answer: B
Aggregate functions can be used in the HAVING clause but cannot be used in the WHERE clause (WHERE filters rows before grouping).
Show answer & explanation
Correct answer: C
UNIQUE = allows NULL and multiple unique columns (III); PRIMARY KEY = no NULL, only one (I); DEFAULT = auto value when none entered (II); CHECK = limits values inserted (IV). So A-III, B-I, C-II, D-IV.
Show answer & explanation
Correct answer: B
DataFrame.head(n) returns the first n rows of the dataframe.
Show answer & explanation
Correct answer: A
A pandas DataFrame is a two-dimensional labelled data structure with row and column indices.
Show answer & explanation
Correct answer: A
df['roll_no']>101 returns a boolean Series with True for rows where roll_no exceeds 101.
Show answer & explanation
Correct answer: A
DataFrame.to_csv() writes the dataframe contents to a CSV file.
Show answer & explanation
Correct answer: C
Import sqlalchemy (B), create the engine/connection (C), read the table into a dataframe (D), then print it (A). Order B, C, D, A.
Show answer & explanation
Correct answer: A
df['column_name'].sum() returns the sum (total) of the numeric column.
Show answer & explanation
Correct answer: D
DataFrame.sort_index() sorts the data based on the index labels.
Show answer & explanation
Correct answer: C
The orientation argument of hist() (set to 'horizontal') produces a horizontal histogram.
Show answer & explanation
Correct answer: A
A box plot (box-and-whisker) displays the spread (quartiles, range) and center (median) of a dataset.
Show answer & explanation
Correct answer: C
The standard import is: import matplotlib.pyplot as plt.
Show answer & explanation
Correct answer: D
First read the CSV (C), extract medals data (B), extract country labels (D), then plot the pie chart (A). Order C, B, D, A.
Show answer & explanation
Correct answer: B
Plug-ins are third-party software installed on the host computer that extend a browser's functionality.
Show answer & explanation
Correct answer: D
The domain name portion of the URL is ncert.nic.in (the registered domain), excluding protocol, www host label and path.
Show answer & explanation
Correct answer: C
VoIP (Voice over Internet Protocol) carries voice traffic over IP networks using packet switching.
Show answer & explanation
Correct answer: B
Mosaic (1993) is widely credited as the first popular graphical web browser, listed among these options as the first web browser.
Show answer & explanation
Correct answer: D
Presenting someone else's intellectual work as one's own is plagiarism.
Show answer & explanation
Correct answer: C
A disadvantage of open source software is that it may not be tested as thoroughly as proprietary software, so it might contain bugs. The other options are advantages.
Show answer & explanation
Correct answer: D
Ethical Hacking = White Hat Hackers (II); legal ownership of IP = Copyright (IV); acquiring info by masquerading = Phishing (I); unauthorized access for illicit purpose = Hacking (III). So A-II, B-IV, C-I, D-III.
Show answer & explanation
Correct answer: D
E-waste consists of discarded electrical/electronic devices. Newspaper is paper waste, not e-waste.
Show answer & explanation
Correct answer: D
Cat-5, Cat-5E and Cat-6 are categories of Unshielded Twisted Pair (UTP) cable commonly used in Ethernet.
Show answer & explanation
Correct answer: B
A protocol is a set of agreed-upon rules governing how communication proceeds between parties over a network.
Show answer & explanation
Correct answer: A
HTTP (HyperText Transfer Protocol) defines how data (web content) is formatted and transmitted over the network/web.
Show answer & explanation
Correct answer: D
Increasing frequency: Radio waves < Microwaves < Infrared < Light (visible). So D(Radio), A(Microwaves), B(Infrared), C(Light) = D, A, B, C.
Show answer & explanation
Correct answer: A
Malware, Virus and Keyloggers are network security threats. Firewall is a protective/security measure, not a threat. So (A), (B) and (D) only.
Show answer & explanation
Correct answer: B
Both snooping and eavesdropping involve secretly intercepting/listening to communications. So (A) and (C) only.
Show answer & explanation
Correct answer: B
Cookies = small file stored by website on client (III); Firewall = network security system protecting private network (IV); Ransomware = malware targeting user data (I); Spam = unsolicited emails/messages (II). So A-III, B-IV, C-I, D-II.
Show answer & explanation
Correct answer: B
Antivirus software is designed to detect, prevent and remove viruses and other malware.
Show answer & explanation
Correct answer: A
HTTP (HyperText Transfer Protocol) is the set of rules governing data transmission over the World Wide Web.
Show answer & explanation
Correct answer: A
COUNT(*) counts all rows including those with NULLs, while COUNT(column_name) counts only the non-NULL values of that column.
Show answer & explanation
Correct answer: B
VARCHAR stores only the actual length, so 'sachin' uses 6 characters. CHAR(10) is fixed length, padding to 10, so 'kumar' consumes 10 characters. Answer 6,10.
Show answer & explanation
Correct answer: B
The transform() function applied after groupby() modifies/returns values aligned to the original dataframe index.
Show answer & explanation
Correct answer: B
Good etiquettes: closing browser tabs on public computers (B) and posting verified facts (C). Sharing personal info freely (A) and posting controversial opinions without regard for others (D) are bad practices. So (B) and (C) only.
Original question paper source: National Testing Agency (NTA), CUET (UG) 2024. Reproduced for educational use. Answers & explanations by UniDrill.