InternDoor

Cisco interview prep

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

Practise them as a timed round5 roles open at Cisco

DSA 2

  1. DSAHard

    An LFU cache evicts the least frequently used key, breaking ties by the least recently used. What gives O(1) get and put?

    1. A single sorted array of keys by frequency
    2. A binary search tree ordered by frequency, which is O(1)
    3. A hash map from key to node, a hash map from frequency to a doubly linked list of keys with that frequency, and the current minimum frequency
    4. Scanning every key to find the least used one
    Show the answer

    C. A hash map from key to node, a hash map from frequency to a doubly linked list of keys with that frequency, and the current minimum frequency

    A hit moves the key from list f to list f + 1. Each list is in recency order, so evicting takes the oldest key in the min-frequency list, and min resets to 1 when a new key arrives.

    This topic is named in a candidate’s interview report: Technical intern assessment, 2026, on Reddit.

  2. DSAMedium

    Kadane's algorithm finds the maximum sum of a contiguous subarray. For [-2, 1, -3, 4, -1, 2, 1, -5, 4], what is that sum and which indices does it cover?

    1. 6, indices 3 to 6
    2. 7, indices 3 to 8
    3. 5, indices 0 to 6
    4. 4, index 3 only
    Show the answer

    A. 6, indices 3 to 6

    Keep the best sum ending at each index: extend the previous run if it is positive, otherwise start again. The best run is 4, -1, 2, 1 at indices 3 to 6, summing to 6, in one O(n) pass.

    This topic is named in a candidate’s interview report: Technical intern assessment, 2026, on Reddit.

Python 1

  1. PythonMedium

    What does this print?

    def same(a, b):
        if len(a) != len(b):
            return False
        diff = 0
        for x, y in zip(a, b):
            diff |= ord(x) ^ ord(y)
        return diff == 0
    
    print(same("cisco", "cisco"), same("cisco", "cisko"))
    1. True True
    2. True False
    3. False False
    4. False True
    Show the answer

    B. True False

    x ^ y is 0 exactly when two characters are equal, and OR-ing every result keeps any non-zero bit, so diff stays 0 only if all pairs match. "c" ^ "k" is not 0. Walking every character instead of stopping at the first difference is how constant-time comparison of secrets works.

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

C and C++ 2

  1. C and C++Medium

    A non-member function is declared friend inside class Account. Which statement is true?

    1. It can use Account's private and protected members, although it is not a member function and has no this pointer
    2. It becomes a member function of Account
    3. Classes derived from Account inherit the friendship
    4. It can still see only Account's public members
    Show the answer

    A. It can use Account's private and protected members, although it is not a member function and has no this pointer

    friend grants access, not membership. The function is called like any free function and receives the object as an argument. Friendship is neither inherited nor transitive.

    This topic is named in a candidate’s interview report: Summer intern on-campus interview, on GeeksforGeeks.

  2. C and C++Medium

    How do C++ compilers usually make a virtual function call through a base-class pointer reach the right override?

    1. They inline every virtual call
    2. Each object of a class with virtual functions holds a pointer to its class's vtable, a table of function pointers read at run time
    3. They look the function up by name at run time
    4. They generate a template for every derived class
    Show the answer

    B. Each object of a class with virtual functions holds a pointer to its class's vtable, a table of function pointers read at run time

    A call such as p->area() loads the vtable pointer from the object, then the slot for area, then calls it. That indirection is why virtual calls are slightly slower and usually cannot be inlined.

    This topic is named in a candidate’s interview report: Summer intern on-campus interview, on GeeksforGeeks.

Computer networks 5

  1. Computer networksEasy

    At which OSI layer does IP routing happen?

    1. Data link (2)
    2. Network (3)
    3. Transport (4)
    4. Application (7)
    Show the answer

    B. Network (3)

    Routers read IP addresses and forward packets between networks at layer 3. Switches work at layer 2 with MAC addresses.

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

  2. Computer networksMedium

    What is the TTL field in an IP packet for?

    1. Each router lowers it by one and drops the packet at zero, so packets cannot loop forever
    2. It sets how long a website may cache the page
    3. It is the packet's timestamp
    4. It sets the TCP retransmission timeout
    Show the answer

    A. Each router lowers it by one and drops the packet at zero, so packets cannot loop forever

    Time to live is a hop count. A routing loop would otherwise circulate a packet indefinitely. traceroute uses it: it sends packets with TTL 1, 2, 3 and records which router reports each one expired.

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

  3. Computer networksEasy

    How do a hub, a switch and a router differ?

    1. They are three names for the same device
    2. A hub repeats every frame to every port; a switch learns MAC addresses and sends a frame only to the right port; a router forwards packets between networks by IP address
    3. A hub routes by IP, a router by MAC
    4. A switch connects to the internet, a router only within a room
    Show the answer

    B. A hub repeats every frame to every port; a switch learns MAC addresses and sends a frame only to the right port; a router forwards packets between networks by IP address

    A hub works at the physical layer and makes one big collision domain. A switch is a layer 2 device keyed on MAC addresses. A router is layer 3: it reads the destination IP, looks up its routing table and sends the packet toward another network.

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

  4. Computer networksEasy

    What does DHCP do, as against DNS?

    1. DHCP turns domain names into IP addresses; DNS hands out addresses
    2. DHCP gives a joining device its IP address, subnet mask, gateway and DNS server; DNS turns names like cisco.com into IP addresses
    3. Both encrypt traffic
    4. DHCP is the secure version of DNS
    Show the answer

    B. DHCP gives a joining device its IP address, subnet mask, gateway and DNS server; DNS turns names like cisco.com into IP addresses

    A laptop joining Wi-Fi broadcasts a DHCP Discover and gets a lease (Discover, Offer, Request, Acknowledge). Later, every name it looks up goes to the DNS server that lease told it about.

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

  5. Computer networksMedium

    How do the layers of the TCP/IP model line up with the OSI model?

    1. TCP/IP has the same seven layers
    2. TCP/IP's application layer covers OSI application, presentation and session; transport and internet match OSI transport and network; the link layer covers data link and physical
    3. TCP/IP has no transport layer
    4. OSI is what the internet runs on; TCP/IP is only a teaching model
    Show the answer

    B. TCP/IP's application layer covers OSI application, presentation and session; transport and internet match OSI transport and network; the link layer covers data link and physical

    It is the other way round for the last option: the internet runs TCP/IP, and OSI is the seven-layer reference model used to talk about it. HTTP sits in TCP/IP's application layer, TCP and UDP in transport, IP in the internet layer, Ethernet and Wi-Fi in the link layer.

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

Prep for other employers

All employers
See who is hiring after Cisco

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