← All previous-year papers

CUET 2024 Computer Science Question Paper with Answers & Solutions

85 questions with answer key & explanations

Q1.
Which of the following are used in python exception handling ? (A) try (B) except (C) finally (D) seek Choose the correct answer from the options given below :
A. (A), (B) and (D) only
B. (A), (B) and (C) only
C. (A), (B), (C) and (D)
D. (B), (C) and (D) only
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.

Q2.
Match List-I with List-II : List-I (A) f.seek(-10,1) (B) f.seek(10,1) (C) f.seek(10) (D) f.seek(-10,2) List-II (I) from beginning of file, move 10 bytes forward (II) from current position moves 10 bytes backward (III) from current position moves 10 bytes forward (IV) from end of the file, move to the 10 bytes backward Choose the correct answer from the options given below :
A. (A) - (I), (B) - (II), (C) - (III), (D) - (IV)
B. (A) - (II), (B) - (III), (C) - (IV), (D) - (I)
C. (A) - (III), (B) - (II), (C) - (IV), (D) - (I)
D. (A) - (II), (B) - (III), (C) - (I), (D) - (IV)
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.

Q3.
Arrange the following in correct order of exception handling in python : (A) Write the code that may raise an exception inside a try block (B) Execute some code regardless of whether the exception occurs or not using the finally block (C) Handle the specific exception using the except block (D) Raise the exception using the raise statement if necessary Choose the correct answer from the options given below :
A. (A), (B), (C), (D)
B. (A), (C), (B), (D)
C. (B), (A), (D), (C)
D. (C), (B), (D), (A)
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.

Q4.
Consider the following table called 'Student' with columns RollNo, Name, Mobile, City and rows: 1 Arun 91 Delhi; 2 Sanjay 92 Mumbai; 3 Arun 93 Noida; 4 Varun 94 Guwahati; 5 Arti 95 Kolkata. How many candidate keys are possible with above table ?
A. One
B. Two
C. Three
D. Four
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.

Q5.
Which of the following is not a limitation of file system ?
A. Data Redundancy
B. Data Inconsistency
C. Data dependence
D. Storing Space
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.

Q6.
Match List-I with List-II : List-I (A) Controlled Data Sharing (B) Data Isolation (C) Data Dependence (D) Data Inconsistency List-II (I) Same data maintained in different places do not match (II) Limited Access given to users. (III) There is no mapping between two files. (IV) If the structure of a file is changed, all the existing programs accessing that file also need to be changed. Choose the correct answer from the options given below :
A. (A) - (II), (B) - (III), (C) - (IV), (D) - (I)
B. (A) - (II), (B) - (III), (C) - (I), (D) - (IV)
C. (A) - (IV), (B) - (II), (C) - (III), (D) - (I)
D. (A) - (III), (B) - (IV), (C) - (I), (D) - (II)
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.

Q7.
Which of the following is called database instance ?
A. Overall design of the database
B. The snapshot of the database at any given time.
C. Data about the data
D. Restriction on the type of data inserted.
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.

Q8.
What is output of the following SQL statement ? SELECT MID('CUET2024',2,5)
A. UET2
B. UET20
C. ET202
D. CUET2
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'.

Q9.
SQL applies conditions on the groups through __________ clause after groups have been formed.
A. where
B. having
C. new
D. all
Show answer & explanation

Correct answer: B

The HAVING clause applies conditions on groups formed by GROUP BY, whereas WHERE filters individual rows before grouping.

Q10.
Consider the following two tables emp1 (Id,name: 1 amit, 2 punita) and emp2 (Id,name: 1 punita, 2 anand). What is output of the following query. SELECT name from emp1 minus SELECT name from emp2
A. punita
B. amit
C. anand
D. amit punita
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'.

Q11.
Which of the following statement(s) is/ are TRUE regarding computer network ? (A) Interspace is a software that allows multiple users in a client-server environment to communicate with each other by sending and receiving data of various types. (B) IP address is a unique permanent value associated with a network adapter called a NIC. (C) A computer network is an interconnection among two or more computers or computing devices to share data and resources. (D) The term 'Workstation' refers to the most powerful computer of the network that facilitates sharing of data, software and hardware resources on the network and have more memory, processing power and storage than a normal node. Choose the correct answer from the options given below:
A. (A) and (C) only
B. (A), (B) and (C) only
C. (C) and (D) only
D. (B) and (D) only
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.

Q12.
Communication over mobile phone is an example of which type of communication mode ?
A. Simplex
B. Half-Duplex
C. Full-Duplex
D. Double-Duplex
Show answer & explanation

Correct answer: C

Mobile phone communication allows both parties to talk and listen simultaneously, which is full-duplex communication.

Q13.
Which of the following device provides the necessary translation of data received from network into a format or protocol recognized by devices with the internal network?
A. Bridge
B. Gateway
C. Router
D. Modem
Show answer & explanation

Correct answer: B

A gateway connects networks using different protocols and translates data between them, providing protocol conversion between dissimilar networks.

Q14.
A long cable that helps to connect several devices in bus topology having terminators at both end to prevent signal bounce is known as __________.
A. Drop Line
B. Taps
C. Analog cable
D. Backbone
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.

Q15.
Match List-I with List-II : List-I (A) readline() (B) writelines() (C) seek() (D) flush() List-II (I) Writes a sequence of strings to the file (II) Reads a single line from the file (III) Force any buffered output to be written to the file (IV) Moves the file pointer to the specified position Choose the correct answer from the options given below :
A. (A) - (I), (B) - (II), (C) - (III), (D) - (IV)
B. (A) - (II), (B) - (I), (C) - (IV), (D) - (III)
C. (A) - (II), (B) - (I), (C) - (III), (D) - (IV)
D. (A) - (III), (B) - (IV), (C) - (I), (D) - (II)
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.

Q16.
What is pickling ?
A. It is used to deserialize objects i.e. converting the byte stream to object hierarchy
B. It is used to serialize objects i.e. to convert python object hierarchy to byte stream
C. It is used to move the file pointer to specific location
D. It is used in exception handling
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.

Q17.
Consider the following code and specify the correct order of the statements to be written (A) f.write("CUET EXAMINATION") (B) f=open("CUET.TXT", "w") (C) print("Data is Written Successfully") (D) f.close() Choose the correct answer from the options given below :
A. (A), (B), (C), (D)
B. (B), (A), (C), (D)
C. (B), (D), (C), (A)
D. (B), (D), (A), (C)
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.

Q18.
Which method from below will take a file pointer to nth character with respect to r position ?
A. fp.seek(r)
B. fp.seek(n)
C. fp.seek(n,r)
D. seek(n,r).fp
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.

Q19.
Evaluate the given postfix expression : 3 5 * 6 + 2 3 * -
A. 39
B. 15
C. -9
D. -17
Show answer & explanation

Correct answer: B

Postfix: 3 5 * = 15; 15 6 + = 21; 2 3 * = 6; 21 - 6 = 15. Result is 15.

Q20.
Stack works on the principle of __________.
A. Mid Element First
B. First In First Out
C. Last In First Out
D. Last In Last Out
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.

Q21.
Match List-I with List-II : List-I (Term) (A) Prefix (B) Postfix (C) Queue (D) Stack List-II (Description) (I) In this the element entered first will be removed last. (II) In this the element entered first will be removed first. (III) In this the operator is placed before the operands. (IV) In this the operator is placed after the operands. Choose the correct answer from the options given below :
A. (A) - (III), (B) - (IV), (C) - (II), (D) - (I)
B. (A) - (IV), (B) - (III), (C) - (II), (D) - (I)
C. (A) - (I), (B) - (II), (C) - (IV), (D) - (III)
D. (A) - (II), (B) - (I), (C) - (III), (D) - (IV)
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.

Q22.
What will be the sequence of elements removed from the stack after performing the following operations PUSH(10) PUSH(20) POP() POP() PUSH(30) PUSH(40) POP() POP() (A) 10 (B) 20 (C) 30 (D) 40 Choose the correct sequence from the options given below :
A. (A), (B), (C), (D)
B. (B), (A), (D), (C)
C. (A), (B), (D), (C)
D. (B), (A), (C), (D)
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).

Q23.
In Python, __________ module need to be imported for implementing Double Ended Queue.
A. counter
B. collections
C. random
D. numpy
Show answer & explanation

Correct answer: B

Python's deque (double ended queue) is implemented in the collections module (from collections import deque).

Q24.
What will be the position of front and rear after execution of the following statements, the Queue already had the given elements in FIFO order 50 -> 90 -> 7 -> 21 -> 73 -> 77 (F at 50, R at 77) dequeue() dequeue() dequeue() dequeue() dequeue() enqueue(100) dequeue()
A. Front 50, Rear 77
B. Front 100, Rear 100
C. Front 77, Rear 100
D. Front 73, Rear 77
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.

Q25.
__________ data type is used to implement Queue data structure in Python.
A. Sets
B. Dictionary
C. Tuple
D. List
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.

Q26.
Choose the statements that are correct. (A) For Binary Search, all the elements have to be sorted. (B) For Linear Search, all the elements have to be sorted. (C) Linear Search takes less time for searching in worst case than binary search's worst case. (D) Linear Search always give fast result whether elements are sorted or not. Choose the correct answer from the options given below :
A. (A) only
B. (A) and (C) only
C. (B) and (C) only
D. (A), (B) and (D) only
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).

Q27.
Arrange the following in the ascending order of their time complexity. (A) Worst Case of Linear Search (B) Best Case of Binary Search (C) Worst Case of Binary Search (D) Worst Case of Bubble Sort Choose the correct sequence from the options given below :
A. (A), (B), (C), (D)
B. (B), (D), (A), (C)
C. (B), (A), (C), (D)
D. (B), (C), (A), (D)
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.

Q28.
How many minimum number of comparison(s) can be required to search an element from 'n' elements, in case of Linear Search ?
A. 1
B. n - 1
C. n
D. n + 1
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.

Q29.
Which of the statement(s) is/are True for the given question. Data elements are : 7, 5, 17, 13, 9, 27, 31, 25, 35. Hash Table Size: 7 Hash Function: H(I) = (Data element) mod (Hash Table Size) (A) Element 27 will create collision. (B) Element 25 will create collision. (C) Element 35 will create collision. (D) Element 31 will create collision. Choose the correct answer from the options given below :
A. (A), (B) and (C) only
B. (A), (C) and (D) only
C. (B), (C) and (D) only
D. (A) and (D) only
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).

Q30.
If a list contain 'n' number of elements and all the elements by default sorted in ascending order then how many comparisons will be required during 1st pass of bubble sort to arrange the list in ascending order ?
A. 0
B. 1
C. n - 1
D. n
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).

Q31.
What will be the result after the pass 2 using Bubble Sort, if we are sorting elements in ascending order ? Initial array: 7 19 18 9 23 51 12 54 73
A. 7 18 19 9 23 12 51 54 73
B. 7 9 18 19 12 23 51 54 73
C. 7 9 19 18 12 23 51 54 73
D. 7 9 18 19 23 51 12 54 73
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.

Q32.
__________ compares neighbouring elements only and swaps them when necessary.
A. Selection Sort
B. Bubble Sort
C. Insertion Sort
D. Quick Sort
Show answer & explanation

Correct answer: B

Bubble sort repeatedly compares adjacent (neighbouring) elements and swaps them if they are in the wrong order.

Q33.
__________ are the unorganized facts that can be processed to generate meaningful information.
A. Information
B. Data
C. Blog
D. contexts
Show answer & explanation

Correct answer: B

Data are raw, unorganized facts that, when processed, produce meaningful information.

Q34.
__________ is the positive square root of the average of squared difference of each value from the mean.
A. Mode
B. Variance
C. Median
D. Standard Deviation
Show answer & explanation

Correct answer: D

Standard deviation is the positive square root of the variance (average of squared deviations from the mean).

Q35.
Consider the stock prices for shares of a company A for a week. To find difference of maximum and minimum value of the share price which statistical technique can be used :
A. Range
B. Mode
C. Mean
D. Median
Show answer & explanation

Correct answer: A

Range is the difference between the maximum and minimum values in a dataset.

Q36.
What is the primary difference between a database and a file system ?
A. Databases are slower than file systems for retrieving data.
B. Databases offer structured data and relationships, while file systems do not.
C. File systems can support complex queries, unlike databases.
D. Both databases and file systems handle data in the same way.
Show answer & explanation

Correct answer: B

Databases provide structured storage and maintain relationships between data, which simple file systems do not.

Q37.
A domain in a relational database refers to :
A. The overall database structure
B. A specific set of valid values for an attribute
C. A table containing multiple records
D. A relationship between two tables
Show answer & explanation

Correct answer: B

A domain is the set of permissible (valid) values that an attribute can take.

Q38.
A relation in a relational database is also known as :
A. A data type
B. An attribute
C. A schema
D. A table
Show answer & explanation

Correct answer: D

In relational databases a relation is represented as a table (rows = tuples, columns = attributes).

Q39.
The primary key is chosen from __________.
A. The most complex candidate key available.
B. All available candidate keys for a table.
C. The simplest candidate key available.
D. Any attribute within the table.
Show answer & explanation

Correct answer: B

The primary key is selected from among all the available candidate keys of a table.

Q40.
An alternate key is __________.
A. Another name for the primary key
B. A unique identifier besides the primary key
C. A relationship between two tables
D. A synonym for a tuple
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.

Q41.
Consider the following SQL functions. (A) CURDATE() (B) CURRENT_DATE() (C) CURRENT_DATE (D) TODAY() Which of the above function/functions returns current date.
A. (A), (B) and (D) only
B. (A), (B) and (C) only
C. (A), (B), (C) and (D)
D. (B), (C) and (D) only
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.

Q42.
Which of the following is correct syntax for inserting foreign key constraint in a relation ?
A. ALTER TABLE table_name ADD FOREIGN KEY(attribute name) REFERENCES referenced_table_name(attribute name)
B. ADD TABLE table_name ADD FOREIGN KEY(attribute name) REFERENCES referenced_table_name(attribute name)
C. ALTER TABLE table_name REFERENCES referenced_table_name(attribute name) ADD FOREIGN KEY(attribute name)
D. MODIFY TABLE table_name ADD FOREIGN KEY(attribute name) REFERENCES referenced_table_name(attribute name)
Show answer & explanation

Correct answer: A

Correct syntax: ALTER TABLE table_name ADD FOREIGN KEY(attribute) REFERENCES referenced_table(attribute). Option A.

Q43.
What is result of following arithmetic operation in SQL ? SELECT 5+NULL AS RESULT
A. 5
B. NULL
C. 0
D. 5NULL
Show answer & explanation

Correct answer: B

Any arithmetic operation involving NULL yields NULL in SQL. So 5+NULL = NULL.

Q44.
Which of the following expression in SQL would calculate the square root of 16 ?
A. POWER(16,2)
B. POWER(16,0.5)
C. POWER(16,1)
D. MOD(16)
Show answer & explanation

Correct answer: B

Square root = raising to power 0.5. POWER(16,0.5) = 4. Option B.

Q45.
Which of the following statement(s) is/are TRUE in respect of Media Access Control (MAC) Address ? (A) It can be changed if a node is removed from one network and connected to another network. (B) Each MAC address is a 12-digit hexadecimal number. (C) It is a unique value associated with a network adapter called NIC. (D) It is provided by the Internet Service Provider to locate computers connected to the internet. Choose the correct answer from the options given below :
A. (B) and (C) only
B. (A), (B) and (C) only
C. (C) and (D) only
D. (A) and (B) only
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.

Q46.
Match List-I with List-II : List-I (Device) (A) RJ45 Connector (B) Bridge (C) Gateway (D) Repeater List-II (Use) (I) relay frames between two originally separate segments that follow same protocols. (II) amplifies a signal that is transmitted across the network so that the signal is received same as it is sent. (III) establishes an intelligent connection between a local area network and external networks with completely different structures. (IV) plug-in device primarily used for connecting LANs particularly Ethernet. Choose the correct answer from the options given below :
A. (A) - (IV), (B) - (III), (C) - (II), (D) - (I)
B. (A) - (III), (B) - (II), (C) - (I), (D) - (IV)
C. (A) - (III), (B) - (I), (C) - (IV), (D) - (II)
D. (A) - (IV), (B) - (I), (C) - (III), (D) - (II)
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.

Q47.
What is the purpose of Domain Name System Server in networking ?
A. To encrypt data during transmission.
B. To convert domain names into IP addresses
C. To regulate network traffic flow.
D. To establish a secure connection between devices.
Show answer & explanation

Correct answer: B

A DNS server translates human-readable domain names into machine-usable IP addresses.

Q48.
140.168.220.200 is a 32-bit binary number usually represented as 4 decimal values, each representing 8 bits, in the range 0 to 255 separated by decimal points. What is this number called ?
A. IP Address
B. Web Address
C. MAC Address
D. Port Address
Show answer & explanation

Correct answer: A

A 32-bit number in dotted decimal notation (four octets 0-255) is an IPv4 address.

Q49.
In a __________ topology, if there are n devices in a network, each device has n-1 ports for cables.
A. Mesh
B. Bus
C. Star
D. Ring
Show answer & explanation

Correct answer: A

In a mesh topology every device connects directly to every other device, requiring n-1 ports per device.

Q50.
Amit wants to be familiar with SQL. One of his friends Anand suggest him to execute following sql commands. (A) Create Table Student (B) Use Database DB (C) Select * from Student (D) Insert into Student In which order Amit needs to run above commands.
A. (A), (B), (C), (D)
B. (A), (B), (D), (C)
C. (B), (A), (D), (C)
D. (C), (B), (D), (A)
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.

Q51.
The SQL keyword __________ is used with wildcards.
A. LIKE
B. IN
C. NOT IN
D. DISTINCT
Show answer & explanation

Correct answer: A

The LIKE operator is used for pattern matching with wildcard characters % and _.

Q52.
Aggregate functions can be used with ______ clause. They can not be used with ______ clause.
A. WHERE,HAVING
B. HAVING,WHERE
C. GROUP BY,HAVING
D. SELECT,HAVING
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).

Q53.
Match List-I with List-II : List-I (A) UNIQUE CONSTRAINT (B) PRIMARY KEY CONSTRAINT (C) DEFAULT CONSTRAINT (D) CHECK CONSTRAINT List-II (I) Does not allow NULL value and there can exist only one column or one combination with this constraint. (II) Automatically value is inserted when user does not enter a value for the column. (III) Allows NULL values and their can exist multiple columns with this constraint. (IV) Limits values that can be inserted into a column of a table. Choose the correct answer from the options given below :
A. (A) - (III), (B) - (I), (C) - (IV), (D) - (II)
B. (A) - (III), (B) - (IV), (C) - (I), (D) - (II)
C. (A) - (III), (B) - (I), (C) - (II), (D) - (IV)
D. (A) - (I), (B) - (III), (C) - (II), (D) - (IV)
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.

Q54.
Which function should be used to get first n rows of a dataframe ?
A. print(n)
B. head(n)
C. get(n)
D. call(n)
Show answer & explanation

Correct answer: B

DataFrame.head(n) returns the first n rows of the dataframe.

Q55.
__________ is two dimensional data structure in Python with row index and column index.
A. DataFrame
B. List
C. Tuple
D. Series
Show answer & explanation

Correct answer: A

A pandas DataFrame is a two-dimensional labelled data structure with row and column indices.

Q56.
Which of the following is used in a dataframe df, to check for the rows with roll_no above 101 and display boolean True or false.
A. df['roll_no']>101
B. df.roll_no<101
C. df.check(roll_no>101)
D. df.apply(check(roll_no>101))
Show answer & explanation

Correct answer: A

df['roll_no']>101 returns a boolean Series with True for rows where roll_no exceeds 101.

Q57.
To save data of a dataframe to a csv file use :
A. to_csv()
B. to.csv()
C. from_csv
D. fill_csv()
Show answer & explanation

Correct answer: A

DataFrame.to_csv() writes the dataframe contents to a CSV file.

Q58.
Consider the task of printing records from a MySQL table named Student. Identify the correct order of the commands given below. (A) print(df) (B) import sqlalchemy as sq (C) con=sq.create_engine("mysql+mysqlconnector://root@localhost/") (D) df=pd.read_sql("Student",con) Choose the correct answer from the options given below :
A. (A), (B), (C), (D)
B. (A), (C), (B), (D)
C. (B), (C), (D), (A)
D. (C), (B), (D), (A)
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.

Q59.
To get the total of a numeric column in a dataframe df, use :
A. df['column_name'].sum()
B. column_name.df.sum()
C. column_name.df.total()
D. df_total(column_name)
Show answer & explanation

Correct answer: A

df['column_name'].sum() returns the sum (total) of the numeric column.

Q60.
__________ method is used to sort the data on the basis of index value.
A. sort_asc()
B. sort_desc()
C. sort_value()
D. sort_index()
Show answer & explanation

Correct answer: D

DataFrame.sort_index() sorts the data based on the index labels.

Q61.
__________ argument of hist() is used to create a horizontal histogram.
A. landscape
B. portrait
C. orientation
D. type
Show answer & explanation

Correct answer: C

The orientation argument of hist() (set to 'horizontal') produces a horizontal histogram.

Q62.
__________ plot is used to show the spread and centers of a dataset.
A. box
B. line
C. bar
D. histogram
Show answer & explanation

Correct answer: A

A box plot (box-and-whisker) displays the spread (quartiles, range) and center (median) of a dataset.

Q63.
Which of the following is the correct command to use matplotlib ?
A. import plt.matplotlib as plot
B. import matplotlib.plt at plot
C. import matplotlib.pyplot as plt
D. import matplotlib.plot as plot
Show answer & explanation

Correct answer: C

The standard import is: import matplotlib.pyplot as plt.

Q64.
Consider a CSV file containing number of medals won by some countries in Olympics 2020 medal.csv (UK 46, USA 53, China 49, Germany 39). The task is to create a pie chart from the above data : (A) plt.pie(medal_data, labels='country_data') (B) medal_data=df['medals'] (C) df=pd.read_csv('medal.csv') (D) country_data=df['country'] Choose the correct sequence of the above commands from the options given below :
A. (C), (A), (B), (D)
B. (D), (C), (B), (A)
C. (B), (A), (D), (C)
D. (C), (B), (D), (A)
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.

Q65.
__________ is a third party software that is installed on the host computer and can be used by the browser for multiple functionalities.
A. Cookies
B. Plug-ins
C. Shortcuts
D. router
Show answer & explanation

Correct answer: B

Plug-ins are third-party software installed on the host computer that extend a browser's functionality.

Q66.
Which of the following is the domain name in the given URL below ? http://www.ncert.nic.in/exam/samplepaper.htm
A. http://www.ncert.nic.in
B. www.ncert.nic.in/exam/samplepaper.htm
C. http://
D. ncert.nic.in
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.

Q67.
__________ uses packet switching technology to carry voice traffic over an IP network where each packet follows best route to reach its destination.
A. E-mail
B. HTTP
C. VoIP
D. SMTP
Show answer & explanation

Correct answer: C

VoIP (Voice over Internet Protocol) carries voice traffic over IP networks using packet switching.

Q68.
Which among the following was the first web browser ?
A. Internet Explorer
B. Mosaic
C. Google Chrome
D. Opera
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.

Q69.
Stealing someone's intellectual work and representing it as your own is known as.........
A. Fraud
B. Identity Theft
C. Online Stealing
D. Plagiarism
Show answer & explanation

Correct answer: D

Presenting someone else's intellectual work as one's own is plagiarism.

Q70.
Which of the following could be a disadvantage of 'open source' software ?
A. High quality software with lots of features
B. Not as customizable
C. May not have been tested as much as proprietary software so might have bugs
D. You can edit the source code to customize it
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.

Q71.
Match List-I with List-II : List-I (A) Ethical Hacking (B) Legal mechanism to establish a sort of ownership of intellectual property (C) Attempt to acquire sensitive information by masquerading as a trustworthy party in electronic communication (D) Gaining unauthorized access to a computing device or a group of computer systems for some illicit purpose List-II (I) Phishing (II) White Hat Hackers (III) Hacking (IV) Copyright Choose the correct answer from the options given below :
A. (A) - (II), (B) - (I), (C) - (III), (D) - (IV)
B. (A) - (II), (B) - (III), (C) - (IV), (D) - (I)
C. (A) - (II), (B) - (III), (C) - (I), (D) - (IV)
D. (A) - (II), (B) - (IV), (C) - (I), (D) - (III)
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.

Q72.
Which of the following is not considered as a type of e-waste ?
A. Televisions
B. Personal Electronic Devices
C. Scanner and Copier
D. Newspaper
Show answer & explanation

Correct answer: D

E-waste consists of discarded electrical/electronic devices. Newspaper is paper waste, not e-waste.

Q73.
Cat-5, Cat-5E and Cat-6 are examples of which of the following cables ?
A. Coaxial Cable
B. Shielded Twisted Pair Cable
C. Fiber Optic cable
D. Unshielded Twisted Pair Cable
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.

Q74.
__________ is an agreement between the communicating parties on how communication is to proceed over a network.
A. Ethernet
B. Protocol
C. Operating System
D. Antivirus
Show answer & explanation

Correct answer: B

A protocol is a set of agreed-upon rules governing how communication proceeds between parties over a network.

Q75.
Which of the following protocol defines that how the data is formatted and transmitted over the network ?
A. HTTP
B. SMTP
C. FTP
D. POP3
Show answer & explanation

Correct answer: A

HTTP (HyperText Transfer Protocol) defines how data (web content) is formatted and transmitted over the network/web.

Q76.
Arrange the following electromagnetic waves in increasing order of their frequency range. (A) Microwaves (B) Infrared Waves (C) Light Waves (D) Radio Waves Choose the correct answer from the options given below :
A. (A), (C), (D), (B)
B. (D), (C), (B), (A)
C. (B), (A), (D), (C)
D. (D), (A), (B), (C)
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.

Q77.
Which of the following are considered as the threats in network security ? (A) Malware (B) Virus (C) Firewall (D) Keyloggers Choose the correct combination from the options given below :
A. (A), (B) and (D) only
B. (A), (B) and (C) only
C. (A) and (D) only
D. (A) and (B) only
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.

Q78.
Which of the following is done by secretly listening to a conversation ? (A) Snooping (B) Denial of Service (C) Eavesdropping (D) Buffer Overflow Choose the correct answer from the options given below :
A. (A) only
B. (A) and (C) only
C. (A) and (D) only
D. (B) and (C) only
Show answer & explanation

Correct answer: B

Both snooping and eavesdropping involve secretly intercepting/listening to communications. So (A) and (C) only.

Q79.
Match List-I with List-II : List-I (A) Cookies (B) Firewall (C) Ransomware (D) Spam List-II (I) Type of malware that targets user data (II) Undetected unsolicited emails or messages (III) Small file or data packet which is stored by a website on the client's computer (IV) Network Security system designed to protect a trusted private network Choose the correct answer from the options given below :
A. (A) - (III), (B) - (II), (C) - (I), (D) - (IV)
B. (A) - (III), (B) - (IV), (C) - (I), (D) - (II)
C. (A) - (III), (B) - (I), (C) - (IV), (D) - (II)
D. (A) - (III), (B) - (IV), (C) - (II), (D) - (I)
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.

Q80.
The software developed to detect and remove viruses only is called __________.
A. Malware
B. Antivirus
C. Spyware
D. Adware
Show answer & explanation

Correct answer: B

Antivirus software is designed to detect, prevent and remove viruses and other malware.

Q81.
__________ are the set of rules that governs how data can be transmitted over world wide web.
A. Hyper Text Transfer Protocol
B. Encryption Standards
C. Cyber forensic
D. Digital Certificates
Show answer & explanation

Correct answer: A

HTTP (HyperText Transfer Protocol) is the set of rules governing data transmission over the World Wide Web.

Q82.
What is the difference between COUNT(*) and COUNT(column_name) in a SQL query ?
A. COUNT(*) counts all rows, while COUNT(column_name) counts only non-null values in the specified column.
B. COUNT(*) counts only distinct values, while COUNT(column_name) counts all duplicate values.
C. COUNT(*) is faster than COUNT(column_name).
D. There is no difference; they both do the same thing.
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.

Q83.
A table Student has two text fields defined as below : firstname varchar(10) lastname char(10) If firstname stores value as 'sachin' and lastname stores value as 'kumar', then firstname will consume ______ characters space and lastname will consume ______ characters space.
A. 6, 5
B. 6,10
C. 10,6
D. 5,6
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.

Q84.
__________ function is used to modify values of a dataframe in conjunction with group by.
A. index()
B. transform()
C. reindex()
D. import()
Show answer & explanation

Correct answer: B

The transform() function applied after groupby() modifies/returns values aligned to the original dataframe index.

Q85.
Which of the following are good net surfing etiquettes? (A) Share personal information freely (B) Closing browser tabs after use on public computers (C) Posting verified facts (D) Post controversial opinion without regards for others Choose the correct answer from the options given below :
A. (A) and (D) only
B. (B) and (C) only
C. (C) and (D) only
D. (A) and (C) only
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.