Prasnya
Prasnya
Prasnya
Continue with Google
Prasnya
Continue with Google
Week 3 Computational Thinking Questions | Prasnya
Computational Thinking > Week 3
All PYQs
Topic-Wise PYQs
Start Weekly Test
Mock tests
Week mock
Topic mock
Subject mock
Type:
All
Difficulty:
All
Year:
All
6Q
01
The following pseudocode is executed using the Words dataset. `explode(X.Word)` returns the list of letters in `X.Word`. For example, `explode("apple")` returns `["a", "p", "p", "l", "e"]`. `isVowel(c)` returns `True` if `c` is a vowel, and `isConsonant(c)` returns `True` if `c` is a consonant. What will `cnt` represent at the end of execution? ``` cnt = 0 while(Table 1 has more rows){ Read the first row X in Table 1 letters = explode(X.Word) if(checkPattern(letters)){ cnt = cnt + 1 } Move X to Table 2 } Procedure checkPattern(S) if(length(S) < 2){ return(False) } prev = first(S) res = rest(S) foreach curr in res{ if(isVowel(prev) and isConsonant(curr)){ return(True) } prev = curr } return(False) End checkPattern ```
Single correct
MEDIUM
4 marks
06 April 2026
02
Consider the following pseudocode. If at the end of execution,
B
=
[
3
,
5
]
B = [3, 5]
B
=
[
3
,
5
]
, then choose the correct code for procedure `checkCondition`. ``` A = [3, 8, 15, 6, 10, 5] B = [] foreach number in A { if(checkCondition(number)) { B = B ++ [number] } } ```
Single correct
MEDIUM
4 marks
03 August 2025
03
Consider the following pseudocode. The `floor(n)` function returns the largest integer value smaller than or equal to `n`. The `remainder(x, j)` function returns the remainder when `x` is divided by `j`. What will the value of `B` be at the end of execution? ``` A = [18, 19, 24, 21, 13] B = [] foreach number in A { if (checkCondition(number)) { B = B ++ [number] } } Procedure checkCondition(X) sum_of_digits = 0 temp = X while (temp > 0) { digit = remainder(temp, 10) sum_of_digits = sum_of_digits + digit temp = floor(temp / 10) } if (remainder(X, sum_of_digits) == 0) { return(True) } else { return(False) } End checkCondition ```
Single correct
MEDIUM
4 marks
04 August 2024
04
Consider the following pseudocode. What will the value of `B` be at the end of execution? ``` A = [3, 8, 15, 6, 10, 5] B = [] foreach number in A { if (checkCondition(number)) { B = B ++ [number] } } Procedure checkCondition(X) if (X == 1) { return(False) } j = 2 flag = True while (j < X) { if (remainder(X, j) == 0) { flag = False } j = j + 1 } return(flag) End checkCondition ```
Single correct
MEDIUM
3 marks
24 March 2024
05
Which statement(s) are true about `nSub` based on the parent pseudocode?
Comprehension
MEDIUM
3 marks
20 November 2022
06
Let `M`, `P`, and `C` be lists of sequence numbers of students who scored more than 80 in Mathematics, Physics, and Chemistry respectively. If `n` is a student's sequence number, choose the correct implementation of `nSub`.
Comprehension
HARD
4 marks
20 November 2022
Showing 6 questions.
Computational Thinking > Week 3
All PYQs
Topic-Wise PYQs
Start Weekly Test
Mock tests
Week mock
Topic mock
Subject mock
Type:
All
Difficulty:
All
Year:
All
6Q
01
The following pseudocode is executed using the Words dataset. `explode(X.Word)` returns the list of letters in `X.Word`. For example, `explode("apple")` returns `["a", "p", "p", "l", "e"]`. `isVowel(c)` returns `True` if `c` is a vowel, and `isConsonant(c)` returns `True` if `c` is a consonant. What will `cnt` represent at the end of execution? ``` cnt = 0 while(Table 1 has more rows){ Read the first row X in Table 1 letters = explode(X.Word) if(checkPattern(letters)){ cnt = cnt + 1 } Move X to Table 2 } Procedure checkPattern(S) if(length(S) < 2){ return(False) } prev = first(S) res = rest(S) foreach curr in res{ if(isVowel(prev) and isConsonant(curr)){ return(True) } prev = curr } return(False) End checkPattern ```
Single correct
MEDIUM
4 marks
06 April 2026
02
Consider the following pseudocode. If at the end of execution,
B
=
[
3
,
5
]
B = [3, 5]
B
=
[
3
,
5
]
, then choose the correct code for procedure `checkCondition`. ``` A = [3, 8, 15, 6, 10, 5] B = [] foreach number in A { if(checkCondition(number)) { B = B ++ [number] } } ```
Single correct
MEDIUM
4 marks
03 August 2025
03
Consider the following pseudocode. The `floor(n)` function returns the largest integer value smaller than or equal to `n`. The `remainder(x, j)` function returns the remainder when `x` is divided by `j`. What will the value of `B` be at the end of execution? ``` A = [18, 19, 24, 21, 13] B = [] foreach number in A { if (checkCondition(number)) { B = B ++ [number] } } Procedure checkCondition(X) sum_of_digits = 0 temp = X while (temp > 0) { digit = remainder(temp, 10) sum_of_digits = sum_of_digits + digit temp = floor(temp / 10) } if (remainder(X, sum_of_digits) == 0) { return(True) } else { return(False) } End checkCondition ```
Single correct
MEDIUM
4 marks
04 August 2024
04
Consider the following pseudocode. What will the value of `B` be at the end of execution? ``` A = [3, 8, 15, 6, 10, 5] B = [] foreach number in A { if (checkCondition(number)) { B = B ++ [number] } } Procedure checkCondition(X) if (X == 1) { return(False) } j = 2 flag = True while (j < X) { if (remainder(X, j) == 0) { flag = False } j = j + 1 } return(flag) End checkCondition ```
Single correct
MEDIUM
3 marks
24 March 2024
05
Which statement(s) are true about `nSub` based on the parent pseudocode?
Comprehension
MEDIUM
3 marks
20 November 2022
06
Let `M`, `P`, and `C` be lists of sequence numbers of students who scored more than 80 in Mathematics, Physics, and Chemistry respectively. If `n` is a student's sequence number, choose the correct implementation of `nSub`.
Comprehension
HARD
4 marks
20 November 2022
Showing 6 questions.