Addepar 1st Technical Round: SSE Frontend

addepar logo
addepar
· SSE Frontend· 5y exp
September 27, 2026 · 0 reads

Summary

I interviewed for a Software Engineer Frontend position at Addepar, where I was asked to transform a flat array of objects into a hierarchical tree.

Full Experience

YOE: 5+

Core Problem: Flat Object Array to Hierarchical TreeProblem Statement:You are given a flat array of objects. Each object represents an entity with a unique id and a parentId. If an entity has a parentId of null or a specific root value, it is a top-level node. Write an optimal algorithm to convert this flat structure into a deeply nested hierarchical tree.

Input: 

[
  {"id": 1, "name": "Portfolio A", "parentId": null},
  {"id": 2, "name": "Equities US", "parentId": 1},
  {"id": 3, "name": "Tech Stocks", "parentId": 2},
  {"id": 4, "name": "Fixed Income", "parentId": 1},
  {"id": 5, "name": "Global Bonds", "parentId": 4}
]



Output:

[
  {
    "id": 1, "name": "Portfolio A", "children": [
      {
        "id": 2, "name": "Equities US", "children": [
          {"id": 3, "name": "Tech Stocks", "children": []}
        ]
      },
      {
        "id": 4, "name": "Fixed Income", "children": [
          {"id": 5, "name": "Global Bonds", "children": []}
        ]
      }
    ]
  }
]

Interview Questions (1)

1.

Convert Flat Object Array to Hierarchical Tree

Data Structures & Algorithms

You are given a flat array of objects. Each object has an id, name, and parentId. An object with parentId of null (or a designated root value) is a top‑level node. Build an optimal algorithm to convert this flat structure into a deeply nested hierarchical tree.

Input Example:

[
  {"id": 1, "name": "Portfolio A", "parentId": null},
  {"id": 2, "name": "Equities US", "parentId": 1},
  {"id": 3, "name": "Tech Stocks", "parentId": 2},
  {"id": 4, "name": "Fixed Income", "parentId": 1},
  {"id": 5, "name": "Global Bonds", "parentId": 4}
]

Output Example:

[
  {
    "id": 1,
    "name": "Portfolio A",
    "children": [
      {
        "id": 2,
        "name": "Equities US",
        "children": [
          {"id": 3, "name": "Tech Stocks", "children": []}
        ]
      },
      {
        "id": 4,
        "name": "Fixed Income",
        "children": [
          {"id": 5, "name": "Global Bonds", "children": []}
        ]
      }
    ]
  }
]

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!