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

Computer Science: CUET Mock Test - 2 - CUET MCQ


Test Description

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

Computer Science: CUET Mock Test - 2 for CUET 2024 is part of CUET preparation. The Computer Science: CUET Mock Test - 2 questions and answers have been prepared according to the CUET exam syllabus.The Computer Science: CUET Mock Test - 2 MCQs are made for CUET 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Computer Science: CUET Mock Test - 2 below.
Solutions of Computer Science: CUET Mock Test - 2 questions in English are available as part of our course for CUET & Computer Science: CUET Mock Test - 2 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 - 2 | 40 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 - 2 - Question 1

Two statements are given below:
Statement I: A primary key in DBMS is a field that uniquely identifies each record in a table and can be Null.
Statement II: A foreign key in DBMS is a field that contains unique values and is used to link related tables together.

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

A primary key is a field or set of fields in a table that uniquely identifies each record in the table and cannot be Null. It is used to enforce data integrity and to ensure that there are no duplicate records in the table. A foreign key is a field in one table that refers to the primary key in another table. It is used to establish a relationship between two tables, and it ensures that data in one table is linked to data in another table.

Computer Science: CUET Mock Test - 2 - Question 2

Which of the following statements is/are correct for variable names in python language?

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

A variable can have a short name (like x and y) or a more descriptive name (age, carname, total_volume).

1 Crore+ students have signed up on EduRev. Have you? Download the App
Computer Science: CUET Mock Test - 2 - Question 3

Match List I and List II.

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

(A) MQTT is a lightweight, publish-subscribe protocol that is ideal for low-bandwidth, high-latency networks, making it well-suited for IoT devices that operate in remote areas with limited connectivity.
(B) CoAP is a lightweight protocol designed for constrained devices and low-power networks, making it well-suited for IoT devices that operate on battery power or have limited processing capabilities.
(C) HTTP is a popular protocol used for web-based communication, but it is not as well-suited for IoT devices due to its high overhead and lack of support for low-power networks.
(D) LoRaWAN is a long-range, low-power protocol designed for IoT devices that need to communicate over long distances, making it well-suited for applications like smart agriculture or asset tracking.

Computer Science: CUET Mock Test - 2 - Question 4

Which of the following provides a command for defining relation schema?

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

Data Definition Language: The SQL DDL provides commands for defining relation schemas, deleting relations, and modifying relation schemas.

Computer Science: CUET Mock Test - 2 - Question 5

In RDBMS, data is presented as a collection of ______.

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

In relational model, data is stored in relations (tables) and is represented in form of tuples (rows). RDBMS is used to manage relational database. Relational database is a collection of organized set of tables related to each other, and from which data can be accessed easily.

Computer Science: CUET Mock Test - 2 - Question 6

Structured Query Language (SQL) is used to

Detailed Solution for Computer Science: CUET Mock Test - 2 - Question 6
  • In a DBMS, the SQL database language is used to:
  • Create the database and table structures
  • Perform basic data management chores (add, delete and modify)
  • Perform complex queries to transform raw data into useful information
Computer Science: CUET Mock Test - 2 - Question 7

Directions: Match the contents under List I with those under List II.

Detailed Solution for Computer Science: CUET Mock Test - 2 - Question 7
  • A subquery is a query that is nested inside another query and is used to retrieve data to be used in the main query.
  • A 'Common Table Expression' (CTE) is a named temporary result set that can be used within a query. It is similar to a subquery but is declared separately and can be referenced multiple times within the same query.
  • A window function is a function that performs a calculation across a set of rows that are related to the current row. It is used to calculate values such as running totals or moving averages.
  • A materialized view is a physical copy of a query result that can be stored and queried later. It is used to improve performance by precomputing expensive queries.
Computer Science: CUET Mock Test - 2 - Question 8

Two statements are given below:
Statement I: Bubble Sort has a worst-case time complexity of O(n2), making it inefficient for large collections.
Statement II: Merge Sort has a worst-case time complexity of O(n log n), making it efficient for large collections.

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

Bubble sort is a simple sorting algorithm that compares adjacent elements and swaps them if they are in the wrong order. It has a worst-case time complexity of O(n2) for both comparisons and swaps, making it inefficient for large collections. Merge sort is a divide-and-conquer sorting algorithm that works by dividing the collection into smaller subcollections, sorting them recursively, and then merging the sorted subcollections to produce the final sorted collection. It has a worst-case time complexity of O(n log n) for both comparisons and swaps, making it efficient for large collections.

Computer Science: CUET Mock Test - 2 - Question 9

How many times can a loop in while(0) run?

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

while(0) - It is opposite of while(1). It means condition will always be false and ,thus, the code in 'while' will never get executed.

Computer Science: CUET Mock Test - 2 - Question 10

Python strings are also called the collection of:

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

Each character is encoded in the ASCII or Unicode character. So, we can say that Python strings are also called the collection of Unicode characters. In Python, strings can be created by enclosing the character or the sequence of characters in the quotes.

Computer Science: CUET Mock Test - 2 - Question 11

What is term used for when one tries to pop/delete an item from an empty stack?

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

Underflow occurs when the user performs a pop operation on an empty stack.

Computer Science: CUET Mock Test - 2 - Question 12

What is/are instance(s) of database?

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

Instance or extension or database state which is a collection of information stored in a database at a particular moment is called an instance of the database. Thus, it is a dynamic value which keeps on changing.

Computer Science: CUET Mock Test - 2 - Question 13

Match List I and List II.

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

(A) World Wide Web (WWW) - It is a system of interlinked hypertext documents that are accessed via the Internet. Documents and downloadable media are made available to the network through web servers and can be accessed by programs such as web browsers.
(B) Internet - The Internet, sometimes called simply "the Net," is a worldwide system of computer networks. It is a network of networks in which users at any one computer can, if they have permission, get information from any other computer. Hence, it is a global network of interconnected computers and other devices that use standardized communication protocols.
(C) Cloud Computing - It is a model for delivering on-demand access to shared computing resources over the Internet. It is the delivery of computing services—including servers, storage, databases, networking, software, analytics, and intelligence—over the internet to offer faster innovation and flexible resources.
(D) Machine-to-Machine (M2M) - It is technology that enables direct communication between IoT devices, without the need for human intervention. The main purpose of M2M technology is to tap into sensor data and transmit it to a network.

Computer Science: CUET Mock Test - 2 - Question 14

Directions: Match the contents under List I with those under List II.

Detailed Solution for Computer Science: CUET Mock Test - 2 - Question 14
  • Linear Search has a worst-case time complexity of O(n), where n is the size of the input data.
  • Binary Search has a worst-case time complexity of O(log n), where n is the size of the input data.
  • Interpolation Search has a worst-case time complexity of O(n log n), which is less efficient than O(log n) algorithms like Binary Search.
  • The worst-case running time of Depth-First Search (DFS) depends on the graph being traversed. In a graph with n nodes and m edges, the time complexity of DFS is O(n+m), which means that the running time increases linearly with the number of nodes and edges in the graph.
Computer Science: CUET Mock Test - 2 - Question 15

What is the output of following code:
T = (100)
print(T*2)

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

We can use * operator to repeat the tuple values n number of times.
For example:
("abc",)*3 will return ('abc', 'abc', 'abc').

Computer Science: CUET Mock Test - 2 - Question 16

Rohit, a student of class 12th, is learning CSV File Module in Python. During examination, he has been assigned an incomplete python code (shown below) to create a CSV File 'Student.csv' (content shown below). Help him in completing the code which creates the desired CSV File.

CSV File
1, AKSHAY,XII,A
2, ABHISHEK,XII,A
3, ARVIND,XII,A
4, RAVI,XII,A
5, ASHISH,XII,A

Incomplete Code
import_____ #Statement-1
fh = open(_____, _____, newline='') #Statement-2
stuwriter = csv._____ #Statement-3
data = []
header = ['ROLL_NO', 'NAME', 'CLASS', 'SECTION']
data.append(header)
for i in range(5):
roll_no = int(input("Enter Roll Number : "))
name = input("Enter Name : ")
Class = input("Enter Class : ")
section = input("Enter Section : ") rec = [_____] #Statement-4
data.append(rec)
stuwriter. _____ (data)
#Statement-5

fh.close()

Q. Identify the suitable code for blank space in line marked as Statement-1.

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

csv is the correct code to fill up the blank in Statement 1, which is to be imported.

Computer Science: CUET Mock Test - 2 - Question 17

Rohit, a student of class 12th, is learning CSV File Module in Python. During examination, he has been assigned an incomplete python code (shown below) to create a CSV File 'Student.csv' (content shown below). Help him in completing the code which creates the desired CSV File.

CSV File
1, AKSHAY,XII,A
2, ABHISHEK,XII,A
3, ARVIND,XII,A
4, RAVI,XII,A
5, ASHISH,XII,A

Incomplete Code
import_____ #Statement-1
fh = open(_____, _____, newline='') #Statement-2
stuwriter = csv._____ #Statement-3
data = []
header = ['ROLL_NO', 'NAME', 'CLASS', 'SECTION']
data.append(header)
for i in range(5):
roll_no = int(input("Enter Roll Number : "))
name = input("Enter Name : ")
Class = input("Enter Class : ")
section = input("Enter Section : ") rec = [_____] #Statement-4
data.append(rec)
stuwriter. _____ (data)
#Statement-5

fh.close()

Q. Choose the function name (with argument) that should be used in the blank space of line marked as Statement-3

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

writer(fh) should be used in blank space in Statement 3. csv. writer is used to insert data to the CSV file.

Computer Science: CUET Mock Test - 2 - Question 18

Rohit, a student of class 12th, is learning CSV File Module in Python. During examination, he has been assigned an incomplete python code (shown below) to create a CSV File 'Student.csv' (content shown below). Help him in completing the code which creates the desired CSV File.

CSV File
1, AKSHAY,XII,A
2, ABHISHEK,XII,A
3, ARVIND,XII,A
4, RAVI,XII,A
5, ASHISH,XII,A

Incomplete Code
import_____ #Statement-1
fh = open(_____, _____, newline='') #Statement-2
stuwriter = csv._____ #Statement-3
data = []
header = ['ROLL_NO', 'NAME', 'CLASS', 'SECTION']
data.append(header)
for i in range(5):
roll_no = int(input("Enter Roll Number : "))
name = input("Enter Name : ")
Class = input("Enter Class : ")
section = input("Enter Section : ") rec = [_____] #Statement-4
data.append(rec)
stuwriter. _____ (data)
#Statement-5

fh.close()

Q. Choose the function name that should be used in the blank space of line marked as Statement-5 to create the desired CSV File?

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

writerows() should be used in blank space in Statement 5.
writerows() function writes each sequence in a list as a comma separated line of items in the file.

Computer Science: CUET Mock Test - 2 - Question 19

Rohit, a student of class 12th, is learning CSV File Module in Python. During examination, he has been assigned an incomplete python code (shown below) to create a CSV File 'Student.csv' (content shown below). Help him in completing the code which creates the desired CSV File.

CSV File
1, AKSHAY,XII,A
2, ABHISHEK,XII,A
3, ARVIND,XII,A
4, RAVI,XII,A
5, ASHISH,XII,A

Incomplete Code
import_____ #Statement-1
fh = open(_____, _____, newline='') #Statement-2
stuwriter = csv._____ #Statement-3
data = []
header = ['ROLL_NO', 'NAME', 'CLASS', 'SECTION']
data.append(header)
for i in range(5):
roll_no = int(input("Enter Roll Number : "))
name = input("Enter Name : ")
Class = input("Enter Class : ")
section = input("Enter Section : ") rec = [_____] #Statement-4
data.append(rec)
stuwriter. _____ (data)
#Statement-5

fh.close()

Q. Identify the missing code for blank space in line marked as Statement-2?

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

This code opens a file student.csv in write mode becasue append( ) method is using.
So, correct misssing code is "Student.csv", "w"

Computer Science: CUET Mock Test - 2 - Question 20

Rohit, a student of class 12th, is learning CSV File Module in Python. During examination, he has been assigned an incomplete python code (shown below) to create a CSV File 'Student.csv' (content shown below). Help him in completing the code which creates the desired CSV File.

CSV File
1, AKSHAY,XII,A
2, ABHISHEK,XII,A
3, ARVIND,XII,A
4, RAVI,XII,A
5, ASHISH,XII,A

Incomplete Code
import_____ #Statement-1
fh = open(_____, _____, newline='') #Statement-2
stuwriter = csv._____ #Statement-3
data = []
header = ['ROLL_NO', 'NAME', 'CLASS', 'SECTION']
data.append(header)
for i in range(5):
roll_no = int(input("Enter Roll Number : "))
name = input("Enter Name : ")
Class = input("Enter Class : ")
section = input("Enter Section : ") rec = [_____] #Statement-4
data.append(rec)
stuwriter. _____ (data)
#Statement-5

fh.close()

Q. Identify the suitable code for blank space in line marked as Statement-4.

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

Suitable code for blank space in Statement 4 is roll_no, name, class, section.

Computer Science: CUET Mock Test - 2 - Question 21

Consider the following relation.
Table: Customers(C_id, C_name, C_age, C_Country)
What is the output for the given SQL Query?
Query:
ALTER TABLE Customers
ADD income INT;
What is the degree of the customer relationship?

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

The correct answer is option B.

Concept:
Add an attribute to an existing table:

Sometimes, we may need to add an additional attribute to a table. It can be done using the syntax given below:

Syntax:
ALTER TABLE table_name ADD attribute_name DATATYPE;

DEGREE:
The number of attributes in a relation is called the Degree of the relation.

Explanation:
The customer relation adds a new attribute to the customer relationship. Now the Customers relation becomes the Customers(C_id, C_name, C_age, C_Country, income)

Query:
ALTER TABLE Customers
ADD income INT;
Hence the degree of the relation becomes 5.
Hence the correct answer is 5.

Computer Science: CUET Mock Test - 2 - Question 22

What is ISP in computer networks?

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

The correct answer is option A.
Concept:
ISP:

An ISP (internet service provider) is a company that provides individuals and organizations access to the internet and other related services.

  • An ISP is also sometimes referred to as an internet access provider.
  • An ISP has the equipment and the telecommunication line access required to have a point of presence on the internet for the geographic area served.
  • ISPs may also provide different internet connection types, such as cable and fiber.
  • Customers may access the internet through ISPs, who also offer other services like email, domain registration, and web hosting.

Hence the correct answer is an Internet service provider.

Computer Science: CUET Mock Test - 2 - Question 23

Which kind of data has been that is not arranged according to a pre-set data model or schema?

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

The correct answer is option B.

Concept:
Data come from different sources, they can be in different formats.

Unstructured Data:
Unstructured data is information that is not arranged according to a pre-set data model or schema, and therefore cannot be stored in a traditional relational database or RDBMS. Text and multimedia are two common types of unstructured content.

Example:
A newspaper contains a variety of news pieces, often known as data. However, a newspaper's placement of news pieces follows no set pattern. On any given day, a page may have three photos of various sizes, five news articles, and one or more adverts. On another day, one large image with three written news pieces may be displayed.

Structured Data:
Data that is organized and can be recorded in a well-defined format is called structured data. Structured data is often kept in a tabular (rows and columns) format on a computer, with each column representing distinct data for a specific parameter called an attribute, characteristic, or variable, and each row representing data from observation for several attributes.

Example:
Data related to an inventory of kitchen items maintained by a shop.

Hence the correct answer is Unstructured Data.

Computer Science: CUET Mock Test - 2 - Question 24

Statement 1: A program cannot be executed until all errors are rectified.
Statement 2: A program cannot be executed until all exceptions are handled.

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

Explanation:

  • In Python, mistakes in the syntax are known as errors. Unless and until the errors are rectified, the program cannot be compiled and executed.
  • Exceptions are those errors which terminate the program abnormally. However, exceptions can only be encountered at runtime. So, a program with exceptions can be executed.

Important Point:

  • Even though a syntax error is a type of exception, but it is different from other exceptions because a program with syntax error cannot be executed.
Computer Science: CUET Mock Test - 2 - Question 25

Consider a list where we have to search for 2 different values using hashing. One of the numbers, ‘a’ is present at index = 3, and the other one, ‘b’ is present at index = 7. How many comparisons will have to be made to search for ‘a’ and ‘b’?

Detailed Solution for Computer Science: CUET Mock Test - 2 - Question 25
  • Searching a value at any position in the list, using hashing method, takes exactly one comparison.
  • In hashing method, a hash function is used to arrange the elements of the list according to the index value. A modulus by 10 function is used to determine which element should be placed at which location.
  • The hash function is applied on the target element to find out it’s possible index location. By simply checking the index position, we can conclude whether is element is present or not in the list.
Computer Science: CUET Mock Test - 2 - Question 26

Which of the following is not a digital storage device?

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

The correct answer is option D.
Concept:
Data Storage:

Data storage is the process of storing data on storage devices so that data can be retrieved later. Large amounts of data are being created at an alarming rate these days. As a result, storing data has become a difficult undertaking. However, as the cost of digital storage devices has decreased, this work has become easier.
There are numerous digital storage devices available in the market like,

  • Hard Disk Drive (HDD),
  • Solid State Drive (SSD),
  • CD/DVD,
  • Tape Drive,
  • Pen Drive,
  • Memory Card, etc.

Hence the correct answer is None of the above.

Computer Science: CUET Mock Test - 2 - Question 27

In which case is the NameError exception raised in Python?

Detailed Solution for Computer Science: CUET Mock Test - 2 - Question 27
  • When a requested module definition is not found, the ImportError exception is raised.
  • When a keyword or a reserved word is used as a variable name, it leads to a syntax error.
  • When a statement accessed a variable that is not found in the local or global scope, then the program raises a NameError.
  • When a specified file cannot be opened by a program, it causes an exception of IOError type.
Computer Science: CUET Mock Test - 2 - Question 28

Consider the list of data [56, 80, 39, 41, 29, 61] and the hash function h[i] = i % 7 where i is each element of the list. What will be the index value of the element 39?

Detailed Solution for Computer Science: CUET Mock Test - 2 - Question 28
  • The hash function is modulo 7. This means, that each element is divided by 7 and the number is positioned at the index equal to the remainder.
  • 39 % 7 = 4 and so the element is located at index position 4.
Computer Science: CUET Mock Test - 2 - Question 29

What will be the output of the following code?

myobject=open("myfile.txt",'r')
myobject.readline(10)
myobject.close()

Detailed Solution for Computer Science: CUET Mock Test - 2 - Question 29
  • The readline() function reads the first line until a newline character is found.
  • If an argument is passed to the function, it reads that many characters, but stops when a newline character is encountered.
  • The function can only read the first line.

Important Point:

Even if the value passed to the function exceeds the number of characters till the newline character, the control does not move on to the next line.

Computer Science: CUET Mock Test - 2 - Question 30

Consider a list of 10 elements:
Array = [7, 11, 3, 10, 17, 23, 1, 4, 21, 5]
Determine the partially sorted list after three complete passes of insertion sort, in descending order.

Detailed Solution for Computer Science: CUET Mock Test - 2 - Question 30
  • In insertion sort, the first element is considered as the sorted list, and the remaining list is the unsorted part.
  • At each iteration, the first element of the unsorted list is placed into the appropriate position in the sorted list. The checking is done backwards in the sorted list.
  • In the first pass over this list, the element 11 is greater than 7 so it is moved to the left of 7 as the sorting is being done in descending order.
  • The second passes places the value 3 into the sorted list. It remains where it is because 3 is already to the right of 7.
  • In the third pass, 10 is placed between 11 and 7.
View more questions
Information about Computer Science: CUET Mock Test - 2 Page
In this test you can find the Exam questions for Computer Science: CUET Mock Test - 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Computer Science: CUET Mock Test - 2, EduRev gives you an ample number of Online tests for practice

Top Courses for CUET

Download as PDF

Top Courses for CUET