LinkedIn Software Engineer Interview Experience — Interviewer Couldn't Follow My One-Pass DFS Trick

LinkedIn·Software Engineer·Sep 2026
Technical ScreenRejectedeasy

Two questions.

The first was to merge an n-ary tree by key -- only nodes that share the same key get merged. It's solvable with DFS. Make sure to ask about the corner cases up front, like whether the root keys are even the same.

The second question was similar in spirit. The interviewer completely did not understand this problem. I wrote out the following conversion formula, which lets you solve it in one DFS pass instead of two:

sum(num * (maxDepth - (the depth of the integer) + 1))
=> sum(num) * (maxDepth + 1) - sum(num*depth)

I explained it until I was blue in the face, but he just could not follow how this formula was derived... His level was honestly pretty bad. He also told me he wasn't very familiar with Python.

For both problems I wrote optimal solutions, walked through the corner cases, and dry-ran the test cases. Got rejected a week later.

Published

Curated and edited by PracHub

Practice the questions from this interview

Discussion

Sign in to join the discussion. The author is notified of every comment.

Loading comments…

Interview at a glance

Company
LinkedIn
Role
Software Engineer
Rounds
Technical Screen
Outcome
Rejected
Difficulty
easy
Interview date
Sep 2026
Questions from this interview
2 questions

Real LinkedIn interview experiences

First-hand reports from LinkedIn candidates — the rounds, the questions they were asked, and how it went.

All 29 LinkedIn interview experiences