InternDoor

Swiggy interview prep

5 practice questions on the topics candidates reported from Swiggy interviews, with answers. The questions are ours; each one links to the interview report that names its topic.

Practise them as a timed round1 role open at Swiggy

Python 1

  1. PythonMedium

    What does this print?

    import pandas as pd
    
    df = pd.DataFrame({"city": ["Pune", "Delhi", "Pune", "Delhi", "Pune"],
                       "orders": [10, 4, 6, 8, 2]})
    print(df.groupby("city")["orders"].mean().to_dict())
    1. {'Delhi': 6.0, 'Pune': 6.0}
    2. {'Pune': 18, 'Delhi': 12}
    3. {'Delhi': 12, 'Pune': 18}
    4. {'Delhi': 4.0, 'Pune': 10.0}
    Show the answer

    A. {'Delhi': 6.0, 'Pune': 6.0}

    groupby collects the rows per city and mean averages each group: Delhi (4 + 8) / 2 = 6.0 and Pune (10 + 6 + 2) / 3 = 6.0. Groups come out sorted by key. .sum() would give 12 and 18.

    This topic is named in a candidate’s interview report: Associate data scientist interview, 2025, on Reddit.

DBMS and SQL 1

  1. DBMS and SQLMedium

    What does a FULL OUTER JOIN of tables A and B return?

    1. Only rows that match in both
    2. Every row from both tables: matched rows joined, and unmatched rows from either side with NULLs for the other side's columns
    3. Every row from A only
    4. Every combination of rows from A and B
    Show the answer

    B. Every row from both tables: matched rows joined, and unmatched rows from either side with NULLs for the other side's columns

    INNER keeps matches only, LEFT adds unmatched A rows, RIGHT adds unmatched B rows, FULL adds both. Every combination is a CROSS JOIN. MySQL has no FULL OUTER JOIN and emulates it with a LEFT JOIN UNION a RIGHT JOIN.

    This topic is named in a candidate’s interview report: Associate data scientist interview, 2025, on Reddit.

Machine learning 3

  1. Machine learningMedium

    A classifier has 40 true positives, 10 false positives, 20 false negatives and 30 true negatives. What is its precision?

    1. 0.67
    2. 0.80
    3. 0.70
    4. 0.57
    Show the answer

    B. 0.80

    Precision is TP / (TP + FP): of everything predicted positive, the share that really was. 40 / (40 + 10) = 0.80.

    This topic is named in a candidate’s interview report: Associate data scientist interview, 2025, on Reddit.

  2. Machine learningMedium

    Same classifier: 40 true positives, 10 false positives, 20 false negatives, 30 true negatives. What is its recall?

    1. 0.67
    2. 0.80
    3. 0.70
    4. 0.75
    Show the answer

    A. 0.67

    Recall is TP / (TP + FN): of all the real positives, the share the model found. 40 / (40 + 20) = 0.67.

    This topic is named in a candidate’s interview report: Associate data scientist interview, 2025, on Reddit.

  3. Machine learningMedium

    How does a random forest differ from a gradient-boosted model such as LightGBM?

    1. A random forest averages many independent deep trees built on random samples (bagging); boosting builds shallow trees one after another, each fitting the errors of those before
    2. A random forest uses a single tree
    3. LightGBM cannot use decision trees
    4. They are the same algorithm
    Show the answer

    A. A random forest averages many independent deep trees built on random samples (bagging); boosting builds shallow trees one after another, each fitting the errors of those before

    Bagging mainly reduces variance and is hard to overfit; boosting reduces bias and is often more accurate on tabular data but needs tuning, such as the learning rate and early stopping.

    This topic is named in a candidate’s interview report: Associate data scientist interview, 2025, on Reddit.

Prep for other employers

All employers
See who is hiring after Swiggy

Engineering internships and entry-level jobs in India, newest first.