Quiz Space

January 2023 term · Computational Thinking · BSCS1001

Computational Thinking Quiz 2: 2 April 2023, Set 1 (January 2023 term)

The IIT Madras BS Computational Thinking (Computational Thinking (CT)) Quiz 2 paper sat on 2 Apr 2023, in the January 2023 term, set 1: 18 questions for 54 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
18
Marks
54
Duration
120 min
MCQ
11
MSQ
3
Written
4

Updated

Official paper: IIT M FOUNDATION AN4 EXAM QPF4 02 Apr 2023 · No negative marking.

Question 1

+1 markOne correct option

THIS IS QUESTION PAPER FOR THE SUBJECT "FOUNDATION LEVEL : SEMESTER 1: COMPUTATIONAL THINKING" ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT? CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN. (IF IT IS NOT THE CORRECT SUBJECT ,PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)

  1. A

    YES

  2. B

    NO

Show answer

Correct answer

  • A

    YES

Question 2

+1 markOne correct option
Figure from the original question paper
Figure from the original question paper
  1. A

    Useful Data has been mentioned above.

  2. B

    This data attachment is just for a reference & not for an evaluation.

Show answer

Correct answer

  • A

    Useful Data has been mentioned above.

Question 3

+2 marksOne correct option

Let Y be a card in the "Shopping Bills" dataset. Consider the following procedure.

Let Y be a card in the "Shopping Bills" dataset. Consider the following procedure. What will findSomething(X) return where X represents the card given below.

Let Y be a card in the "Shopping Bills" dataset. Consider the following procedure. What will findSomething(X) return where X represents the card given below.

Let Y be a card in the "Shopping Bills" dataset. Consider the following procedure.
Let Y be a card in the "Shopping Bills" dataset. Consider the following procedure.
  1. A

    "None"

  2. B

    "Toiletries"

  3. C

    "Packed/Food"

  4. D

    "Dairy/Food"

Show answer

Correct answer

  • B

    "Toiletries"

Question 4

+2 marksOne correct option

Consider the following pseudocode. At the end of the execution of the following pseudocode, if flag has valueTrue, then choose the possible value of L from the given choices.

Consider the following pseudocode. At the end of the execution of the following pseudocode, if flag has valueTrue, then choose the possible value of L from the given choices.

Consider the following pseudocode. At the end of the execution of the following pseudocode, if flag has valueTrue, then
  1. A

    ['z', 'y']

  2. B

    ['y', 'x', 'z']

  3. C

    ['y']

  4. D

    ['z', 'x', 'y']

Show answer

Correct answer

  • A

    ['z', 'y']

Question 5

+3 marksOne correct option

Consider the following procedure, where L1 and L2 are two non-empty lists.

Consider the following procedure, where L1 and L2 are two non-empty lists. findSomething(L1, L2) will return True when

Consider the following procedure, where L1 and L2 are two non-empty lists.
  1. A

    all the elements of both lists L1 and L2 are same but arranged in the reverseorder.

  2. B

    both lists L1 and L2 are same.

  3. C

    all the elements of list L1 are present in L2 where length(L2) > length(L1).

  4. D

    all the elements of list L2 are present in L1 where length(L1) > length(L2).

Show answer

Correct answer

  • A

    all the elements of both lists L1 and L2 are same but arranged in the reverseorder.

Question 6

+4 marksOne correct option

The following pseudocode is executed using the "Words" dataset and explode(W) returns the list of letters in the word W. For example explode(''common") will return ['c', 'o', 'm', 'm', 'o', 'n']. At the end of the execution, count stores the number of words with at least two consecutive occurrences of the same letter. Choose the correct code fragment to complete the pseudocode.

The following pseudocode is executed using the "Words" dataset and explode(W) returns the list of letters in the word W. For example explode(''common") will return ['c', 'o', 'm', 'm', 'o', 'n']. At the end of the execution, count stores the number of words with at least two consecutive occurrences of the same letter. Choose the correct code fragment to complete the pseudocode.

The following pseudocode is executed using the "Words" dataset and explode(W) returns the list of letters in the word W.
  1. A
    Figure from the original question paper
  2. B
    Figure from the original question paper
  3. C
    Figure from the original question paper
  4. D
    Figure from the original question paper
Show answer

Correct answer

  • A
    Figure from the original question paper

Question 7

+4 marksOne correct option

The following pseudocode is executed using the "Words" dataset. Assume that the rows in Table 1 are arranged in increasing order of sequence number from top to bottom. What will L store at the end of the execution?

The following pseudocode is executed using the "Words" dataset. Assume that the rows in Table 1 are arranged in increasing order of sequence number from top to bottom. What will L store at the end of the execution?

The following pseudocode is executed using the "Words" dataset. Assume that the rows in Table 1 are arranged in increasi
  1. A

    Number of nouns that appear immediately after an adjective

  2. B

    Number of adjectives that appear immediately after a noun

  3. C

    Number of sentences in which at least one noun appears immediately after anadjective

  4. D

    Number of sentences in which at least one adjective appears immediately aftera noun

Show answer

Correct answer

  • A

    Number of nouns that appear immediately after an adjective

Question 8

+4 marksOne or more correct options

Let X be a row from the "Words" dataset. Procedure isRich(X) should return True if the number of distinct vowels is less than the number of distinct consonants in X.Word. But the code may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. It is a Multiple Select Question (MSQ).

Let X be a row from the "Words" dataset. Procedure isRich(X) should return True if the number of distinct vowels is less than the number of distinct consonants in X.Word. But the code may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. It is a Multiple Select Question (MSQ). The return value of isRich(Y) will be True if

Let X be a row from the "Words" dataset. Procedure isRich(X) should return True if the number of distinct vowels is less

Select all that apply.

  1. A

    Line 2: vDict is initialized incorrectly

  2. B

    Line 10: i is updated incorrectly.

  3. C

    Line 12: Incorrect conditional statement to return True.

  4. D

    Line 15: return(True) should be replaced by return(False)

  5. E

    No error

Show answer

Correct answers

  • C

    Line 12: Incorrect conditional statement to return True.

  • D

    Line 15: return(True) should be replaced by return(False)

Question 9

+4 marksOne or more correct options

Consider the procedure given below, where aList is a non-empty list of real numbers.

Consider the procedure given below, where aList is a non-empty list of real numbers. At the end of the execution, which of the following option(s) would be correct? It is a Multiple Select Question (MSQ).

Consider the procedure given below, where aList is a non-empty list of real numbers.

Select all that apply.

  1. A

    The first element of both the lists, cumuList and aList, will be same.

  2. B

    Number of elements in cumuList will be one lesser than that of aList.

  3. C

    cumuList is a list of numbers in increasing order.

  4. D

    Number of elements in both lists, cumuList and aList, will be same.

Show answer

Correct answers

  • A

    The first element of both the lists, cumuList and aList, will be same.

  • D

    Number of elements in both lists, cumuList and aList, will be same.

Question 10

+5 marksOne or more correct options

The following pseudocode is executed using the "Olympics" dataset. At the end of the execution, medalDict stores a dictionary with player's name as key mapped to another dictionary. The nested dictionary stores the medal type as key mapped to a list of years in which the player won that medal. For example if player Xyz has won a silver medal in 2006, a gold medal in 2008, and another silver medal in 2011, then medalDict = {"Xyz" : {"Silver" : [2006, 2011], "Gold" : [2008]}, ... } Assume that every player has a distinct name. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. It is a Multiple Select Question (MSQ).

The following pseudocode is executed using the "Olympics" dataset. At the end of the execution, medalDict stores a dictionary with player's name as key mapped to another dictionary. The nested dictionary stores the medal type as key mapped to a list of years in which the player won that medal. For example if player Xyz has won a silver medal in 2006, a gold medal in 2008, and another silver medal in 2011, then medalDict = {"Xyz" : {"Silver" : [2006, 2011], "Gold" : [2008]}, ... } Assume that every player has a distinct name. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. It is a Multiple Select Question (MSQ).

The following pseudocode is executed using the "Olympics" dataset. At the end of the execution, medalDict stores a dicti

Select all that apply.

  1. A

    Line 1: Incorrect initialization of medalDict

  2. B

    Line 6: The current statement should be replaced by

    Line 6: The current statement should be replaced by
  3. C

    Line 9: The current statement should be replaced by

    Line 9: The current statement should be replaced by
  4. D

    Line 13: The current statement should be replaced by

    Line 13: The current statement should be replaced by
  5. E

    No Mistakes

    No Mistakes
Show answer

Correct answers

  • B

    Line 6: The current statement should be replaced by

    Line 6: The current statement should be replaced by
  • D

    Line 13: The current statement should be replaced by

    Line 13: The current statement should be replaced by

Question 11

+3 marksWritten answer

Consider the procedure doSomething given below. If C = [3, 4, 1, 9, 5, 3, 1, 9] and B = doSomething(C), what would be the value of first(B)?

Consider the procedure doSomething given below. If C = [3, 4, 1, 9, 5, 3, 1, 9] and B = doSomething(C), what would be the value of first(B)?

Consider the procedure doSomething given below. If C = [3, 4, 1, 9, 5, 3, 1, 9] and B = doSomething(C), what would be th
Show answer

A written answer, not marked automatically.

Question 12

+4 marksWritten answer

Consider the following pseudocode where Y is a row in the "Words" table. At the end of the execution, what will be the value of length(keys(alphaDict)) if Y.Word is "think"?

Consider the following pseudocode where Y is a row in the "Words" table. At the end of the execution, what will be the value of length(keys(alphaDict)) if Y.Word is "think"?

Consider the following pseudocode where Y is a row in the "Words" table. At the end of the execution, what will be the v
Show answer

A written answer, not marked automatically.

Question 13

+3 marksOne correct option

The following pseudocode is executed using the "Words" dataset.

The following pseudocode is executed using the "Words" dataset. Answer the given subquestions.

The following pseudocode is executed using the "Words" dataset.

What will count represent at the end of the execution if the missing code is filled by

What will count represent at the end of the execution if the missing code is filled by

What will count represent at the end of the execution if the missing code is filled by
  1. A

    Total number of nouns in the dataset

  2. B

    Number of sentences which start with a noun

  3. C

    Number of sentences having at least one noun

  4. D

    Number of sentences which end with a noun

Show answer

Correct answer

  • D

    Number of sentences which end with a noun

Question 14

+3 marksOne correct option

The following pseudocode is executed using the "Words" dataset.

The following pseudocode is executed using the "Words" dataset. Answer the given subquestions.

The following pseudocode is executed using the "Words" dataset.

What will count represent at the end of the execution if the missing code is filled by

What will count represent at the end of the execution if the missing code is filled by

What will count represent at the end of the execution if the missing code is filled by
  1. A

    Total number of nouns in the dataset

  2. B

    Number of sentences which start with a noun

  3. C

    Number of sentences having at least one noun

  4. D

    Number of sentences which end with a noun

Show answer

Correct answer

  • B

    Number of sentences which start with a noun

Question 15

+4 marksOne correct option

The following pseudocode is executed using the “Shopping Bills” dataset.

The following pseudocode is executed using the “Shopping Bills” dataset. Answer the given subquestions.

The following pseudocode is executed using the “Shopping Bills” dataset.

What will each value D[j][k] represent at the end of the execution?

  1. A

    Price of item j of category k across all bills

  2. B

    Price of item k of category j across all bills

  3. C

    List of prices of item j of category k across all bills

  4. D

    List of prices of item k of category j across all bills

Show answer

Correct answer

  • D

    List of prices of item k of category j across all bills

Question 16

+5 marksOne correct option

The following pseudocode is executed using the “Shopping Bills” dataset.

The following pseudocode is executed using the “Shopping Bills” dataset. Answer the given subquestions.

The following pseudocode is executed using the “Shopping Bills” dataset.

Consider the dictionary D created in the previous question, what will the value of L represent at the end of the execution of the following pseudocode?

Consider the dictionary D created in the previous question, what will the value of L represent at the end of the execution of the following pseudocode?

Consider the dictionary D created in the previous question, what will the value of L represent at the end of the executi
  1. A

    List of items for which the difference between the highest and lowest price isthe same

  2. B

    List of items for which the difference between the highest and lowest price ismaximum

  3. C

    List of items for which the difference between the highest and lowest price isminimum

  4. D

    List of items with same price in all shops

Show answer

Correct answer

  • B

    List of items for which the difference between the highest and lowest price ismaximum

Question 17

+1 markWritten answer

The following pseudocode is executed using the "Words" dataset.

The following pseudocode is executed using the "Words" dataset. Answer the given subquestions.

The following pseudocode is executed using the "Words" dataset.
Show answer

A written answer, not marked automatically.

Question 18

+1 markWritten answer

The following pseudocode is executed using the “Shopping Bills” dataset.

The following pseudocode is executed using the “Shopping Bills” dataset. Answer the given subquestions.

The following pseudocode is executed using the “Shopping Bills” dataset.
Show answer

A written answer, not marked automatically.