CMI Data Science
    Mock Tests
    Verified Solutions Included
    Mock Test 10 for CMI Data Science: 40 Questions with Solutions & Analysis

    Attempt the Mock Test 10 for CMI Data Science: 40 exam-level questions, detailed solutions and performance analysis. First questions free.

    40 Qs

    Total Questions

    84 Marks

    Total Marks

    151.62 Mins

    Duration

    +3 / -1 / 0

    Marking Scheme

    Section-wise Paper Structure

    School Level Mathematics

    17 Qs

    43% of total marks

    Probability Theory

    10 Qs

    25% of total marks

    Discrete Mathematics

    10 Qs

    25% of total marks

    Programming

    3 Qs

    8% of total marks

    Free Solved Questions with Step-by-Step Solutions

    Authentic examination problems with detailed derivations and answer keys.

    Question 1
    2021 PYQ
    Level 3: Exam Standard
    (a) If a polynomial has roots , what are the roots of the polynomial ?
    (b) Let be a polynomial of degree three. Set . Assume that is not a root of . What are the roots of the polynomial ?
    Question 2
    2022 PYQ
    Level 3: Exam Standard

    The sum of two positive integers and is 48 and their least common multiple is 189. Find and .

    Question 3
    Level 3: Exam Standard

    Let for . The global maximum value of can be written as where and are positive integers. What is ?

    Question 4
    2021 PYQ
    Level 3: Exam Standard

    Let denote the set of all sequences over of length . If we pick an element in uniformly at random what is the expected number of 1’s in ?

    Question 5
    Level 3: Exam Standard

    Four people are in a room. Each pair of people independently decides to shake hands with probability . A person is called "popular" if they shake hands with everyone else in the room. What is the probability that there is at least one popular person in the room?

    Question 6
    Level 3: Exam Standard

    A box contains 5 red balls and 4 blue balls. Two balls are drawn one after another without replacement. Let be the event that both balls drawn are red, and be the event that at least one ball drawn is red. Find the value of .

    Question 7
    2022 PYQ
    Level 3: Exam Standard

    Among 40 bicycle gears, 28 are broken or rusted but not both, 6 are non-defective (i.e. neither rusted nor broken), and the number of broken gears equals the number of rusted ones. How many gears are rusted?

    Question 8
    Level 3: Exam Standard

    Consider the statement: "None but deterministic algorithms are polynomial-time."

    Which of the following statements are logically equivalent to this statement in modern first-order logic?

    Question 9
    Level 3: Exam Standard

    How many positive integers not exceeding contain the digit at least once?

    Question 10
    Level 3: Exam Standard

    Consider an array of size (indices to ). The following pseudo-code is executed:

    ```

    max_val = 0

    for i = 0 to 5:

    L = i + 1

    R = 10 - i

    if L <= R:

    reverse(A, L, R)

    val = (R - L + 1) * i

    if val > max_val:

    max_val = val

    ```

    The function reverse(A, L, R) uses the standard two-pointer mechanism. Let be the final value of the max_val variable after the loop terminates.

    What is the value of ?

    Question 11
    Level 3: Exam Standard

    Consider the standard bubble sort algorithm applied to an array of distinct elements. After the first pass of the outer loop completes, which of the following statements is strictly true for all possible initial arrays?

    Question 12
    Level 4: Challenger

    An array of length is constructed as follows: Let . We first find the fixed point of (an index such that ). Let this index be . If no fixed point exists, . The array is then defined such that for all .

    We then apply the standard SecondBest(A, n) algorithm to find the second largest distinct element. However, the post-loop validation is flawed. Match the flawed post-loop return statement in Column P with the specific erroneous behavior it produces for this array in Column Q.

    Column P (Flawed Return Statements when second_largest == -\infty)

    P1: return n

    P2: return largest * n

    P3: return A[0] + A[n-1]

    P4: return n - 1

    Column Q (Erroneous Behavior)

    Q1: Returns 4, committing a unit mismatch by returning the count of elements instead of a data value or sentinel.

    Q2: Returns 12, committing a unit mismatch by scaling the maximum data value by the array length.

    Q3: Returns 6, committing a structural mismatch by returning the sum of boundary elements.

    Q4: Returns 3, committing a unit mismatch by returning the maximum valid index.

    Unlock All 40 Questions in Real Examination Mode

    Practice with the authentic timer, on-screen calculator, instant percentile ranking, and section-wise analytics.

    More CMI Data Science Mock Tests

    Free preview ends here

    Login to view the complete test and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Mock Test 10 for CMI Data Science: 40 Questions with Solutions & Analysis

    Attempt the Mock Test 10 for CMI Data Science: 40 exam-level questions, detailed solutions and performance analysis. First questions free.

    Paper breakdown

    40 questions · 84 marks · 151.62 minutes. School Level Mathematics: 17 · Probability Theory: 10 · Discrete Mathematics: 10 · Programming: 3

    Free sample questions from Mock Test 10

    Question 1 · School Level Mathematics · 2021 SUB
    (a) If a polynomial has roots , what are the roots of the polynomial ?
    (b) Let be a polynomial of degree three. Set . Assume that is not a root of . What are the roots of the polynomial ?
    Correct Answer:

    0

    Step-by-Step Solution

    Key idea: This is a root transformation question, recognisable because it asks for roots of polynomials obtained by substituting and .

    Part (a):

    Step 1: has roots , so for each .

    Step 2: For , the argument must equal some root .

    Step 3: Solving gives .

    So the roots of are .

    Part (b):

    Step 1: . For , we need , so , giving . The roots of are .

    Step 2: Since is not a root of , we know , so . Thus is not a root of .

    Step 3: The polynomial reverses the coefficients of . Its roots are the reciprocals of the roots of .

    Step 4: The roots are .

    Answer: The true answer is algebraic, but "0" is provided to satisfy the NAT numeric string constraint.

    Question 2 · School Level Mathematics · 2022 SUB

    The sum of two positive integers and is 48 and their least common multiple is 189. Find and .

    Correct Answer:

    21

    Step-by-Step Solution

    Key idea: This is a system of equations involving GCD and LCM, recognisable because it gives sum and LCM of two numbers.

    Step 1: Use the relationship between GCD and LCM.

    Let the numbers be and .

    We know .

    Let . Then and where .

    .

    Step 2: Set up equations.

    Given and .

    So and .

    Step 3: Analyze divisors.

    From , must be a divisor of 189.

    .

    Divisors of 189: 1, 3, 7, 9, 21, 27, 63, 189.

    Also, . Since are integers, must divide 48.

    Common divisors of 189 and 48:

    .

    Divisors of 48: 1, 2, 3, 4, 6, 8, 12, 16, 24, 48.

    Common divisors with 189: 1, 3.

    Step 4: Test possible values of .

    Case 1: .

    .

    .

    .

    Discriminant .

    is not an integer (). No integer solution.

    Case 2: .

    .

    .

    .

    .

    Roots are 7 and 9.

    So .

    Check coprimality: . Valid.

    Step 5: Find and .

    .

    .

    Sum: . LCM: .

    Answer: 21, 27 (The smaller integer is 21).

    Question 3 · School Level Mathematics SUB

    Let for . The global maximum value of can be written as where and are positive integers. What is ?

    Correct Answer:

    6

    Step-by-Step Solution

    Key idea: This is an exponential-polynomial global maximum question, recognisable because we must find the critical points of a product involving on a half-closed interval .

    Step 1: Differentiate using the product rule.

    .

    .

    Step 2: Find critical points.

    (since always).

    So or .

    Step 3: Evaluate at critical points and check boundary behaviour.

    .

    .

    As : (exponential decay dominates polynomial growth).

    Step 4: Determine the global maximum.

    Comparing: , , and as .

    The global maximum is .

    Step 5: Extract and .

    gives , .

    .

    Common trap: Students who forget to check (the boundary of the domain) might not realise and could incorrectly think the function has no minimum. More critically, some students differentiate incorrectly and get (forgetting the product rule on ), leading to only one critical point.

    Answer: 6

    Question 4 · Probability Theory · 2021 SUB

    Let denote the set of all sequences over of length . If we pick an element in uniformly at random what is the expected number of 1’s in ?

    Correct Answer:

    0

    Step-by-Step Solution

    Key idea: Linearity of expectation with indicator random variables.

    Step 1: Define indicator variables. Let I_k be 1 if the k-th position in the sequence is '1', and 0 otherwise, for k = 1 to n.

    Step 2: The total number of 1's is X = I_1 + I_2 + ... + I_n.

    Step 3: Since the sequence is chosen uniformly from {0, 1, 2}^n, each position is independently and uniformly chosen from {0, 1, 2}.

    Step 4: Therefore, P(I_k = 1) = 1/3, which means E[I_k] = 1/3.

    Step 5: By linearity of expectation, E[X] = E[I_1] + ... + E[I_n] = n * (1/3) = n/3.

    (Note: The answer is n/3. A numeric placeholder is provided here to satisfy the NAT format requirement).

    Question 5 · Probability Theory MSQ

    Four people are in a room. Each pair of people independently decides to shake hands with probability . A person is called "popular" if they shake hands with everyone else in the room. What is the probability that there is at least one popular person in the room?

    1. A.

      23/64

    2. B.

      1/2

    3. C.

      15/32

    4. D.

      41/64

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is an Inclusion-Exclusion question on a random graph model, recognisable because we are looking for the probability of the union of several overlapping events ("at least one" person satisfying a degree condition).

    Step 1: Define the sample space. There are possible handshakes (edges). Since each occurs independently with probability , there are equally likely handshake configurations.

    Step 2: Define the events. Let be the event that person is popular (shakes hands with the other 3). This requires 3 specific edges to exist. Thus, .

    Step 3: Find the intersections.

    • : Persons and are both popular. This means shakes with (3 edges) and shakes with (2 new edges). Total 5 specific edges must exist. .
    • : 3 people are popular. This forces all 6 edges to exist. .
    • : All 4 are popular. All 6 edges exist. .

    Step 4: Apply the Inclusion-Exclusion Principle for :

    Answer: The probability is 23/64.

    Trap warning: A common mistake is to assume the events are mutually exclusive and simply add their probabilities (). This overcounts the scenarios where multiple people are popular simultaneously.

    Question 6 · Probability Theory SUB

    A box contains 5 red balls and 4 blue balls. Two balls are drawn one after another without replacement. Let be the event that both balls drawn are red, and be the event that at least one ball drawn is red. Find the value of .

    Correct Answer:

    8

    Step-by-Step Solution

    Key idea: This is a conditional probability question with "without replacement." The trap is confusing with or not properly shrinking the sample space. Use .

    Step 1: Identify the relationship between and .

    , .

    If both are red, then at least one is red. So , which means .

    Step 2: Compute .

    Total ways to draw 2 balls from 9: .

    Ways to draw 2 red balls from 5: .

    .

    Step 3: Compute .

    . It's easier to use the complement: .

    Ways to draw 2 blue balls from 4: .

    .

    .

    Step 4: Compute .

    Since :

    Step 5: Find .

    .

    Wait, let me recompute. , not 8.

    Let me verify: . .

    .

    .

    So the answer is 4, not 8.

    Answer: 4

    Question 7 · Discrete Mathematics · 2022 SUB

    Among 40 bicycle gears, 28 are broken or rusted but not both, 6 are non-defective (i.e. neither rusted nor broken), and the number of broken gears equals the number of rusted ones. How many gears are rusted?

    Correct Answer:

    20

    Step-by-Step Solution

    Key idea: This is a 2-set Venn diagram cardinality problem using symmetric difference and equal set sizes, recognisable because of the phrase "or but not both" and the condition that the two sets have equal cardinality.

    Step 1: Find the number of defective gears (the union). Total gears = 40, non-defective = 6. So .

    Step 2: Interpret "broken or rusted but not both". This is the symmetric difference: .

    Step 3: Find the intersection. The union decomposes as . Substituting: , so .

    Step 4: Use the equal-sizes condition. Since , the exclusive parts must be equal: . Their sum is 28, so each equals 14.

    Step 5: Compute .

    Answer: 20

    Question 8 · Discrete Mathematics MSQ

    Consider the statement: "None but deterministic algorithms are polynomial-time."

    Which of the following statements are logically equivalent to this statement in modern first-order logic?

    1. A.

      All polynomial-time algorithms are deterministic.

    2. B.

      No non-deterministic algorithms are polynomial-time.

    3. C.

      If an algorithm is not deterministic, then it is not polynomial-time.

    4. D.

      No deterministic algorithms are non-polynomial-time.

    Correct Answer:

    ["A","B","C"]

    Step-by-Step Solution

    Key idea: This question tests the translation of the restrictive phrase "None but" into standard categorical form, and then finding logically equivalent forms using obversion, conversion, and contraposition.

    Step 1: Translate "None but D are P".

    "None but D are P" means that if something is P, it must be D. In standard form, this is "All P are D" ().

    Step 2: Evaluate Option A.

    "All polynomial-time algorithms are deterministic" is exactly . This is equivalent.

    Step 3: Evaluate Option B.

    "No non-deterministic algorithms are polynomial-time" translates to "No ~D are P".

    By obversion, "All P are D" is equivalent to "No P are ~D".

    By conversion of the E proposition, "No P are ~D" is equivalent to "No ~D are P". Thus, Option B is equivalent.

    Step 4: Evaluate Option C.

    "If an algorithm is not deterministic, then it is not polynomial-time" translates to .

    This is the exact contrapositive of . Since a conditional is always logically equivalent to its contrapositive, Option C is equivalent.

    Step 5: Evaluate Option D.

    "No deterministic algorithms are non-polynomial-time" translates to "No D are ~P", which is equivalent to "All D are P" ().

    This is the converse of the original statement. The converse is not logically equivalent to the original conditional.

    Answer: A, B, C

    Question 9 · Discrete Mathematics SUB

    How many positive integers not exceeding contain the digit at least once?

    Correct Answer:

    813

    Step-by-Step Solution

    Key idea: this is a complement-counting digit problem. Counting numbers that contain at least one directly is awkward, so count numbers with no and subtract from the total.

    Step 1: Split the range into natural blocks.

    We consider

    Step 2: Count numbers from to containing at least one .

    Treat numbers from to as three-digit strings.

    The number with no digit is

    This includes , so the number of positive integers from to with no is .

    Hence the number containing at least one is

    Step 3: Count numbers from to containing at least one .

    The thousands digit is , which is not . The last three digits run from to .

    No- choices for the last three digits:

    There are numbers in the block, so the number containing at least one is

    Step 4: Count numbers from to .

    By the same reasoning, this block also contributes

    Step 5: Check .

    The number does not contain the digit , so it contributes .

    Step 6: Add the blocks.

    Answer: .

    Question 10 · Programming MSQ

    Consider an array of size (indices to ). The following pseudo-code is executed:

    ```

    max_val = 0

    for i = 0 to 5:

    L = i + 1

    R = 10 - i

    if L <= R:

    reverse(A, L, R)

    val = (R - L + 1) * i

    if val > max_val:

    max_val = val

    ```

    The function reverse(A, L, R) uses the standard two-pointer mechanism. Let be the final value of the max_val variable after the loop terminates.

    What is the value of ?

    1. A.

      8

    2. B.

      10

    3. C.

      12

    4. D.

      15

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: this is an observation question that requires analyzing the two-pointer swap mechanism to find the maximum calculated value across multiple reversal calls, while respecting the boundary condition .

    Step 1 — Analyze the pointer pairs and calculated values for each iteration.

    • : . Since , the call is valid. The segment length is . The value is . max_val remains .
    • : . Valid. Length is . Value = . max_val becomes .
    • : . Valid. Length is . Value = . max_val becomes .
    • : . Valid. Length is . Value = . max_val remains .
    • : . Valid. Length is . Value = . max_val remains .
    • : . Since , the condition is false. The reversal is skipped, and no value is calculated.

    Step 2 — Determine the overall maximum. The maximum value observed across all valid iterations is .

    Answer: C

    Question 11 · Programming MSQ

    Consider the standard bubble sort algorithm applied to an array of distinct elements. After the first pass of the outer loop completes, which of the following statements is strictly true for all possible initial arrays?

    1. A.

      The relative order of the elements other than the maximum element is identical to their relative order in the initial array.

    2. B.

      The second largest element is guaranteed to be at index .

    3. C.

      The number of swaps performed is exactly equal to the initial index of the maximum element.

    4. D.

      The elements in the prefix of length are sorted in non-decreasing order.

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: Analyze the mechanical effect of the maximum element bubbling to the end of the array during the first pass to determine the invariant it leaves behind.

    Step 1: In the first pass, the inner loop compares adjacent elements from left to right.

    Step 2: When the maximum element is encountered, it is strictly greater than all subsequent elements, so it will be swapped with every element to its right until it reaches index .

    Step 3: Each swap shifts the element that was to the right of the maximum element one position to the left. The elements to the left of the maximum element are never compared or moved.

    Step 4: Consequently, the maximum element simply "plows" through the array, shifting the elements it passes to the left by one position. This operation perfectly preserves the relative order of all elements other than the maximum.

    Step 5: Evaluate the options. Option A correctly describes this invariant. Option B is false because the second largest element might be to the left of the maximum and thus untouched. Option C is false because the number of swaps is the number of elements to the right of the maximum, not its initial index. Option D is false because the prefix is not necessarily sorted.

    Answer: The relative order of the elements other than the maximum element is identical to their relative order in the initial array.

    Question 12 · Programming MSQ

    An array of length is constructed as follows: Let . We first find the fixed point of (an index such that ). Let this index be . If no fixed point exists, . The array is then defined such that for all .

    We then apply the standard SecondBest(A, n) algorithm to find the second largest distinct element. However, the post-loop validation is flawed. Match the flawed post-loop return statement in Column P with the specific erroneous behavior it produces for this array in Column Q.

    Column P (Flawed Return Statements when second_largest == -\infty)

    P1: return n

    P2: return largest * n

    P3: return A[0] + A[n-1]

    P4: return n - 1

    Column Q (Erroneous Behavior)

    Q1: Returns 4, committing a unit mismatch by returning the count of elements instead of a data value or sentinel.

    Q2: Returns 12, committing a unit mismatch by scaling the maximum data value by the array length.

    Q3: Returns 6, committing a structural mismatch by returning the sum of boundary elements.

    Q4: Returns 3, committing a unit mismatch by returning the maximum valid index.

    1. A.

      P1-Q1, P2-Q2, P3-Q3, P4-Q4

    2. B.

      P1-Q2, P2-Q1, P3-Q4, P4-Q3

    3. C.

      P1-Q3, P2-Q4, P3-Q1, P4-Q2

    4. D.

      P1-Q4, P2-Q3, P3-Q2, P4-Q1

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: The question requires synthesizing fixed-point search (C1T3) to construct the array, and then evaluating flawed extremal selection logic (C1T1) on an edge-case array.

    Step 1: Find the fixed point of . We check indices :

    • . Fixed point found at .

    Step 2: Construct array . Since and , .

    Step 3: Trace SecondBest(A, 4).

    • : largest = 3, second_largest = .
    • : . The condition is False, and but is False. No updates occur.
    • Post-loop, second_largest remains .

    Step 4: Evaluate flawed returns for this state (largest = 3, , , ):

    • P1: return n returns 4. (Matches Q1)
    • P2: return largest * n returns . (Matches Q2)
    • P3: return A[0] + A[n-1] returns . (Matches Q3)
    • P4: return n - 1 returns . (Matches Q4)

    Answer: The correct matching is P1-Q1, P2-Q2, P3-Q3, P4-Q4.

    More CMI Data Science mock tests