Autocoder

LinkedIn Interview Questions and Answers

Last updated 2026-11-19

LinkedIn is a social graph and a feed, so its engineering questions keep returning to graphs, ranking, caching and messaging at scale. This page collects practice questions on those themes, with worked answers and the behavioural questions that usually follow.

They are practice questions in the style of the topics commonly reported for software engineering roles, not copies of any real interview. For the process itself read how to crack the system design interview, and for timed problems see LinkedIn coding round questions.

Rounds as commonly reported

Candidate reports describe a recruiter call, a technical phone screen with one or two coding problems, and then an onsite loop of several rounds: coding, system design for mid-level and senior roles, and a behavioural round. Fresher and early-career loops put more weight on coding and less on design. The exact structure is not published, so treat this as a typical pattern.

What the questions emphasise

Expect graph problems on connections (degrees of separation, mutual connections), data structure design such as iterators and streaming statistics, concurrency basics, and for experienced roles a system design on a feed, notifications or search typeahead. Behavioural questions look for collaboration and ownership.

Hiring status

There is no LinkedIn page on this site and we have no sourced hiring dates or numbers for LinkedIn, so none are stated here. Check LinkedIn's own careers site for current roles, locations and application steps.

LinkedIn Interview Questions and Answers: questions with worked answers

  1. 1

    How do you find the degrees of separation between two members?

    medium

    Model members as nodes and connections as undirected edges, and run breadth-first search from one member until you reach the other; the BFS level is the distance. At LinkedIn scale a single BFS explodes, so run a bidirectional BFS, expanding the smaller frontier each step. This cuts work from roughly b to the power d to 2 times b to the power d/2 for branching factor b. Cap the depth at three since results beyond that are rarely useful.

  2. 2

    Design the LinkedIn news feed.

    hard

    Clarify: ranked posts from connections and followed pages, low latency reads. Two models: fan-out on write pushes a post id into each follower feed list in a cache, fast reads but costly for members with huge followings; fan-out on read pulls recent posts at request time. A hybrid pushes for normal members and pulls for celebrities. A ranking service then scores candidates with features such as recency, affinity and engagement. Store posts in a sharded database, feeds in Redis-like lists, and use a queue to drive fan-out. See system design interview questions.

  3. 3

    Implement a thread-safe bounded blocking queue.

    hard

    Use a lock with two condition variables, notFull and notEmpty. put waits while the queue is full, then enqueues and signals notEmpty. take waits while empty, then dequeues and signals notFull. Always wait in a while loop, not an if, because of spurious wakeups. In Java, ArrayBlockingQueue provides this, but interviewers want to see the mechanism.

    python
    import threading
    from collections import deque
    
    class BoundedQueue:
        def __init__(self, cap):
            self.q, self.cap = deque(), cap
            lock = threading.Lock()
            self.not_full = threading.Condition(lock)
            self.not_empty = threading.Condition(lock)
        def put(self, x):
            with self.not_full:
                while len(self.q) == self.cap:
                    self.not_full.wait()
                self.q.append(x)
                self.not_empty.notify()
        def take(self):
            with self.not_empty:
                while not self.q:
                    self.not_empty.wait()
                x = self.q.popleft()
                self.not_full.notify()
                return x
  4. 4

    How would you build a "People You May Know" feature?

    hard

    Start with candidate generation: friends of friends ranked by the number of mutual connections, found with a graph traversal at depth two. Add other signals such as shared employer, school, or profile views. Rank candidates with a model that predicts the chance of a connection request being sent and accepted. Run the heavy graph computation offline in batch, store top candidates per member, and refresh on connection events. Mention privacy and filtering of blocked or dismissed members.

  5. 5

    Explain the difference between optimistic and pessimistic locking.

    medium

    Pessimistic locking takes a lock before reading and holds it until commit, so conflicts are prevented but concurrency drops and deadlocks are possible. Optimistic locking reads without a lock, stores a version number, and on update checks that the version is unchanged; if not, the update fails and is retried. Use optimistic for low-conflict workloads such as editing a profile, pessimistic where conflicts are frequent and retries are expensive such as inventory counters.

  6. 6

    Find mutual connections of two members given sorted connection id lists.

    easy

    Use two pointers over the sorted lists: advance the smaller value and record equal values. Time O(m + n), space O(1) beyond the output. If one list is far smaller, binary search each of its ids in the larger one for O(m log n). If lists are unsorted, put the smaller into a set.

    python
    def mutual(a, b):
        i = j = 0
        out = []
        while i < len(a) and j < len(b):
            if a[i] == b[j]:
                out.append(a[i]); i += 1; j += 1
            elif a[i] < b[j]:
                i += 1
            else:
                j += 1
        return out
  7. 7

    Design a search typeahead for member names.

    hard

    Build a trie, or a sorted index, over names and store top suggestions at each prefix node, ranked by a popularity or relevance score, so a lookup is O(prefix length). Serve from an in-memory service sharded by prefix range, with a cache for hot prefixes. Update the index in batches from search logs rather than on every keystroke. Debounce requests on the client. Personalise by blending connection-based signals into the score.

  8. 8

    What happens when you type a URL into a browser?

    easy

    DNS resolves the host name through browser cache, OS cache and recursive resolvers. The browser opens a TCP connection, then a TLS handshake negotiates keys; with HTTP/3 this runs over QUIC. It sends an HTTP request, possibly via a CDN and load balancer, the server responds, and the browser parses HTML, fetches CSS, scripts and images, builds the DOM and render tree, and paints. Naming where caching helps scores well.

  9. 9

    Tell me about a time you put the customer or member first.

    easy

    Choose a story where you gave up something for the user, such as delaying a release to fix a data-loss edge case. Describe how you found the issue, the trade-off with the deadline, how you communicated it to your manager, and the result. Quantify it if you can, for example the number of affected records or the drop in support tickets.

  10. 10

    How do you handle a hot key in a cache?

    hard

    A hot key concentrates traffic on one cache node. Options: replicate the hot key across several nodes and read from a random replica, add a small in-process cache with a short time to live in front of the shared cache, or split the key into suffixed copies such as key#1 to key#8 and pick randomly. Use request coalescing so only one request refills an expired entry, which also prevents a thundering herd.

  11. 11

    Describe a time you received difficult feedback.

    easy

    State the feedback honestly, for example that your code reviews were too slow to unblock others. Show what you did: agreed a response-time target, blocked time each day, and asked a teammate for follow-up feedback a month later. Close with the observed change. Do not choose feedback that is secretly a strength.

  12. 12

    Why LinkedIn?

    easy

    Link the answer to the product and the engineering problems: a large professional graph, feed ranking, and search. Name one concrete thing, such as an engineering blog post on a system you found interesting, and say what you want to learn. Avoid generic praise.

Frequently asked questions

Does LinkedIn ask system design to freshers?

Early-career loops are commonly reported to focus on coding. Design rounds are more typical for mid-level and senior roles, but confirm with your recruiter.

Which topics matter most for LinkedIn?

Graphs, data structure design, concurrency basics and, for senior roles, feed and messaging design.

How should I prepare behavioural answers?

Prepare four or five STAR stories covering conflict, failure, ownership, customer focus and learning, and adapt them to each question. See how to crack the behavioural interview.

Where do I find current LinkedIn openings?

On LinkedIn's own careers site. This site has no sourced hiring data for LinkedIn.

Related guides

More in Company Interview Questions

See all in this section