InternDoor

Samsung interview prep

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

Practise them as a timed round

DSA 4

  1. DSAMedium

    Two singly linked lists join at some node and share every node after it. Two pointers walk the lists, and each jumps to the head of the other list when it reaches the end. Why do they meet at the joining node?

    1. Because the two lists always have the same length
    2. Before reaching the shared part, both have walked the same distance: the first list's own nodes plus the second list's own nodes plus the shared tail once
    3. Because one pointer moves twice as fast as the other
    4. They do not; this only detects a cycle
    Show the answer

    B. Before reaching the shared part, both have walked the same distance: the first list's own nodes plus the second list's own nodes plus the shared tail once

    If the lists are a + c and b + c long, with c shared, one pointer walks a + c + b and the other b + c + a before entering the shared part, so they arrive together. O(m + n) time, O(1) space. If the lists never join, both reach null at the same moment.

    This topic is named in a candidate’s interview report: SDE intern interview, 2025, on Reddit.

  2. DSAMedium

    Each element of [2, 3, 1, 1, 4] is the longest jump you can make from that position. What is the fewest jumps needed to reach the last index from index 0?

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

    D. 2

    Jump from index 0 to 1, then from 1 (which reaches up to 4) to the end: 2 jumps. The greedy BFS keeps the farthest reach of the current "level" and counts a jump each time the level ends, O(n).

    This topic is named in a candidate’s interview report: SDE intern interview, 2025, on Reddit.

  3. DSAHard

    Books have [12, 34, 67, 90] pages and must go, in order and without splitting a book, to 2 students. Binary searching on the answer, what is the smallest possible maximum number of pages any student gets?

    1. 113
    2. 157
    3. 101
    4. 90
    Show the answer

    A. 113

    The splits are 12 | 191, 46 | 157 and 113 | 90, so the best maximum is 113. Binary search tries a limit and greedily checks whether 2 students suffice, in O(n log(sum)).

    This topic is named in a candidate’s interview report: SDE intern interview, 2025, on Reddit.

  4. DSAMedium

    Each element of an array is the longest jump allowed from that position. How do you tell in O(n) whether the last index can be reached?

    1. Try every path recursively
    2. Scan once, keeping the farthest index reachable so far; if the scan reaches an index beyond it, the end cannot be reached
    3. Sort the array
    4. Binary search on the jump lengths
    Show the answer

    B. Scan once, keeping the farthest index reachable so far; if the scan reaches an index beyond it, the end cannot be reached

    farthest = max(farthest, i + a[i]) at each i you can stand on. The answer is yes as soon as farthest reaches the last index. [3, 2, 1, 0, 4] fails because nothing passes index 3.

    This topic is named in a candidate’s interview report: SDE intern interview, 2025, on Reddit.

C and C++ 1

  1. C and C++Medium

    What does this print? (Bits are numbered from 0 at the least significant end.)

    #include <stdio.h>
    
    int main(void) {
        unsigned int n = 8192;     /* 2 to the power 13 */
        n ^= (1u << 13);           /* toggle bit 13 */
        printf("%u ", n);
        n ^= (1u << 13);           /* toggle it back */
        printf("%u", n);
        return 0;
    }
    1. 0 8192
    2. 8192 0
    3. 16384 8192
    4. 8192 8192
    Show the answer

    A. 0 8192

    8192 has only bit 13 set, so XOR with 1 << 13 clears it to 0, and XORing again sets it back. If "the thirteenth bit" counts from 1, it is 1 << 12 instead: say which you mean in an interview.

    This topic is named in a candidate’s interview report: SDE intern interview, 2025, on Reddit.

Prep for other employers

All employers
See who is hiring after Samsung

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