Quiz Space

Computational Thinking Quiz 1: 11 July 2021, Set POD21QZAQPB (May 2021 term)

Question 1

+3 marksOne correct option

Let L be a non-empty list of integers, and D be a non-empty dictionary which are given below:
L = [-2, -1, 0, 1, 2]
D = {-2: 'a', 2: 'b', -1: 'c', 1: 'd', 0: 'e'}

Match the following expressions on the left side with the appropriate values on the right side.

a. D['d']
b. keys(D)
c. isKey(D, 'b')
d. last(init(L)) - last(rest(L))
e. first(init(L)) - first(rest(L))
f. first(rest(rest(L)))

  1. False
  2. Invalid key
  3. L
  4. 0
  5. -1
  6. A list
  1. A

    •
    a - (4), b - (6), c - (2), d - (5), e - (5), f - (4)

  2. B

    •
    a - (4), b - (6), c - (1), d - (5), e - (5), f - (4)

  3. C

    •
    a - (6), b - (3), c - (1), d - (4), e - (4), f - (4)

  4. D

    •
    a - (6), b - (3), c - (2), d - (4), e - (4), f - (5)

  5. E

    •
    None of these

Question 2

+1 markOne correct option

Choose the correct option based on the following pseudocode in the given subquestions.

text
L = [0]
LA = [[3, 2, 1], [2, 1], [1]]
LB = [ ], LC = [ ]
foreach A in LA {
foreach B in A {
LB = [B] ++ LB
L = [first(L) + B]
}
LC = [LB] ++ LC
LB = [ ]
}

What will be the value of L at the end of execution?

  1. A

    L = [3]

  2. B

    L = [10]

  3. C

    L = [3, 2, 1, 2, 1, 1]

  4. D

    L = [1, 2, 3, 1, 2, 1]

Question 3

+1.5 marksOne correct option

Choose the correct option based on the following pseudocode in the given subquestions.

text
L = [0]
LA = [[3, 2, 1], [2, 1], [1]]
LB = [ ], LC = [ ]
foreach A in LA {
foreach B in A {
LB = [B] ++ LB
L = [first(L) + B]
}
LC = [LB] ++ LC
LB = [ ]
}

What will be the value of LC at the end of execution?

  1. A

    LC = [1, 2, 3, 1, 2, 1]

  2. B

    LC = [3, 2, 1, 2, 1, 1]

  3. C

    LC = [[1, 2, 3], [1, 2], [1]]

  4. D

    LC = [[1], [1, 2], [1, 2, 3]]

9 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the Computational Thinking (CT) Quiz 1 11 Jul 2021 Set POD21QZAQPB paper

The IIT Madras BS Computational Thinking (Computational Thinking (CT)) Quiz 1 paper sat on 11 Jul 2021, in the May 2021 term, set POD21QZAQPB: 12 questions for 25 marks in 120 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeatureComputational Thinking (CT) Quiz 1 11 Jul 2021 Set POD21QZAQPB at a glance
TermMay 2021 term
SubjectComputational Thinking
Course codeBSCS1001
Questions12
Marks25
Duration120 min
MCQ11
MSQ1
Official paperIIT M QUIZ EXAM POD21QZAQPA FN 11 July 2021
Negative markingNo negative marking.
Updated

Other sets that day

Same Quiz 1, other subjects

More Computational Thinking (CT)