← LinkedIn Interview Insights

LinkedIn·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

LinkedIn coding screen, one question about parsing a service dependency map and finding which services touch any deleted paths. Pretty straightforward once you see it, but the setup in JSON threw me off at first.

Questions Asked (1)

Q1

You're given a JSON describing services and their read/write path dependencies. Given a list of deleted paths, return all services that read from or write to any of those paths.

Algorithms & Data StructuresAPI & Integrations
Author's notes

My first instinct was to overcomplicate it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the services and their path dependencies as a bipartite graph or inverted index, then for each deleted path, look up all connected services and deduplicate the results. Focus on efficiency by preprocessing the data into a map from path to services, enabling O(1) lookups per deleted path.

Pro tip: Clarify upfront whether the JSON is static or dynamic, and whether the result should be sorted or deduplicated—this shows attention to real-world API design and prevents wasted effort.

1. Clarify requirements and edge cases

Ask about input format, expected output (list vs set, sorted?), handling of duplicate paths, and whether services can have multiple dependencies. Confirm if the JSON is given as a string or already parsed.

2. Parse and preprocess the JSON

Extract services and their read/write paths. Build an inverted index: a hash map where each key is a path and the value is a set of service names that read from or write to that path.

3. Process deleted paths

Iterate through the list of deleted paths, and for each path, look up the corresponding services in the inverted index. Collect all services into a result set to avoid duplicates.

4. Return the result

Convert the result set to a list (optionally sorted) and return it. Discuss time and space complexity: O(P + D) where P is total path dependencies and D is number of deleted paths.

Key Points to Mention

  • Inverted index (path -> services) for efficient lookup
  • Handling both read and write dependencies
  • Deduplication of services across multiple deleted paths
  • Time and space complexity analysis
  • Edge cases: empty deleted paths, paths with no services, duplicate paths in input
  • Scalability considerations for large JSON inputs

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.