CUET Exam  >  CUET Tests  >  Computer Science: CUET Mock Test - 1 - CUET MCQ

Computer Science: CUET Mock Test - 1 - CUET MCQ


Test Description

30 Questions MCQ Test - Computer Science: CUET Mock Test - 1

Computer Science: CUET Mock Test - 1 for CUET 2025 is part of CUET preparation. The Computer Science: CUET Mock Test - 1 questions and answers have been prepared according to the CUET exam syllabus.The Computer Science: CUET Mock Test - 1 MCQs are made for CUET 2025 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Computer Science: CUET Mock Test - 1 below.
Solutions of Computer Science: CUET Mock Test - 1 questions in English are available as part of our course for CUET & Computer Science: CUET Mock Test - 1 solutions in Hindi for CUET course. Download more important topics, notes, lectures and mock test series for CUET Exam by signing up for free. Attempt Computer Science: CUET Mock Test - 1 | 50 questions in 45 minutes | Mock test for CUET preparation | Free important questions MCQ to study for CUET Exam | Download free PDF with solutions
Computer Science: CUET Mock Test - 1 - Question 1

Python is a/an ______based language.

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 1

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.

Computer Science: CUET Mock Test - 1 - Question 2

Given below are two statements:
Statement I. When all the value are sorted in ascending or descending order, the middle value is called mode.
Statement II. Value that appears most number of times in the given data of an attribute / variable is called mode.

In the light of the above statements, choose the correct answer from the options given below:

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 2

The correct answer is Statement I is incorrect but statement II is true

Key Points

  • The mode is the value that appears most frequently in a set of data, not the middle value when sorted. So, Statement II accurately describes the mode.
Computer Science: CUET Mock Test - 1 - Question 3

Adjacent elements are compared and swapped in ________ sorting technique.

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 3

The correct answer is Bubble sort

Key Points

  • Bubble sort works by repeatedly comparing adjacent elements and swapping them if they are in the wrong order. This process continues until the list is sorted.

Additional Information

  • Insertion sort: Insertion sort builds the sorted list one element at a time. It compares each element with the sorted portion of the list and inserts it at the correct position.
  • Selection sort: Selection sort finds the minimum (or maximum) element in the unsorted part of the list and swaps it with the first element. This process continues until the list is sorted.
  • Adjacent sort: There is no sorting technique called "adjacent sort."
Computer Science: CUET Mock Test - 1 - Question 4

Which of the following statements are correct for Queue?

A. Queue is an ordered linear data structure

B. Deque can support both stack and queue operations

C. Queue is a non-linear data structure

D. Queue works on FILO principle

E. Deque is a version of Queue which does not allow insertion and deletion at both ends

Choose the correct answer from the options given below:

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 4

The correct answer is A and B only

Key Points

  • A. Queue is an ordered linear data structure (CORRECT)
    • Queues follow a specific order, adhering to the FIFO (First-In-First-Out) principle.
    • Elements are arranged linearly, one after the other.
  • B. Deque can support both stack and queue operations (CORRECT)
    • Deque (double-ended queue) allows insertion and deletion at both ends, making it flexible.
    • It can mimic stack behavior by performing operations at one designated end.
  • C. Queue is a non-linear data structure (INCORRECT)
    • As mentioned earlier, queues maintain a linear order of elements.
  • D. Queue works on FILO principle (INCORRECT)
    • Queues operate on FIFO, meaning the first element added is the first one removed.
    • FILO (First-In-Last-Out) describes stacks, where the last element added is accessed/removed first.
  • E. Deque is a version of Queue which does not allow insertion and deletion at both ends (INCORRECT)
    • The defining characteristic of a deque is its ability to perform operations at both ends, unlike a standard queue (insertion at rear, deletion from front).

Therefore, the correct answer is 2) A and B only.

Computer Science: CUET Mock Test - 1 - Question 5
The default reference point for file - object. seek(offset, [reference point]) is:
Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 5

The correct answer is 0

Key Points

  • file-object.seek(offset, [reference point]) is a method used to move the file pointer to a specific position within a file.
  • offset is the number of bytes to move the pointer.
  • reference point is an optional argument that specifies where to start the offset count. If omitted, it defaults to 0.

Values for reference point:

  • 0: Seeks from the beginning of the file.
  • 1: Seeks from the current position of the file pointer.
  • 2: Seeks from the end of the file.

Important Points

  • The default reference point of 0 makes it convenient for common scenarios where you want to start seeking from the beginning of the file.
  • Understanding the reference point options allows for precise control over file pointer positioning.
Computer Science: CUET Mock Test - 1 - Question 6

From a text file "myfile.txt", Kriti will read next line through file object Fl using

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 6

The correct answer is Fl.readline()

Key Points1) Fl.readlines()

  • It reads all lines of the file into a list of strings, not just the next line.
  • It's less efficient if you only need to read one line at a time, as it loads the entire file into memory.

3) Fl.readnext()

  • This method doesn't exist in most programming languages.

4) Fl.read()

  • It reads all the content of the file from the current position to the end as a single string.
  • It's not suitable for reading individual lines separately.

Fl.readline() is specifically designed to read the next line from a file object and return it as a string. It's the most efficient way to read lines sequentially and process them one at a time.

Example:

Important Points

  • Use with open(...) to ensure proper file closing.
  • Call Fl.readline() repeatedly to read lines one by one.
  • Check for empty strings to detect the end of the file.
Computer Science: CUET Mock Test - 1 - Question 7
When does the search for an appropriate exception handler occur in the process of exception handling?
Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 7

The correct answer is After an exception is raised but before it is executed.

Key PointsThe search for an appropriate exception handler occurs after an exception has been raised (signaling that an error has occurred and the exception object has been created) but before the specific code in the exception handler is executed. This step is crucial for determining the appropriate course of action to manage or address the error.

Computer Science: CUET Mock Test - 1 - Question 8
How can one define a unique delimiter, different from the standard comma, while utilizing pd.read_csv() to read a CSV file?
Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 8

The correct answer is ​pd.read_csv(file, delimiter='\t')

Key Points

  • The correct option for defining a unique delimiter other than the standard comma while using `pd.read_csv()` is: `pd.read_csv(file, delimiter='\t')`
  • In this option, the `delimiter` parameter is used to specify the delimiter, and `\t` represents the tab character, indicating that the data in the CSV file is tab-delimited.
Computer Science: CUET Mock Test - 1 - Question 9

What will be the output of the following Python code:

a = 1

if (a = 2):

print("value of a is", a)

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 9

The correct option is Syntax Error

CONCEPT:

Syntax errors occur when the programmer does not follow or makes mistake in the syntax of a particular programming language

Common syntax errors in python:

  • leaving out a keyword.
  • misspelling a keyword.
  • leaving out a symbol, such as a comma, brackets....etc.

In Python, assignment using `=` operator is not allowed inside an condition of if statement

The error thrown will be "SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '=' ".

Syntax of if statement in python:

if condition:

# code to execute in case if the above condition is true

Additional Information

IOError is raised when an input/output operation fails.

Computer Science: CUET Mock Test - 1 - Question 10
During transaction, the recovery manager must ensure:
Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 10

The correct answer is option 1.

Concept:

During the transaction, the recovery manager must ensure ACID rules.

ACID rules:

The abbreviation ACID stands for Atomicity, Consistency, Isolation, and Durability, which are the four fundamental criteria that constitute a transaction. An ACID transaction is a database operation that possesses certain ACID features, and data storage systems that use these operations are termed transactional systems. Each read, write, or update of a table is guaranteed by ACID transactions to have the following attributes.

Atomicity:

Atomicity is a database system characteristic that dictates that a transaction must be all-or-nothing. That is, the transaction must either take place in its entirety or not at all. It must not be only half completed.

Consistency:

In database systems, consistency refers to the condition that every given database transaction must only modify impacted data in the ways that are authorized.

Isolation:

A transaction is isolated from other transactions.

Durability:

Durability guarantees that changes to your data made by properly performed transactions are saved even if the system fails.

Hence the correct answer is ACID rules.

Computer Science: CUET Mock Test - 1 - Question 11

Match the following SQL functions to their descriptions.

Choose the correct answer from the options given below:

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 11

The correct answer is A - IV, B - II, C - III, D - I

Key Points

  • A-IV) length() - Returns the number of characters in a string.
  • B-II) lower() - Converts all characters in a string to lowercase.
  • C-III) concat() - Concatenates two or more strings into one string.
  • D-I) position() - Finds the position of a substring within a string.

Each function in SQL has a specific purpose regarding string manipulation.

  • length() is used to determine the length of a string, telling us how many characters it contains.
  • lower() is utilized to convert every character in a string to its lowercase variant, which is useful for case-insensitive comparisons.
  • concat() combines two or more strings into a single string, allowing for the construction of new strings from existing ones.
  • Lastly, position() is employed to find the starting position of a specified substring within another string, which can be crucial for substring analysis and manipulation.
Computer Science: CUET Mock Test - 1 - Question 12

What do we use to define a block of code in Python language?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 12

Python uses indentations to define blocks of code. Indentations are simply spaces or tabs used as an indicator that is part of the indent code child, as used in curly braces C, C++, and Java.

Computer Science: CUET Mock Test - 1 - Question 13

Referential integrity constraint in a relational database is specified with the help of a _________.

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 13

A foreign key is a field (or collection of fields) in one table, that refers to the primary key in another table. The table with the foreign key is called the child table, and the table with the primary key is called the referenced or parent table.

Computer Science: CUET Mock Test - 1 - Question 14

Which among the following SQL commands does not fall under the category of data manipulation language?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 14

CREATE command is a data definition language command but not a data manipulation command. Data manipulation command is used to manipulate the data of those tables that are created by Data definition languages.

Computer Science: CUET Mock Test - 1 - Question 15

Which of the following networking components is called a three-layer switch?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 15

This networking component is called a three-layer switch. It can operate at the physical, data link and network layers. A layer 3 switch combines the functionality of a switch and a router. It acts as a switch to connect devices that are on the same subnet or virtual LAN at lightning speeds and has IP routing intelligence built into it to double up as a router.

Computer Science: CUET Mock Test - 1 - Question 16

Which of the following operators cannot be used with string data type?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 16

Operator ''/'' can not be used with string data type.

Computer Science: CUET Mock Test - 1 - Question 17

To read the next line of the file from a file object infile, we use ____________.

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 17

The readlines() method returns a list containing each line in the file as a list item. The hint parameter is used to limit the number of lines returned. If the total number of bytes returned exceeds the specified number, no more lines are returned.

Computer Science: CUET Mock Test - 1 - Question 18

Which of the following is correctly evaluated for this function?
pow(x,y,z)

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 18

The built-in function pow() can accept two or three arguments. When it takes in two arguments, they are evaluated as x**y. When it takes in three arguments, they are evaluated as (x**y)%z.

Computer Science: CUET Mock Test - 1 - Question 19

Which of the following is false regarding the loops in Python?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 19

'While loop' is used when multiple statements are to be executed repeatedly until the given condition becomes false.
Python 'While loop' is used to execute a block of statements repeatedly until a given condition is satisfied. And when the condition becomes false, the line immediately after the loop in the program is executed. 'While loop' falls under the category of indefinite iteration.

Computer Science: CUET Mock Test - 1 - Question 20

Which of the following statements is true?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 20

Pickle in Python is primarily used in serializing and deserializing of a Python object structure. In other words, it's the process of converting a Python object into a byte stream to store it in a file/database, maintain program state across sessions, or transport data over the network.

Computer Science: CUET Mock Test - 1 - Question 21

Insertions take place at the rear end of the queue and deletions take place at the 'front' end of the queues. On which principal does this work?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 21

In linear queue, an insertion takes place from one end while the deletion occurs from another end. The end at which the insertion takes place is known as the rear end, and the end at which the deletion takes place is known as the front end.

Computer Science: CUET Mock Test - 1 - Question 22

What is the significance of the tell() method?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 22

The tell() method returns the current position of file object. This method takes no parameters and returns an integer value. Initially file pointer points to the beginning of the file (if not opened in append mode). So, the initial value of tell() is zero.

Computer Science: CUET Mock Test - 1 - Question 23

Computers manipulate data in many ways, this manipulation is called _____.

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 23

Processing is any computer program that is not a control program, such as an application program, or a non-controlling part of the operating system, such as a sort-merge program or language translator.

Computer Science: CUET Mock Test - 1 - Question 24

What are the two advantages of database management system?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 24

Data base security and integrity are two advantages of the data base management system. Central control also ensures that adapted checks are incorporated.

Computer Science: CUET Mock Test - 1 - Question 25

Which method is used to protect online images from hackers?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 25

A firewall is an essential piece of security software that monitors all incoming and outgoing traffic going through your network, checking for hackers, malware, unauthorized outgoing information, or anything that might put you or your PC at risk. Firewalls are often the first line of defense when protecting your data.

Computer Science: CUET Mock Test - 1 - Question 26

_________ switching is well suited for voice communication while _________switching is better suited for data and other non-voice communication.

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 26

In-circuit switching when the source does not have enough data to transmit, the resources are unnecessarily kept idle. To avoid such situation, Message switching is used.
Circuit Switching is a switching technique method that establishes a dedicated path between the sender and the receiver to send the data. The example of a Circuit-switch network is a telephone network.

Computer Science: CUET Mock Test - 1 - Question 27

Consider a declaration, L = (1, 'Python', '3.14').
Which of the following represents the data type of L?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 27

A tuple is almost like a List and contains python objects and objects inside are separated by comma (,) and enclosed within parentheses.
Example:
list1 = (6.25, 'brinjal', 'onion', 'beans')
list1 is a tuple.

Computer Science: CUET Mock Test - 1 - Question 28

Which of the following file modes is not valid?

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 28

File mode r+, w+, or a+ may be to perform both read and write operations using a single file object.

Computer Science: CUET Mock Test - 1 - Question 29

Radha Shah is a programmer, who has recently been given a task to write a python code to perform the following CSV file operations with the help of two user defined functions/modules:

a. CSVOpen() : to create a CSV file called BOOKS.CSV in append mode containing information of books – Title, Author, and Price.
b. CSVRead() : to display the records from the CSV file called BOOKS.CSV where the field title starts with 'R'.

She has succeeded in writing partial code and has missed out certain statements, so she has left certain queries in comment lines.
import csv
def CSVOpen():
with open('books.csv','______',newline='') as csvf:
#Statement-1
cw=______ #Statement-2
______ #Statement-3
cw.writerow(['Rapunzel','Jack',300])
cw.writerow(['Barbie','Doll',900])
cw.writerow(['Johnny','Jane',280])
def CSVRead():

Q. Choose the appropriate mode in which the file is to be opened in append mode (Statement 1).

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 29

Mode 'a' opens a file for appending. The file pointer is placed at the end of the file, if the file exists. If the file does not exist, it creates a new file for writing.

Computer Science: CUET Mock Test - 1 - Question 30

Radha Shah is a programmer, who has recently been given a task to write a python code to perform the following CSV file operations with the help of two user defined functions/modules:

a. CSVOpen() : to create a CSV file called BOOKS.CSV in append mode containing information of books – Title, Author, and Price.
b. CSVRead() : to display the records from the CSV file called BOOKS.CSV where the field title starts with 'R'.

She has succeeded in writing partial code and has missed out certain statements, so she has left certain queries in comment lines.
import csv
def CSVOpen():
with open('books.csv','______',newline='') as csvf:
#Statement-1
cw=______ #Statement-2
______ #Statement-3
cw.writerow(['Rapunzel','Jack',300])
cw.writerow(['Barbie','Doll',900])
cw.writerow(['Johnny','Jane',280])
def CSVRead():

Q. Choose the correct option for Statement 3 to write the names of the column headings in the CSV file, BOOKS.CSV.

Detailed Solution for Computer Science: CUET Mock Test - 1 - Question 30

Correct code for statement 3 is cw.writerow (['Title', 'Author', 'Price']) where, Title, Author and Price are the columns. writerow () method is used to write single row at a time.

View more questions
Information about Computer Science: CUET Mock Test - 1 Page
In this test you can find the Exam questions for Computer Science: CUET Mock Test - 1 solved & explained in the simplest way possible. Besides giving Questions and answers for Computer Science: CUET Mock Test - 1, EduRev gives you an ample number of Online tests for practice
Download as PDF