Build an Accessible Recursive Expand-and-Collapse Tree in React

Read the full interview experience this question came from →

Quick Overview

Implement an accessible recursive React tree whose expandable branches keep independent state as users toggle other nodes. The exercise covers stable IDs and keys, immutable state updates, leaf behavior, semantic buttons, aria-expanded, keyboard use, data changes, and scaling to deep trees.

Build an Accessible Recursive Expand-and-Collapse Tree in React

Company: Apple

Role: Frontend Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

Overview: Implement an accessible recursive React tree whose expandable branches keep independent state as users toggle other nodes. The exercise covers stable IDs and keys, immutable state updates, leaf behavior, semantic buttons, aria-expanded, keyboard use, data changes, and scaling to deep trees.

Read the full Apple Frontend Engineer interview experience this question came from

|Home/Software Engineering Fundamentals/Apple
Apple logo
Apple
Jul 13, 2026
mediumFrontend EngineerTechnical ScreenSoftware Engineering Fundamentals
4
0
Loading...
Loading comments...