LinkedIn | SWE | Bangalore

Anonymous User
2401
Feb 24, 2024
Feb 24, 2024

Background:

  • Position : SDE2 in a Product Based Company
  • Experience : 2.5 yrs

Screening Theoretical Questions:

  1. Project Discussion and Technical Challenges
  2. Virtual Memory
  3. Transaction and ACID
  4. Locking & Isolation Levels
  5. TCP vs UDP
  6. Threads vs Processes
  7. Multithreading and Concurrency Pros and Cons
  8. Semaphores and Critical Section

Screening Coding Question:

Imagine you have a string of letters. You want to divide it into pieces so that each piece contains unique letters (no letter appears in more than one piece). When put together, the pieces should form the original string. Find the max number of pieces possible and their lengths.

Input: s = "ecedfdfaa"

Output: [3, 4, 2]

Explanation: The pieces are "ece", "dfdf", and "aa".

Algorithm:

Find start and end indices for each character's occurrence in the string.
Sort: Arrange the characters based on their starting indices.
Similar to Merge Intervals:
    Iterate through the sorted characters.
    Check for overlaps with the previous piece.
    If no overlap, start a new piece.
    If overlap, update the current piece's length.
The final list of lengths represents the desired output.

Complexity: O(n log b), where n is the string length and b is the number of unique characters. The same solution can be extended for an O(n + b) solution.

Onsite Coding 1:

  • Check if an undirected graph is a tree : The graph should have only 1 connected component and no cycles
  • Implement a Max Stack (maximum element retrieval) : Standard problem

Onsite Coding 2:

  • Given an n-ary tree, implement a function to recursively remove leaf nodes from the tree : I had discussed about Kahn's algorithm and a standard DFS based approach that retrieves nodes on the basis of height.
  • Given two LinkedIn profiles, find their level of connectivity (1st, 2nd, or 3rd degree connections). Consider scenarios where one profile has many connections and the other has fewer : We can start a concurrent BFS from both source and destination (This solution works best for shortest paths in an infinite graph with obstacles)

Concurrency:

Implement a concurrent solution using a producer-consumer pattern with n producers and n consumers in a publisher-subscriber model.

Managerial Round:

Deep dive into past projects.
Problem: Design a monitoring system to check the correctness of output for a system with unknown output behavior.
Solution: Separate inputs into classes and create a time series graph for each class. Track the count of inputs over time and set alerts for deviations exceeding a specific threshold. Other statistics like standard deviation, variance, sum, mode, and mean can also be considered.

System Design:

Design a strongly consistent and scalable aggregation system for data pertaining to last 10 minutes.

Comments (7)