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

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

    40 Qs

    Total Questions

    85 Marks

    Total Marks

    149.59 Mins

    Duration

    +3 / -1 / 0

    Marking Scheme

    Section-wise Paper Structure

    School Level Mathematics

    14 Qs

    35% of total marks

    Probability Theory

    10 Qs

    25% of total marks

    Discrete Mathematics

    10 Qs

    25% of total marks

    Programming

    6 Qs

    15% of total marks

    Free Solved Questions with Step-by-Step Solutions

    Authentic examination problems with detailed derivations and answer keys.

    Question 1
    2024 PYQ
    Level 3: Exam Standard

    Suppose that is an matrix with . For an vector consider the equations

    where is the transpose of the matrix . Which of the following statements are correct?

    Question 2
    Level 4: Challenger

    Let . Let be the tangent line to the curve at its inflection point with the smaller -coordinate. Find the area of the finite region bounded by and .

    Question 3
    Level 3: Exam Standard

    When is divided by , the remainder is of the form . The value of is:

    Question 4
    2020 PYQ
    Level 3: Exam Standard
    Two friends Amar and Prem wish to meet at a theme party between 5 p.m. and 6 p.m. (They are said to meet if they are in the room at the same time or if one of them leaves as the other enters.) Once they enter, they stay for exactly 20 minutes.
    (a) Fill in the blanks:
    i. The latest time by which any one of them can enter is ________;
    ii. If Amar and Prem are to meet, then their entry times can be separated by at most an interval of ______ minutes.
    (b) What is the probability that Amar and Prem will meet? (Hint: Plot the arrival times on the x- and y-axes.)
    Question 5
    Level 3: Exam Standard

    Let be a discrete random variable with and . Define . Find .

    Question 6
    Level 3: Exam Standard

    5 balls are placed independently and uniformly at random into 5 bins. Let be the number of bins that contain exactly one ball. Find .

    Question 7
    2025 PYQ
    Level 3: Exam Standard
    Three hostel friends Amar, Prem and Raj are suspected of breaking a window. They made the following statements when questioned by the warden:
    • Amar: I did not break it. Prem is lying.
    • Prem: Amar is telling the truth. Raj broke the window.
    • Raj: I did not break it. Either Amar is telling the truth or Prem is telling the truth.
    You know that exactly one of them lied and the other two told the truth. Then, who broke the window? Justify.
    Question 8
    Level 3: Exam Standard

    In a survey of 70 people about two social media platforms and , it is found that 44 people use , 38 use , and the number of people who use only is exactly 4 more than the number who use neither platform. How many people use exactly one platform?

    Question 9
    Level 3: Exam Standard

    Let and . How many injective functions satisfy and ?

    Question 10
    2020 PYQ
    Level 3: Exam Standard
    For any string str, length(str) returns the length of the string, append(str1,str2) concatenates str1 with another string str2, and trim(str) removes any spaces that exist at the end of the string str. The function reverse(str, i, j) reverses the part of the string from position i to position j. Assume that position 0 refers to the first character in the string. What does the following pseudo-code do?
    def manipulate(string str)
    {
        reverse(str, 0, length(str)-1);
        append(str, ‘ ’);
        n = length(str);
        j = 0;

        for (i = 0; i < n; i=i+1) {
            if (str[i] is ‘ ’) {
                reverse(str, j, i-1);
                j = i + 1;
            }
        }

        trim(str);
        return str;
    }
    Question 11
    2024 PYQ
    Level 3: Exam Standard
    Common Description: Questions 4 and 5 are based on the following description. The following question appeared in a quiz: “Write the code for a function SecondBest() that takes an array and a positive integer as arguments. The elements of are all integers, and is the number of elements in . The call SecondBest() should return the second largest element in . If has no second largest element, then the function should return the special value None.” A student submitted the code below as the answer to this question. In the code the array is indexed from 0. function SecondBest(A, n) { if n == 1 { return(None); } first = A[0]; second = A[1]; for i from 2 to (n-1) { if (A[i] >= first) and (A[i] >= second) { second = first; first = A[i]; } else { if A[i] >= second { second = A[i]; } } } if first != second { return(second); } else { return(None); } } This answer turned out to be wrong; this function gives the correct answer for some valid inputs, and wrong answers for other valid inputs. Answer the next two questions about this function. What do the following function calls return? Briefly explain your answer.
    (a) SecondBest([2,2,3], 3)
    (b) SecondBest([3,2,2], 3)
    Question 12
    Level 3: Exam Standard

    Consider the following recursive function defined for non-negative integers :

    ```

    function f(n):

    if n == 0: return 1

    if n == 1: return 2

    return f(n-1) + f(n-2)

    ```

    Assertion (A): is an even number.

    Reason (R): is even for all even .

    Which of the following is correct?

    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 1 for CMI Data Science: 40 Questions with Solutions & Analysis

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

    Paper breakdown

    40 questions · 85 marks · 149.59 minutes. School Level Mathematics: 14 · Probability Theory: 10 · Discrete Mathematics: 10 · Programming: 6

    Free sample questions from Mock Test 1

    Question 1 · School Level Mathematics · 2024 MSQ

    Suppose that is an matrix with . For an vector consider the equations

    where is the transpose of the matrix . Which of the following statements are correct?

    1. A.

      If equation (1) admits a solution for all , then exists.

    2. B.

      If equation (1) admits a solution for all , then equation (2) also admits a solution for all .

    3. C.

      If equation (1) admits a solution for some , then exists.

    4. D.

      If equation (1) admits a solution for some , then equation (2) also admits a solution for that .

    Correct Answer:

    ["A","B"]

    Step-by-Step Solution

    Key idea: This question tests the relationship between the solvability of and the invertibility of , and how this relates to .

    Step 1: Analyze Option A. "If equation (1) admits a solution for all , then exists."

    If has a solution for every , then the column space of is all of . This means has full rank (). For a square matrix, full rank implies invertibility. So, exists. Option A is Correct.

    Step 2: Analyze Option B. "If equation (1) admits a solution for all , then equation (2) also admits a solution for all ."

    From Step 1, if (1) is solvable for all , then is invertible.

    If is invertible, then is also invertible (since ).

    If is invertible, then has a unique solution for every .

    So, Option B is Correct.

    Step 3: Analyze Option C. "If equation (1) admits a solution for some , then exists."

    Solvability for some does not imply full rank. could be singular, and just happens to be in the column space.

    Counterexample: , . has solution . But is not invertible. Option C is Incorrect.

    Step 4: Analyze Option D. "If equation (1) admits a solution for some , then equation (2) also admits a solution for that ."

    Using the same counterexample: , .

    has a solution.

    Check . Since is symmetric, . So is the same system, which has a solution.

    Wait, let's pick a non-symmetric singular matrix.

    Let . .

    Let .

    . Solution exists ().

    Now check . No solution.

    So, solvability of does not imply solvability of for the same if is singular. Option D is Incorrect.

    Answer: Options A and B are correct.

    Question 2 · School Level Mathematics SUB

    Let . Let be the tangent line to the curve at its inflection point with the smaller -coordinate. Find the area of the finite region bounded by and .

    Correct Answer:

    none

    Step-by-Step Solution

    Key idea: This is a geometry and inflection point synthesis question. The tangent at an inflection point intersects the curve with multiplicity at least 3, which greatly simplifies the area calculation.

    Step 1: Find the inflection points.

    .

    .

    Inflection points at and . The smaller is .

    Step 2: Find the tangent line at .

    .

    .

    Tangent line: .

    Step 3: Find intersection points of and .

    .

    Since is both a tangency point and an inflection point, has a root of multiplicity at least 3 at . Factor out :

    .

    Verification: . Correct.

    Intersection points: and .

    Step 4: Determine which function is on top.

    For : and , so . The line is above the curve.

    Step 5: Compute the area.

    .

    Substitute , , limits to , and :

    .

    Answer: The area is .

    Question 3 · School Level Mathematics SUB

    When is divided by , the remainder is of the form . The value of is:

    Correct Answer:

    1

    Step-by-Step Solution

    Key idea: This is a polynomial remainder question using the Remainder Theorem. Since the divisor is quadratic, the remainder is linear: . We can find and by evaluating at the roots of the divisor.

    Step 1: Factor the divisor.

    . Roots are and .

    Step 2: Write the division algorithm.

    Step 3: Substitute (to eliminate ).

    ... (equation 1)

    Step 4: Substitute .

    ... (equation 2)

    Step 5: Solve the system.

    Subtract equation 1 from equation 2:

    So .

    From equation 1: .

    Step 6: Compute .

    .

    Answer: 1

    Common trap: Trying to perform polynomial long division of by a quadratic, which is computationally infeasible. The Remainder Theorem shortcut avoids this entirely.

    Question 4 · Probability Theory · 2020 SUB
    Two friends Amar and Prem wish to meet at a theme party between 5 p.m. and 6 p.m. (They are said to meet if they are in the room at the same time or if one of them leaves as the other enters.) Once they enter, they stay for exactly 20 minutes.
    (a) Fill in the blanks:
    i. The latest time by which any one of them can enter is ________;
    ii. If Amar and Prem are to meet, then their entry times can be separated by at most an interval of ______ minutes.
    (b) What is the probability that Amar and Prem will meet? (Hint: Plot the arrival times on the x- and y-axes.)
    Correct Answer:

    0.56

    Step-by-Step Solution

    Key idea: This is a classic geometric probability meeting problem, recognisable from the setup: two people arrive uniformly at random in a time interval, stay for a fixed duration, and meet if their intervals overlap.

    Step 1: Interpret the meeting condition.

    The party runs from 5 p.m. to 6 p.m., a 60-minute window. Each stays for exactly 20 minutes. They meet if their 20-minute intervals overlap. This happens if and only if the difference in their arrival times is at most 20 minutes. Let X and Y be their arrival times in minutes after 5 p.m. They meet if |X - Y| <= 20.

    Step 2: Model the sample space.

    Since arrivals are uniform and independent over the 60-minute window, the sample space is a 60x60 square in the XY-plane. The total area is 60 * 60 = 3600.

    Step 3: Compute the probability geometrically.

    The region where they do not meet is where |X - Y| > 20. This consists of two right triangles in the corners of the square. Each triangle has legs of length 60 - 20 = 40.

    Area of one triangle = (1/2) 40 40 = 800.

    Total non-meeting area = 2 * 800 = 1600.

    Meeting area = Total area - Non-meeting area = 3600 - 1600 = 2000.

    Probability = Meeting area / Total area = 2000 / 3600 = 5/9.

    Step 4: Round to two decimal places.

    5/9 = 0.555... which rounds to 0.56.

    Question 5 · Probability Theory SUB

    Let be a discrete random variable with and . Define . Find .

    Correct Answer:

    7

    Step-by-Step Solution

    Key idea: This is a non-linear transformation question. You need where . Since is non-linear, you cannot simply plug in ; you must use LOTUS and the relationship between , , and .

    Step 1: Use linearity of expectation.

    Step 2: Find from the given information.

    We know .

    So .

    Step 3: Substitute back.

    Answer:

    Question 6 · Probability Theory SUB

    5 balls are placed independently and uniformly at random into 5 bins. Let be the number of bins that contain exactly one ball. Find .

    Correct Answer:

    2.048

    Step-by-Step Solution

    Key idea: This is a standard occupancy model question, recognizable because it asks for the expected number of bins satisfying a specific capacity condition (exactly one ball).

    Why it applies: We can define an indicator variable for each bin being in the target state, and use linearity of expectation to sum their probabilities.

    Step 1: Define indicators. Let be 1 if bin contains exactly 1 ball, for .

    Step 2: Calculate the probability for one bin. For bin to have exactly 1 ball, we must choose which of the 5 balls lands in it (5 choices), that ball must land in bin (prob 1/5), and the other 4 balls must NOT land in bin (prob ).

    .

    Step 3: Apply linearity. The total number of bins with exactly 1 ball is .

    .

    Trap: Forgetting the combinatorial factor of 5 for which ball is the single one, or using without multiplying by 5, which gives the probability for a specific ball being the only one, not the bin having exactly one ball.

    Answer: 2.048

    Question 7 · Discrete Mathematics · 2025 SUB
    Three hostel friends Amar, Prem and Raj are suspected of breaking a window. They made the following statements when questioned by the warden:
    • Amar: I did not break it. Prem is lying.
    • Prem: Amar is telling the truth. Raj broke the window.
    • Raj: I did not break it. Either Amar is telling the truth or Prem is telling the truth.
    You know that exactly one of them lied and the other two told the truth. Then, who broke the window? Justify.
    Correct Answer:

    none

    Step-by-Step Solution

    Insight: The global lock "exactly one liar" guarantees at least two truth-tellers, so any disjunction of two speakers' truth-values is automatically . This collapses Raj's OR clause before any casework begins.

    Exam route: Translate all three statements via . Use (from the global constraint) to simplify Raj's claim to . Test the three single-liar cases; only "Prem is the liar" survives, forcing , , . Prem broke the window.

    Learning route:

    This is an exactly-one-liar puzzle with compound statements, recognisable by the phrase "exactly one of them lied" combined with AND/OR connectives inside the spoken claims.

    Step 1: Assign boolean variables. Let represent truth-teller status ( = truth-teller, = liar). Let represent "broke the window" ( = broke it). Exactly one of is .

    Step 2: Translate each statement via the core rule .

    • Amar: "I did not break it AND Prem is lying" .
    • Prem: "Amar is telling the truth AND Raj broke the window" .
    • Raj: "I did not break it AND (Amar is telling the truth OR Prem is telling the truth)" .

    Step 3: Apply the global constraint. Exactly one of is , so at least two are . In every legal assignment, (the only way is if both and , which would be two liars).

    Step 4: Simplify Raj's statement. . So .

    Step 5: Case-split on the single liar.

    • Case 1: . Prem gives . Contradiction. Dead.
    • Case 2: . Amar gives . Contradiction. Dead.
    • Case 3: . Amar gives , so . Raj gives . Since exactly one broke the window and , we get . Verify Prem (liar): . Consistent.

    Wrong path: A student might not simplify Raj's OR clause and instead test Case 2 () and conclude "Raj is the liar, so Raj broke the window." The break occurs at not checking Amar's equation in this case: , which is a contradiction. The case is dead regardless of who broke the window.

    Generalization: In every case, substitute into ALL translated equations, not just the ones that seem relevant. One contradiction kills the entire case.

    Verification: With and : Amar says "I did not break it" (true) AND "Prem is lying" (true) — both true, checks out. Prem says "Amar is telling the truth" (true) AND "Raj broke the window" (false) — conjunction false, checks out. Raj says "I did not break it" (true) AND "Either Amar or Prem is telling the truth" (true) — both true, checks out.

    Answer: Prem broke the window.

    Question 8 · Discrete Mathematics SUB

    In a survey of 70 people about two social media platforms and , it is found that 44 people use , 38 use , and the number of people who use only is exactly 4 more than the number who use neither platform. How many people use exactly one platform?

    Correct Answer:

    30

    Step-by-Step Solution

    Key idea: This is a 2-set problem where a region is linked to the "neither" category, recognisable because the condition relates "P only" to "neither" rather than to another region within the union.

    Step 1: Let both . Then:

    • only
    • only
    • Union
    • Neither

    Step 2: Apply the condition: only Neither .

    Step 3: Compute regions.

    • only
    • only
    • Neither
    • Union

    Step 4: Exactly one only only .

    Step 5: Verify. . only .

    Answer: 30

    Question 9 · Discrete Mathematics MSQ

    Let and . How many injective functions satisfy and ?

    1. A.

      60

    2. B.

      75

    3. C.

      90

    4. D.

      120

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a "counting injections with ordering constraints" problem. The constraints and remove the freedom to permute within pairs. We count by first choosing the image set, then counting valid arrangements.

    Step 1: Choose the image set.

    Since is injective, we choose 4 distinct elements from . Let the chosen set be with .

    Number of ways: .

    Step 2: Count valid assignments for each image set.

    We must assign to such that and .

    • Choose which 2 of the 4 values go to positions : ways.
    • The remaining 2 values go to positions .
    • Within each pair, the ordering constraint forces the assignment: the smaller value goes to the first position, the larger to the second.

    So there are exactly 6 valid assignments per image set.

    Step 3: Multiply.

    Total = .

    Answer: 90

    Question 10 · Programming · 2020 SUB
    For any string str, length(str) returns the length of the string, append(str1,str2) concatenates str1 with another string str2, and trim(str) removes any spaces that exist at the end of the string str. The function reverse(str, i, j) reverses the part of the string from position i to position j. Assume that position 0 refers to the first character in the string. What does the following pseudo-code do?
    def manipulate(string str)
    {
        reverse(str, 0, length(str)-1);
        append(str, ‘ ’);
        n = length(str);
        j = 0;

        for (i = 0; i < n; i=i+1) {
            if (str[i] is ‘ ’) {
                reverse(str, j, i-1);
                j = i + 1;
            }
        }

        trim(str);
        return str;
    }
    Correct Answer:

    0.00

    Step-by-Step Solution

    Insight: This is the classic three-step word reversal algorithm; a global reverse followed by localized word reverses restores word spelling but keeps word order reversed.

    Exam route:

    Step 1: reverse(str, 0, length(str)-1) reverses the entire string. For example, "hello world" becomes "dlrow olleh".

    Step 2: The code appends a space to ensure the last word is processed. It then scans the string for spaces. Whenever it finds a space at index i, it reverses the segment from j to i-1, which corresponds to a single word.

    Step 3: Reversing the whole string reverses the order of the words and also reverses the characters within each word. The loop then reverses each word individually, restoring the characters within each word to their original order, while keeping the words in the reversed sequence.

    Step 4: trim(str) removes the extra space added at the beginning.

    Step 5: The algorithm reverses the sequence of words in the string, leaving the characters inside each word unchanged.

    Defect: The original question asks for a descriptive answer, but the platform requires a NAT numeric answer. The placeholder "0.00" is used.

    Learning route:

    The algorithm leverages the property that reversing a sequence twice restores it. By reversing the entire string, we achieve the desired word order reversal but corrupt the internal spelling of each word. The subsequent loop identifies word boundaries (spaces) and reverses each word segment individually, fixing the spelling without altering the newly established word order.

    Question 11 · Programming · 2024 SUB
    Common Description: Questions 4 and 5 are based on the following description. The following question appeared in a quiz: “Write the code for a function SecondBest() that takes an array and a positive integer as arguments. The elements of are all integers, and is the number of elements in . The call SecondBest() should return the second largest element in . If has no second largest element, then the function should return the special value None.” A student submitted the code below as the answer to this question. In the code the array is indexed from 0. function SecondBest(A, n) { if n == 1 { return(None); } first = A[0]; second = A[1]; for i from 2 to (n-1) { if (A[i] >= first) and (A[i] >= second) { second = first; first = A[i]; } else { if A[i] >= second { second = A[i]; } } } if first != second { return(second); } else { return(None); } } This answer turned out to be wrong; this function gives the correct answer for some valid inputs, and wrong answers for other valid inputs. Answer the next two questions about this function. What do the following function calls return? Briefly explain your answer.
    (a) SecondBest([2,2,3], 3)
    (b) SecondBest([3,2,2], 3)
    Correct Answer:

    none

    Step-by-Step Solution

    Insight: This is an algorithm tracing question, recognizable because it asks for the return value of specific function calls. The method applies here because we must simulate the code execution step-by-step to see if the flawed logic coincidentally produces the correct output.

    Exam route: For (a) : first=2, second=2. . Condition (3 >= 2) and (3 >= 2) is True. second becomes 2, first becomes 3. Returns 2. For (b) : first=3, second=2. . Condition (2 >= 3) is False. Else: 2 >= 2 is True, second becomes 2. Returns 2.

    Learning route:

    Step 1: This is an algorithm tracing question. We apply faithful execution, simulating the code exactly as written.

    Step 2: Trace (a) SecondBest([2, 2, 3], 3).

    • Initialization: first = 2, second = 2.
    • Loop : .
    • Check (3 >= 2) and (3 >= 2) True.
    • Update: second = first (so second = 2), first = 3.
    • End loop. first = 3, second = 2.
    • Final check: 3 != 2 is True. Returns 2.

    Step 3: Trace (b) SecondBest([3, 2, 2], 3).

    • Initialization: first = 3, second = 2.
    • Loop : .
    • Check (2 >= 3) and (2 >= 2) False.
    • Else branch: 2 >= 2 True. second = 2.
    • End loop. first = 3, second = 2.
    • Final check: 3 != 2 is True. Returns 2.

    Wrong path: A student might assume the function returns None for (a) because of duplicate initialization, or 3 for (b) by confusing first and second. Both are incorrect because the specific values trigger different branches that coincidentally yield the correct second largest value (2) in both cases.

    Generalization: Flawed code can still produce correct outputs for specific inputs. Tracing must be mechanical, not assumed.

    Question 12 · Programming MSQ

    Consider the following recursive function defined for non-negative integers :

    ```

    function f(n):

    if n == 0: return 1

    if n == 1: return 2

    return f(n-1) + f(n-2)

    ```

    Assertion (A): is an even number.

    Reason (R): is even for all even .

    Which of the following is correct?

    1. A.

      Both A and R are true, and R is the correct explanation of A

    2. B.

      Both A and R are true, but R is not the correct explanation of A

    3. C.

      A is true, but R is false

    4. D.

      A is false, but R is true

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is an assertion-reason question about a Fibonacci-like sequence. The trap is misreading the base cases, which changes the entire sequence.

    Step 1: Trace to find :

    Step 2: Evaluate Assertion A:

    • , which is even.
    • Therefore, A is true.

    Step 3: Evaluate Reason R:

    • R claims is even for all even .
    • Check : , which is odd.
    • Therefore, R is false.

    Step 4: Conclusion:

    • A is true, but R is false.

    Answer: C

    More CMI Data Science mock tests