PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/NVIDIA

Implement simple VM manager with CRUD operations

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to design and implement in-memory data models and CRUD APIs with unique-identifier management and consistent error signaling, testing skills in data structures, API/interface design, and algorithmic complexity.

  • medium
  • NVIDIA
  • Coding & Algorithms
  • Software Engineer

Implement simple VM manager with CRUD operations

Company: NVIDIA

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

You are asked to implement a simple **in-memory virtual machine (VM) manager** that can: - List all VMs - Add (create) a new VM - Modify (update) an existing VM - Delete an existing VM Each VM has a set of attributes. For this exercise, you can assume at least the following attributes: - `id` (string or integer, **must be unique**) - `name` (string) - `cpu_cores` (integer) - `memory_gb` (integer) - `status` (string, e.g., `"running"`, `"stopped"`) ### Requirements 1. **Data model & storage** - Choose an appropriate in-memory data structure to store the VMs. - Ensure `id` is treated as the unique identifier for each VM. 2. **API / Interface** Design and implement a small API (in the language of your choice) with at least the following operations: - `create_vm(vm)` - Input: VM attributes (including `id`). - Behavior: Adds a new VM to the manager. - `list_vms()` - Input: none. - Output: a collection/list of all VMs currently stored. - `update_vm(id, updated_fields)` - Input: the `id` of the VM to update, and a set/dictionary of fields to update. - Behavior: Modifies the attributes of the existing VM with the given `id`. - `delete_vm(id)` - Input: the `id` of the VM to delete. - Behavior: Removes the VM with the given `id` from the manager. 3. **Error handling** - If `create_vm` is called with an `id` that already exists, you must detect this and handle it as an error. - If `update_vm` or `delete_vm` is called with an `id` that does **not** exist, you must detect this and handle it as an error. - Define clearly how errors are surfaced (e.g., exceptions, error codes, or special return values) and keep it consistent across methods. 4. **Complexity considerations** - Aim for efficient average-time operations for lookup, update, and delete by `id`. Explain your design choices (data structures and API shape) in brief comments or docstrings within your code.

Quick Answer: This question evaluates a candidate's ability to design and implement in-memory data models and CRUD APIs with unique-identifier management and consistent error signaling, testing skills in data structures, API/interface design, and algorithmic complexity.

Related Interview Questions

  • Return all file paths via DFS - NVIDIA (easy)
  • Implement a disk space manager with eviction - NVIDIA (medium)
  • Implement short algorithms on logs, grids, and strings - NVIDIA (hard)
  • Implement encode/decode for list of strings - NVIDIA (easy)
  • Solve small string and API tasks - NVIDIA (medium)
NVIDIA logo
NVIDIA
Nov 28, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
5
0

You are asked to implement a simple in-memory virtual machine (VM) manager that can:

  • List all VMs
  • Add (create) a new VM
  • Modify (update) an existing VM
  • Delete an existing VM

Each VM has a set of attributes. For this exercise, you can assume at least the following attributes:

  • id (string or integer, must be unique )
  • name (string)
  • cpu_cores (integer)
  • memory_gb (integer)
  • status (string, e.g., "running" , "stopped" )

Requirements

  1. Data model & storage
    • Choose an appropriate in-memory data structure to store the VMs.
    • Ensure id is treated as the unique identifier for each VM.
  2. API / Interface Design and implement a small API (in the language of your choice) with at least the following operations:
    • create_vm(vm)
      • Input: VM attributes (including id ).
      • Behavior: Adds a new VM to the manager.
    • list_vms()
      • Input: none.
      • Output: a collection/list of all VMs currently stored.
    • update_vm(id, updated_fields)
      • Input: the id of the VM to update, and a set/dictionary of fields to update.
      • Behavior: Modifies the attributes of the existing VM with the given id .
    • delete_vm(id)
      • Input: the id of the VM to delete.
      • Behavior: Removes the VM with the given id from the manager.
  3. Error handling
    • If create_vm is called with an id that already exists, you must detect this and handle it as an error.
    • If update_vm or delete_vm is called with an id that does not exist, you must detect this and handle it as an error.
    • Define clearly how errors are surfaced (e.g., exceptions, error codes, or special return values) and keep it consistent across methods.
  4. Complexity considerations
    • Aim for efficient average-time operations for lookup, update, and delete by id .

Explain your design choices (data structures and API shape) in brief comments or docstrings within your code.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More NVIDIA•More Software Engineer•NVIDIA Software Engineer•NVIDIA Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.