Box Coding Interview Questions
31 Box coding interview problems with full optimal solutions — 20 easy, 11 medium, 0 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Box interviewer values, and a FAQ section.
Showing 31 problems of 31
- #20mediumfoundational
20. LRU Cache
Design a Least Recently Used cache with O(1) get and put — Box engineers face this exact tradeoff when caching frequently accessed file metadata and thumbnail previews across their enterprise CDN.
- #21mediumfoundational
21. Number of Islands
Count connected regions in a binary grid — Box uses a structurally identical algorithm to discover isolated file clusters and orphaned permission groups inside enterprise collaboration networks.
- #22mediumfoundational
22. Implement Trie (Prefix Tree)
Build a prefix tree supporting insert, search, and startsWith — the same data structure Box uses to power the instant path-autocomplete in their Drive search bar as users type folder and file names.
- #23mediumfoundational
23. Binary Tree Level Order Traversal
Return all nodes level by level in a binary tree — Box applies BFS traversal to render nested folder hierarchies in their web UI, surfacing each depth layer of a directory tree in order.
- #24mediumfoundational
24. Course Schedule
Detect a cycle in a directed prerequisite graph — Box solves the same problem when validating that enterprise workflow automation rules and folder-permission inheritance chains contain no circular dependencies.
- #25mediumfoundational
25. Merge Intervals
Collapse overlapping time ranges into a minimal set — Box applies this exact algorithm when computing consolidated file-lock windows and audit-trail time ranges across concurrent enterprise users.
- #26mediumfoundational
26. Flatten Nested List Iterator
Produce a lazy iterator over a deeply nested list — this mirrors how Box's content API streams a recursively nested folder tree to clients one file at a time without loading the full hierarchy into memory.
- #27mediumfoundational
27. Meeting Rooms II
Find the minimum number of rooms required for overlapping meetings — Box uses an identical interval-scheduling model to determine peak concurrent file-lock holders and size their distributed lock server fleet.
- #28easyfoundational
28. Lowest Common Ancestor of a Binary Search Tree
Find the deepest node that is an ancestor of two given nodes in a BST — Box uses LCA logic when computing the nearest shared parent folder for two files to determine the effective permission scope for a sharing operation.
- #29mediumfoundational
29. Word Break
Determine if a string can be segmented using a dictionary of valid tokens — Box applies the same DP to validate that composite file paths and auto-generated document slugs can be decomposed into recognized folder and tag components.
- #30mediumfoundational
30. Clone Graph
Deep-clone an undirected graph without duplicating shared nodes — Box uses structurally identical logic when snapshotting a file-permission graph to create an isolated copy for audit trails and compliance exports.
- #31mediumfoundational
31. Find All Anagrams in a String
Return every starting index where a permutation of a pattern appears in a text — Box uses a sliding-window approach identical to this when scanning large file contents for permutations of security-sensitive keyword patterns during compliance checks.
- #1easyfoundational
1. Two Sum
Find two indices in an array whose values sum to a target — Box uses this to filter for hash-map fluency in storage indexing problems.
- #2easyfoundational
2. Valid Parentheses
Validate balanced brackets using a stack — Box uses this pattern when parsing file path tokens and permission expression syntax.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list — Box uses this when merging two sorted streams of file change events during sync reconciliation.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Remove duplicates in place from a sorted array — Box uses this pattern when deduping consecutive file-version events in a sync log.
- #5easyfoundational
5. Remove Element
Remove all occurrences of a target value from an array in place — Box uses this when pruning revoked share links from in-memory permission caches.
- #6easyfoundational
6. Search Insert Position
Find an index in a sorted array using binary search — Box uses this when inserting a new file version into a sorted version-history list.
- #7easyfoundational
7. Plus One
Add one to a number represented as an array of digits — Box uses this pattern when incrementing distributed version counters for files.
- #8easyfoundational
8. Merge Sorted Array
Merge nums2 into nums1 in place — Box uses this when reconciling two sorted change journals during a sync rebase.
- #9easyfoundational
9. Binary Tree Inorder Traversal
Traverse a binary tree in-order — Box uses this pattern when serializing folder trees in sorted order for the file browser.
- #10easyfoundational
10. Same Tree
Determine whether two binary trees are structurally identical with the same values — Box uses this when comparing two folder-tree snapshots during a conflict-resolution merge.
- #11easyfoundational
11. Symmetric Tree
Check whether a binary tree mirrors itself around the center — Box uses this pattern when validating mirrored backup-tree consistency between primary and DR regions.
- #12easyfoundational
12. Maximum Depth of Binary Tree
Compute the maximum depth of a binary tree — Box uses this to bound recursive folder-walk depth for permission propagation.
- #13easyfoundational
13. Balanced Binary Tree
Verify that a binary tree is height-balanced — Box uses this when verifying rebalanced folder-shard trees after a metadata-store split.
- #14easyfoundational
14. Minimum Depth of Binary Tree
Find the minimum depth path to a leaf — Box uses this when computing the shortest path through a permission-inheritance tree.
- #15easyfoundational
15. Pascal's Triangle
Generate the first numRows of Pascal's triangle — Box uses this row-building pattern as a warm-up for index-array manipulation in metadata layouts.
- #16easyfoundational
16. Best Time to Buy and Sell Stock
Maximize profit by choosing one buy day and one later sell day — Box uses this single-pass tracking pattern for cost/savings metrics on the storage dashboard.
- #17easyfoundational
17. Valid Palindrome
Check whether a string reads the same forward and backward after stripping non-alphanumerics — Box uses this two-pointer pattern in their filename-canonicalization fast paths.
- #18easyfoundational
18. Single Number
Find the only element appearing once in an array where every other appears twice — Box uses XOR-style tricks when matching unpaired sync events to detect orphans.
- #19easyfoundational
19. Linked List Cycle
Detect a cycle in a singly linked list — Box uses this idea to spot cyclic symlink references in folder graphs before they crash the indexer.