← NVIDIA Interview Insights

NVIDIA·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

NVIDIA SWE interview with a coding problem that looks like a cache question but has a storage-size twist. The core challenge was building an in-memory disk space manager from scratch, which ended up being more nuanced than I expected once eviction logic came into the picture.

Questions Asked (1)

Q1

Design and implement an in-memory disk space manager that stores datasets by ID with a given size. It has a fixed total capacity, supports put (with eviction if needed) and get operations, and must handle updates to existing datasets.

System DesignAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

My first instinct was LRU cache and I basically started coding before fully thinking through the size-based eviction.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then propose a design using a hash map for O(1) lookups and a doubly linked list for LRU eviction. Discuss trade-offs between eviction policies and concurrency, and outline the implementation details for put, get, and update operations.

Pro tip: Emphasize the importance of handling edge cases like updating an existing dataset with a larger size that triggers eviction, and discuss how to make the design thread-safe for concurrent access.

1. Clarify Requirements

Ask about expected dataset sizes, access patterns, eviction policy preferences, and concurrency requirements to tailor the design.

2. High-Level Design

Propose using a hash map for O(1) access and a doubly linked list to track usage order for LRU eviction, ensuring efficient updates and evictions.

3. Detailed Implementation

Explain how put handles updates (adjust size, update order) and evictions (remove LRU until space), and how get updates recency.

4. Trade-offs and Optimizations

Discuss alternative eviction policies (LFU, FIFO), concurrency strategies (locking, sharding), and potential optimizations like lazy eviction.

5. Testing and Edge Cases

Mention testing scenarios: updating with larger size, evicting multiple items, concurrent access, and handling datasets larger than capacity.

Key Points to Mention

  • Use a hash map for O(1) lookups and a doubly linked list for O(1) eviction and update of recency.
  • LRU eviction policy is a common choice; justify it based on typical access patterns.
  • Handle updates by adjusting total used space and potentially evicting other datasets if the new size exceeds available space.
  • Consider thread-safety with locks or concurrent data structures, and discuss trade-offs.
  • Edge cases: dataset larger than total capacity, updating to a smaller size, and evicting the dataset being updated.
  • Time complexity: O(1) for get and put (amortized for eviction), space complexity O(n).

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