← Zettabyte Interview Insights

Zettabyte·Frontend Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Mar 2026

Summary

Coding round for a frontend role at Zettabyte, a GPU cloud company. The whole interview was basically one meaty system design slash algorithms problem about managing a pool of GPU slots. More CS-heavy than I expected for a frontend position.

Questions Asked (1)

Q1

Design and implement a GPU slot allocator with three operations: allocate contiguous slots to a customer using best-fit strategy, release all slots held by a customer (merging adjacent free blocks), and return a map of current slot usage per customer.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

This took up the whole session.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints (e.g., total slots, allocation granularity, concurrency). Then propose a data structure like a balanced BST or sorted list of free blocks for best-fit allocation, and a hash map for customer allocations. Walk through the implementation of each operation, emphasizing time complexity and trade-offs.

Pro tip: Mention that you would use a balanced BST (e.g., TreeMap) to store free blocks keyed by size for O(log n) best-fit search, and a hash map from customer to allocated blocks. Also discuss how to handle fragmentation and potential concurrency issues.

1. Clarify Requirements

Ask about total number of slots, allocation size (fixed or variable), concurrency needs, and expected scale. Confirm that best-fit means choosing the smallest free block that fits.

2. Choose Data Structures

Propose a balanced BST (e.g., TreeMap) keyed by block size to find the best-fit free block quickly, and a hash map from customer ID to a list of allocated blocks. Also maintain a sorted structure of free blocks by address for merging.

3. Implement Allocate

Search the BST for the smallest free block >= requested size. If found, remove it, split if larger, add the remainder back to free structures, and record the allocation for the customer.

4. Implement Release

Retrieve all blocks for the customer, mark them free, and merge with adjacent free blocks. Update the free block structures accordingly.

5. Implement Usage Map

Return a map of customer ID to total slots used, which can be maintained incrementally or computed on demand from the allocation map.

Key Points to Mention

  • Best-fit allocation strategy and its impact on fragmentation
  • Use of balanced BST (e.g., TreeMap) for efficient best-fit search
  • Merging adjacent free blocks to reduce fragmentation
  • Time complexity: O(log n) for allocate and release, O(1) for usage map if maintained
  • Handling concurrency with locks or transactional memory if needed
  • Trade-offs between different data structures (e.g., sorted list vs. BST)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.