Linkedin - Phone Screening (Successful) - Software Engineer role

I interviewed for Software engineer at Linkedin Infrastructure team

YOE - 4.5 years
Previous experience - Worked at Amazon for 4 years in payments domain.
Qualification - BCA

Phone Screening - 60 minutes

First 20 minutes was questions resume and past experience

  • Java basics
  • Process vs Threads

Next 40 minutes was a coding round.

Reverse Deapth of a tree

Imagine a list like [[1], 2]:

Level 1: We find 2. levelSum = 2. totalSum = 2.

Level 2: We find 1. levelSum = 2 + 1 = 3. totalSum = 2 + 3 = 5.

Result: (2 * 2) + (1 * 1) = 5. The integer 2 was at depth 1 from the top, but depth 2 from the bottom.

https://leetcode.com/problems/nested-list-weight-sum/

Solution -

  • Add elements to queue
  • check if its an integer, add it to levelsum
  • if not, addall elements of the list to the queue
  • add levelsum to totalSum.
  • return total sum.
Comments (3)