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

Computer Science: CUET Mock Test - 10 - CUET MCQ


Test Description

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

Computer Science: CUET Mock Test - 10 for CUET 2024 is part of CUET preparation. The Computer Science: CUET Mock Test - 10 questions and answers have been prepared according to the CUET exam syllabus.The Computer Science: CUET Mock Test - 10 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 - 10 below.
Solutions of Computer Science: CUET Mock Test - 10 questions in English are available as part of our course for CUET & Computer Science: CUET Mock Test - 10 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 - 10 | 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 - 10 - Question 1

Which of the following is not a keyword in python language?

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

'val' is not a keyword in python language. All the other options are correct keywords used in python language.

Computer Science: CUET Mock Test - 10 - Question 2

Earlier version of SQL name is:

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

SEQUEL later became SQL (still pronounced "sequel"). In 1979, Relational Software, Inc. (now Oracle) introduced the first commercially available implementation of SQL. Today, SQL is accepted as the standard RDBMS language.

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

Which of the following is the correct way to call a function?

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

The correct way to call a function is my_func().

Computer Science: CUET Mock Test - 10 - Question 4

What is the syntax to work with the database?

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

USE DatabaseName;
The database name should always be unique within the RDBMS.

Computer Science: CUET Mock Test - 10 - Question 5

Which of the following components is/are part(s) of a function header in python?

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

Function Name and Parameter List are parts of a function header in python.

Computer Science: CUET Mock Test - 10 - Question 6

What is the global system of interconnected computer networks called?

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

Internet is a global system because it interconnects the networks worldwide.

Computer Science: CUET Mock Test - 10 - Question 7

Syntax of the seek function in python is myfile.seek(offset, reference_point) where myfile is the file object. What is the default value of reference_point?

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

Python file method seek() sets the file's current position at the offset. The whence argument is optional and defaults to 0, which means absolute file positioning; other values are 1, which means seek relative to the current position, and 2, which means seek relative to the file's end. There is no return value.

Computer Science: CUET Mock Test - 10 - Question 8

Read the statements given below and choose the correct answer:

Statement A: It is very difficult to organize unstructured data.
Statement B: CSV helps into organize a huge amount of data in a proper and systematic way.

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

Unstructured data offers more flexibility and scalability. The absence of the pre-defined purpose of unstructured data makes it super flexible as the information can be stored in various file formats. Yet, this data is subjective and more difficult to work with. CSV helps into organize a huge amount of data in a proper and systematic way.

Computer Science: CUET Mock Test - 10 - Question 9

Two statements are given below:

Statement I: The order of items in the output of the map() method in Python is same as the order in the input iterable.
Statement II: The order of items in the output of the map() method in Python is sorted in ascending order.

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

The map() method in Python preserves the order of items in the input iterable, and applies the given function to each item in that order. Therefore, the order of items in the output of the map() method is the same as the order in the input iterable. The order of items in the output of the map() method in Python is not sorted in ascending order.

Computer Science: CUET Mock Test - 10 - Question 10

Stack is a ___________ data structure.

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

Stacks are dynamic data structures that follow the Last In First Out (LIFO) principle. The last item to be inserted into a stack is the first one to be deleted from it.

Computer Science: CUET Mock Test - 10 - Question 11

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

Detailed Solution for Computer Science: CUET Mock Test - 10 - Question 11
  • Border Gateway Protocol (BGP) is a protocol used for exchanging routing information between different autonomous systems on the Internet. Multiprotocol Label Switching (MPLS) is a protocol used for forwarding network packets based on labels. It is used to improve the speed and efficiency of network traffic.
  • Internet Protocol Security (IPsec) is a protocol used for securing Internet Protocol (IP) communications. It provides confidentiality, integrity, and authentication services for IP packets.
  • Dynamic Host Configuration Protocol (DHCP) is a protocol used for assigning IP addresses to devices on a network. It allows devices to automatically obtain IP addresses and other network configuration information.
Computer Science: CUET Mock Test - 10 - Question 12

In a relational schema, each tuple is divided into fields called

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

Each tuple is divided into fields called domains in relational schema.

Computer Science: CUET Mock Test - 10 - Question 13

Antivirus software is an example of _____.

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

Antivirus software is a type of security software designed to protect users from multiple types of malware, not just viruses.

Computer Science: CUET Mock Test - 10 - Question 14

A ________ computer is a large and expensive computer capable of simultaneously processing data for hundreds or thousands of-users.

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

A mainframe computer is a large and expensive computer capable of simultaneously processing data for hundreds or thousands of users. Mainframe computers (colloquially referred to as "big iron") are computers used primarily by large organizations for critical applications, bulk data processing, such as census, industry and consumer statistics, enterprise resource planning, and transaction processing.

Computer Science: CUET Mock Test - 10 - Question 15

Assume that the position of the file pointer is at the beginning of 3rd line in a text file. Which of the following option can be used to read all the remaining lines?

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

The myfile.readlines() function is used to read the entire files.
To get all the information in a file, readlines() is used. It returns the entire information in the file. The radlines() function gives all data in the file as a collection of strings. When using the readlines() function, all the data in the file is read and it will not be stopped until the entire file ends.

Computer Science: CUET Mock Test - 10 - Question 16

Match List I and List II.

Detailed Solution for Computer Science: CUET Mock Test - 10 - Question 16
  • Seek() is a built-in Python method that is used to change the position of the file pointer. It takes two arguments: the offset and the origin. The offset specifies the number of bytes to move, and the origin specifies the reference position from where the offset is to be measured.
  • Tell() is a built-in Python method that is used to get the current position of the file pointer. It returns the current position of the file pointer in bytes.
  • Truncate() is a built-in Python method that is used to resize a file to a specified size. If the specified size is smaller than the original size of the file, the file will be truncated to the specified size. If the specified size is larger than the original size of the file, the file will be extended to the specified size, and the extended portion will be filled with null bytes.
  • Binary mode is a file mode used to open a file in binary format. When a file is opened in binary mode, the data is read or written as a sequence of bytes, and no translation is performed on the data. Binary mode is denoted by "b" in the file mode.
Computer Science: CUET Mock Test - 10 - Question 17

Which of the following items are present in the function header?

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

Function header consists of function name & parameter list.

Computer Science: CUET Mock Test - 10 - Question 18

Given Tuple: tup1= (10, 20, 30, 40, 50, 60, 70, 80, 90)
What will be the output of print (tup1 [3:7:2])?

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

The output will be (40,60).
In tuples, indexing starts with 0. Therefore on third index, the element will be 40.
Similarly, the element on the seventh index will be 80, but it will not be included as the end value is not included in slicing.
2 represents the iteration gap or steps. Therefore, only 2nd place numbers from start will be printed between the range 40 and 70, i.e. 40 and 60.

Computer Science: CUET Mock Test - 10 - Question 19

Identify the output of the following Python statements.

x = [[10.0, 11.0, 12.0],[13.0, 14.0, 15.0]]
y = x[1][2] print(y)

Detailed Solution for Computer Science: CUET Mock Test - 10 - Question 19
  • Given is a list inside list (called nested lists), so when we assign values to y we are linking an element to it.
  • So, x[1] will select second nested list because in python, the counting starts from 0,1,2... and so on.
  • So, if you want to show 1st value, you have to write 0.
  • Now, after selecting second nested list, we also have to write [2] after x[2], so this will select the third element of the nested list which is 15.0 and, hence, the answer is 15.0
Computer Science: CUET Mock Test - 10 - Question 20

Which of the following statements is true?

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

Pickle in Python is primarily used in serializing and deserializing 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 - 10 - Question 21

Which of the following operation easily performed by using a single stack?

Operation 1: ​Job Scheduling
Operation 2: Reversing the elements

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

Concept:
Stack:

 A stack is a linear data structure that operates on the Last In First Out principle (LIFO). This signifies that the last thing added to the stack gets deleted first.

Operation 1: ​Job Scheduling
Job scheduling is can not be performed by using a single stack. In Job scheduling, all process follows the first come first served so this operation have to follow by the queue data structure.
Hence it can not be performed by the stack.

Operation 2: reversing the elements
A stack is first in first out, it has two main operations push and pop. Push inserts data into it and pop retrieves data from it. To reverse an element using stack initially push all elements into the stack using the push() method then, retrieve them back using the pop() all the elements. It prints in reverse the elements.
Hence it can be performed by the stack.

Hence the correct answer is only operation 2.

Computer Science: CUET Mock Test - 10 - Question 22

Consider the following program.

def sample():

    stack = []
    return stack

What does the sample function return?

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

Concept:
The python program is,
def sample():
    stack = []
    return stack
Explanation:
Here sample function creates the stack and returns the element. It has two operations push and pop elements. Every time we can access the topmost element of the stack. Hence the given function for creating a stack.
Hence the correct answer is Creating a stack.

Computer Science: CUET Mock Test - 10 - Question 23

Consider the following infix expression. what is the prefix expression for a given infix expression?

Infix: ((8+9)*(7-6))

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

Concept:
Infix:

An infix expression prints the operand 1, operator, and operand 2 respectively.

Prefix:
A Prefix expression prints the operator operand 1, and operand 2 respectively.
The given data,

Infix: ((8+9)*(7-6))
Here the highest priority is () compared to +, -, and *. and
Operand 1=8 
Operand 2=9
Operator = +
The expression is, (+89 * (7-6))
Operand 1=7
Operand 2=6
Operator = -
The expression is, (+89 * -76 )
Operand 1=+89
Operand 2=-76
Operator = *
The expression is, * + 8 9 - 7 6
Hence the correct answer is * + 8 9 - 7 6.

Computer Science: CUET Mock Test - 10 - Question 24

Which of the following data structure is suitable for checking Valid Parentheses?

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

Concept:

The Stack data structure is suitable for checking valid parentheses. 

  • All of the parentheses are matched, which means that each starting parenthesis has a matching closing parenthesis.
  • The matching parentheses are in the proper order, with the opening parenthesis preceding the closing parenthesis.

{{}}()[()] ----> The parentheses are valid.

{ ] [ }  -------> The parentheses are invalid.​

Algorithm:

  • Create an empty stack.
  • Push an opening parenthesis on top of the stack.
  • In case of a closing bracket, check if the stack is empty.
  • If not, pop in a closing parenthesis if the top of the stack contains the corresponding opening parenthesis.
  • If the parentheses are valid,​ then the stack will be empty once the input string finishes.

Explanation:
And the remaining queue, tree, and list are not suitable for checking valid parentheses because they have no restriction on incoming and outgoing elements. Hence we can not match.
Hence the correct answer is stack.

Computer Science: CUET Mock Test - 10 - Question 25

Consider the following program. 

Here stack parameter is an empty stack and the item is an element.

def sample(stack, item):
    stack.append(item)

What does the sample function do?

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

The correct answer is option C.

Concept:
The given python program is,
def sample(stack, item):
    stack.append(item)
Here stack parameter is an empty stack and the item is an element.

Explanation:​
The append() method in python adds a single item to the existing list. It doesn't return a new list of items but will modify the original list by adding the item to the end of the list. After executing the method append on the list the size of the list increases by one.
Hence the given sample program adds the elements to the stack.
Hence the correct answer is adding the elements to the stack.

Computer Science: CUET Mock Test - 10 - Question 26

Consider the following program. Here glass stack is an empty stack.

def check(glassStack):
 if len(glassStack)==0:
      return True
 else:
    return False

What does the check function return? 

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

Concept:
The python program is,
def check(glassStack):
 if len(glassStack)==0:
      return True
 else:
    return False
The given data, 
Consider a glassstack as an empty stack.

Explanation:
The if blocks check the length of the stack is equal to zero or not. If there are no elements it returns the true. else it returns the false. A function named check( ) to check whether the stack glassStack is empty or not. Remember trying to remove an element from an empty stack would result in ‘underflow’. This function returns True if the stack is empty, else returns False.

Hence the correct answer is check whether the stack glassStack is empty or not.

Computer Science: CUET Mock Test - 10 - Question 27

Consider the input sequence a, b, c, d.

Minimum number of operations(push or pop) required to get stack permutation for sequence b, d, c, a?

Hint:

A stack permutation is a permutation of items in the supplied input queue that is accomplished by transferring elements from the input queue to the output queue using a stack and the built-in push and pop operations.

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

Concept:
stack permutation:

A stack permutation is a permutation of items in the supplied input queue that is accomplished by transferring elements from the input queue to the output queue using a stack and the built-in push and pop operations.
input: a, b, c, d
Output: b, d, c, a
push a
push b
pop ----------> pop the topmost element i.e b
push c 
push d
pop -----------> pop the topmost element i.e d
pop ----------> pop the topmost element i.e c
pop ----------> pop the topmost element i.e a
Hence the given sequence is the proper sequence.
The minimum number of operations are 8, these are essential to get a proper sequence.
Hence the correct answer is 8.

Computer Science: CUET Mock Test - 10 - Question 28

Example 1:

Consider array has 4 elements and a searching element 16.

A[4]= {10, 16, 22, 25} 

The number of iterations are required to search an element by using a binary search= T1

Example 2:

Consider array has 4 elements and a searching element 22.

A[4]= {10, 16, 22, 25} 
The number of iterations are required to search an element by using a binary search= T2

Note: Searching is successful.

Which of the following statement are true?

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

Concept:
Binary Search:

A Binary Search is a sorting method used to find a specific member in a sorted array. Because binary search works only on sorted arrays, an array must be sorted before using binary search on it. As the number of iterations in the binary search reduces, it is a superior searching approach to the liner search technique.

Algorithm:
int binarySearch(int a[], int beg, int end, int K)    
{    
    int mid;    
    if(end >= beg)     
    {   mid = (beg + end)/2;    
        if(a[mid] == K)                 
            return mid+1;    
        else if(a[mid] < K) 
            return binarySearch(a, mid+1, end, K);      
        else   
            return binarySearch(a, beg, mid-1, K);            
    }    
    return -1;     
}   

Example 1:
The given data,
A[4]= {10, 16, 22, 25} 
Searching element= K= 16
beg= 0
end = 3
mid = 3/2 = 1
 if K with A[mid] and search is successful. 
Hence the number iterations are =1.

Example 2:
The given data,
A[4]= {10, 16, 22, 25} 
Searching element= K= 22
beg= 0
end = 3
mid = 3/2 = 1.
Compare 22 with A[1] is not found and K is greater than A[mid]. So  call binarySearch(a, 1+1, 3, 2); 
beg= 2
end = 3
mid = 5/2 = 2.
Compare 22 with A[2] is found.
Hence the number of iterations is = 2
Hence the correct answer is T1 < T2.

Computer Science: CUET Mock Test - 10 - Question 29

Which statement is generally used in the beginning of the function or after a function call to check for valid input?

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

Concept:
Exception:

An exception is an occurrence that happens during program execution that disturbs the regular flow of the program's instructions. When a Python script finds a condition that it cannot handle, it throws an exception. A Python object that reflects an error is known as an exception.

  • Exception Handlers are programs that are designed to run when a specific exception is thrown.
  • Raising an exception involves stopping the usual flow of program execution and navigating to the exception handler. 
  • Raise and assert statements are used to raise exceptions.
  • Raise is often utilized when an erroneous condition has been recognized or when a condition does not fulfilled. Similar to assert, however, the exception is only triggered if a condition is fulfilled.

​Assert:

  • The assert statement is generally used at the beginning of the function or after a function call to check for valid input.
  • The assert statement accepts an expression as well as an optional message.
  • The assert statement is used to validate the types, values of arguments, and function output.
  • The assert statement is used as a debugging tool since it stops the application when an error occurs.

Syntax:
assert <condition>
assert <condition>,<error message>

Raise:
While they try and except blocks are for handling exceptions, the raise keyword on the contrary is to raise an exception.

Syntax:
raise  {name_of_ the_ exception_class}

Hence the correct answer is assert.

Computer Science: CUET Mock Test - 10 - Question 30

Which of the following is true about binary search?

Statement 1: The pre-condition for the binary search is that the elements must be arranged in sorted order.
Statement 2: Binary search is based on the divide and conquers approach.

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

Concept:
Binary Search:

A Binary Search is a sorting method used to find a specific member in a sorted array. Because binary search works only on sorted arrays, an array must be sorted before using binary search on it. As the number of iterations in the binary search reduces, it is a superior searching approach to the liner search technique.

Statement 1: The pre-condition for the binary search is that the elements must be arranged in sorted order.
True, The precondition for binary search is that the array should be sorted. If the data is not sorted, we can't apply binary search on that array. 

Statement 2: Binary search is based on the divide and conquers approach.
True, The Binary Search algorithm is a divide and conquer algorithm. 
In binary search, we divide (reduce) the array of numbers (search space), conquer the sub-problems by recursively looking at the center point for our target, and divide till we find our target the base case condition on a sorted array of numbers.

Hence the correct answer is Both statement 1 and statement 2.

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

Top Courses for CUET

Download as PDF

Top Courses for CUET