Google - Frontend Developer round

Frontend specific round

[Google] - [Senior Fontend Developer] - [3rd round]

Description
Level: Senior
Education: Bachelor’s of Technology
Years of Experience: [6 YOE]
Questions Asked:
Building a Tree UI component (like a file/folder structure) in React / JavaScript that:

Accepts tree data as input

Supports expand/collapse of child nodes

Implements lazy loading for performance

Ensures accessibility (keyboard nav, ARIA roles)

Is fully testable


Follow-up Discussions:

Accessibility improvements (role=“tree”, aria-expanded, keyboard focus)

Lazy loading only when a node is expanded

Handling slow network (add loading indicator)

Usability enhancements (breadcrumbs, search/filter)

Testing strategy (Jest + React Testing Library)

Key test cases: rendering, expand/collapse, lazy load, accessibility, edge cases

Trade-offs of adding data-testid everywhere — pros (stable tests) vs cons (clutter, maintainability)


My Key Points:

Recursive TreeNode component design

Lazy loading with caching for child nodes

Spinner for async feedback

Semantic roles for accessibility

Testing with getByRole, minimal use of data-testid