How do I build a JSON tree viewer in a machine coding interview?
Parse the JSON with JSON.parse. Recursively render objects and arrays as collapsible tree nodes. Use a toggle for expand/collapse. Add syntax highlighting (keys, strings, numbers, booleans). Handle invalid JSON with an error message.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Bonus: Advanced Machine Coding Questions to Practice
Chess board with move validation, maze solver visualizer, LRU cache visualizer, form builder (drag and drop), JSON tree viewer, markdown editor with live preview, and kanban board with drag and drop. These test complex state, algorithms, and interactions.
Create columns (To Do, In Progress, Done) with cards. Use the Drag and Drop API to move cards between columns. Track card state (which column, order). Add/edit/delete cards. Re-render on changes. This tests drag-and-drop and multi-list state management.
Create a grid with walls. Implement BFS or DFS. Animate the search (setInterval or requestAnimationFrame) to show visited cells. Highlight the shortest path when found. This tests algorithms and animation.
Still have questions?
Browse all our FAQs or reach out to our support team
