InternDoor

Capgemini interview prep

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

Practise them as a timed round8 roles open at Capgemini Engineering

DSA 2

  1. DSAEasy

    Bubble sort stops early if a full pass makes no swaps. What are its best-case and worst-case running times?

    1. O(n log n) in both cases
    2. O(n) when the input is already sorted, O(n^2) in the worst case
    3. O(1) best case, O(n) worst case
    4. O(n^2) in both cases, even with the early stop
    Show the answer

    B. O(n) when the input is already sorted, O(n^2) in the worst case

    On sorted input the first pass makes n - 1 comparisons and no swaps, so the loop ends: O(n). Reverse-sorted input needs about n^2 / 2 comparisons and swaps.

    This topic is named in a candidate’s interview report: Analyst (A4) on-campus interview, 2022, on GeeksforGeeks.

  2. DSAMedium

    Bubble sort swaps adjacent elements that are out of order. How many swaps does it make in total to sort [4, 3, 2, 1]?

    1. 3
    2. 4
    3. 6
    4. 12
    Show the answer

    C. 6

    Each swap fixes exactly one inverted pair, and [4, 3, 2, 1] has every one of its 4 * 3 / 2 = 6 pairs inverted, so 6 swaps.

    This topic is named in a candidate’s interview report: Analyst (A4) on-campus interview, 2022, on GeeksforGeeks.

Python 3

  1. PythonEasy

    Which of these built-in types is immutable?

    1. list
    2. dict
    3. tuple
    4. set
    Show the answer

    C. tuple

    A tuple cannot be changed after it is created, which is also why it can be a dictionary key. Lists, dicts and sets can all be modified in place.

    This topic is named in a candidate’s interview report: Software analyst on-campus interview, 2022, on GeeksforGeeks.

  2. PythonEasy

    What does this print?

    def is_prime(n):
        if n < 2:
            return False
        i = 2
        while i * i <= n:
            if n % i == 0:
                return False
            i += 1
        return True
    
    print([n for n in range(10, 30) if is_prime(n)])
    1. [11, 13, 17, 19, 23, 29]
    2. [11, 13, 17, 19, 21, 23, 27, 29]
    3. [10, 11, 13, 17, 19, 23, 29]
    4. [13, 17, 19, 23]
    Show the answer

    A. [11, 13, 17, 19, 23, 29]

    range(10, 30) stops at 29. Testing divisors only up to the square root is enough, because a factor larger than the root pairs with one smaller than it: O(sqrt n) per number.

    This topic is named in a candidate’s interview report: Software analyst on-campus interview, 2022, on GeeksforGeeks.

  3. PythonMedium

    What does this print?

    a = [3, 8, 5, 2, 7, 4]
    i, j = 0, len(a) - 1
    while i < j:
        if a[i] % 2 == 0:
            i += 1
        elif a[j] % 2 == 1:
            j -= 1
        else:
            a[i], a[j] = a[j], a[i]
    print(a)
    1. [4, 8, 2, 5, 7, 3]
    2. [2, 4, 8, 3, 5, 7]
    3. [3, 5, 7, 2, 4, 8]
    4. [4, 8, 2, 3, 5, 7]
    Show the answer

    A. [4, 8, 2, 5, 7, 3]

    Two pointers move inwards: an even number on the left stays, an odd number on the right stays, and otherwise the pair is swapped. Evens end up left and odds right in one pass, though not in sorted order.

    This topic is named in a candidate’s interview report: Software engineer campus interview, 2026, on Reddit.

DBMS and SQL 1

  1. DBMS and SQLMedium

    In a data warehouse, what is a star schema?

    1. A schema where every table references every other table
    2. A fully normalised schema in third normal form
    3. A table with a star (*) in every column
    4. One central fact table of measurements, such as sales, joined to dimension tables such as date, product and store
    Show the answer

    D. One central fact table of measurements, such as sales, joined to dimension tables such as date, product and store

    The fact table holds the numbers and foreign keys; the denormalised dimensions describe them. Queries then need few joins. Normalising the dimensions further gives a snowflake schema.

    This topic is named in a candidate’s interview report: Software engineer campus interview, 2026, on Reddit.

Computer networks 1

  1. Computer networksEasy

    You type a URL such as https://example.com into a browser that has never visited it. What happens first?

    1. The browser renders the HTML
    2. The server sends cookies
    3. A DNS lookup turns example.com into an IP address
    4. The browser runs the page's JavaScript
    Show the answer

    C. A DNS lookup turns example.com into an IP address

    Then come a TCP connection (and a TLS handshake for https), the HTTP request, the server's response and finally parsing and rendering, which fetch further resources the same way.

    This topic is named in a candidate’s interview report: Software engineer campus interview, 2026, on Reddit.

Machine learning 1

  1. Machine learningHard

    A retrieval-augmented generation system must find the most relevant passages among millions of documents for each question. Which data structure is usually used?

    1. A linked list of documents scanned in order
    2. A binary search tree keyed by document title
    3. An approximate nearest-neighbour index, such as HNSW, over embedding vectors of document chunks
    4. A stack of the most recent documents
    Show the answer

    C. An approximate nearest-neighbour index, such as HNSW, over embedding vectors of document chunks

    Each chunk becomes an embedding; the question's embedding is compared with them. Exact search over millions is too slow, so ANN indexes trade a little recall for millisecond lookups, often combined with keyword search.

    This topic is named in a candidate’s interview report: Software engineer campus interview, 2026, on Reddit.

Software engineering 1

  1. Software engineeringMedium

    A website on one server stops responding once about 1,000 users are on it. Which change usually fixes this kind of limit?

    1. Adding more pages to the site
    2. Restarting the server every hour
    3. Making the logo smaller
    4. Running several copies of the app behind a load balancer, with a cache and connection pooling in front of the database
    Show the answer

    D. Running several copies of the app behind a load balancer, with a cache and connection pooling in front of the database

    Find the bottleneck first (CPU, memory, database connections). Horizontal scaling needs stateless app servers, so sessions move to a shared store such as Redis.

    This topic is named in a candidate’s interview report: Software engineer campus interview, 2026, on Reddit.

Prep for other employers

All employers
See who is hiring after Capgemini

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