HubSpot logo

HubSpot Software Engineer System Design Questions

23 practice questions for HubSpot Software Engineer interviews

HubSpot software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer

No verified questions yet for HubSpot.

system design Hard tree #1

1. Design MarketingAssetLibrary — manage campaign assets with hierarchical storage quotas


Background
HubSpot's Marketing Hub lets marketers work with files used in landing pages, emails, and campaigns. Model an in-memory asset library where campaign folders organize these files and enforce storage budgets. This exercise adapts the progressively extended file-system implementation reported by a HubSpot interview candidate; the quota rules below are exercise-specific, not claims about HubSpot's actual implementation.
Requirements
1. Initialize one folder with ID root and unlimited quota. Files and folders share a global ID namespace. Every non-root item has exactly one parent folder. IDs must be unique among live items; deleting an item permits its ID to be reused.
2. Support creating empty folders and uploading new files. File sizes must be positive integer byte counts. A folder's usage is the sum of the sizes of all files in its entire subtree. A quota of -1 means unlimited; otherwise usage must not exceed the quota, including a quota of zero.
3. Every mutation must be atomic: if it would violate any requirement, return false and change nothing. Invalid operations include missing IDs, a non-folder destination, duplicate IDs on creation, nonpositive file sizes, and quotas below -1. Lowering a quota below current usage fails.
4. Moving an item preserves its ID, contents, and quota. Reject moving root, moving a folder into itself or a descendant, and any move that exceeds a destination ancestor's quota. Moving an item to its existing parent succeeds as a no-op. Common ancestors must be checked against the net change, not a temporary copy of the moved bytes.
5. Deleting an item recursively removes its descendants and releases their storage from all surviving ancestors. Deleting root or a missing item fails. Querying usage returns -1 for a missing ID or a file ID.
6. Maintain cached subtree usage so usage queries are constant-time. Uploads, quota updates, and moves must not scan every file in an affected subtree. Recursive deletion may visit the items being removed.
Class API
  • MarketingAssetLibrary() — initialize the empty library.

  • create_folder(folder_id: str, parent_id: str, quota: int = -1) -> bool — create an empty folder under an existing folder.

  • upload(file_id: str, parent_id: str, size: int) -> bool — create a new file; overwriting an existing ID is not supported.

  • move(item_id: str, destination_id: str) -> bool — move an existing file or folder into a folder.

  • set_quota(folder_id: str, quota: int) -> bool — change a folder's quota, including the root quota.

  • delete(item_id: str) -> bool — recursively delete a non-root item.

  • usage(folder_id: str) -> int — return subtree file bytes, or -1 for an invalid folder ID.


Example 1:
Input sequence, starting with a new library:
[
  ["set_quota", "root", 60],
  ["create_folder", "drafts", "root", 50],
  ["create_folder", "published", "root", 40],
  ["upload", "hero-image", "drafts", 40],
  ["move", "hero-image", "published"],
  ["usage", "root"],
  ["usage", "drafts"],
  ["usage", "published"],
  ["upload", "email-banner", "drafts", 25],
  ["set_quota", "published", 30],
  ["usage", "root"]
]

Output:
[true, true, true, true, true, 40, 0, 40, false, false, 40]

Explanation: Moving the 40-byte image subtracts 40 from drafts and adds 40 to published; the root's net change is zero. Uploading the banner would make root usage 40 + 25 = 65, exceeding 60, so nothing is created. Reducing published to 30 fails because its usage is 40.
Example 2:
Input sequence, starting with a new library:
[
  ["create_folder", "campaign", "root", 100],
  ["create_folder", "email", "campaign", 30],
  ["upload", "logo", "email", 20],
  ["move", "campaign", "email"],
  ["move", "email", "campaign"],
  ["delete", "campaign"],
  ["usage", "root"],
  ["usage", "email"],
  ["upload", "logo", "root", 7],
  ["usage", "logo"],
  ["usage", "root"]
]

Output:
[true, true, true, false, true, true, 0, -1, true, -1, 7]

Explanation: Moving campaign into its descendant would create a cycle and fails. Moving email to its current parent succeeds without changes. Deleting campaign removes both folders and the 20-byte file, freeing the ID logo for reuse.
Constraints:
  • At most 10,000 live items, including root, and 10,000 method calls per instance.

  • IDs are nonempty, case-sensitive strings of at most 100 characters. Arguments have the declared types.

  • Positive file sizes and nonnegative quotas are at most 10^12 bytes; accumulated usage may exceed this value in unlimited folders. Nonpositive sizes and quotas below -1 must be rejected.

  • Calls are single-threaded. Persistence, file contents, permissions, and network access are out of scope.

  • Folder depth may be linear in the number of items; avoid relying on the language's recursion limit.
Want to practise this one?
Create a free account to open the full question and practise HubSpot questions with AI.
Sign up free
system design Medium api design #2

2. Task Management System — Implement a basic task manager

Background: HubSpot is known for its product management and marketing tools, and an effective task management system helps teams stay organized and track their progress efficiently.
Problem statement: Implement a class called TaskManager that allows users to manage tasks. Each task should have an ID, title, description, and a status. The TaskManager should allow adding, removing, and updating tasks, as well as retrieving all tasks in a specified status.
  • Function/class signature:

- def add_task(title: str, description: str) -> int:
- def remove_task(task_id: int) -> bool:
- def update_task(task_id: int, title: Optional[str] = None, description: Optional[str] = None, status: Optional[str] = None) -> bool:
- def get_tasks_by_status(status: str) -> List[Dict[str, Union[int, str]]]:
Example 1:
Input: tm = TaskManager()
tm.add_task("Write documentation", "Create user guides and API docs")
Output: 1
Explanation: A new task is added, and the method returns its ID, which is 1.
Example 2:
Input: tm.update_task(1, status="completed")
Output: True
Explanation: The status of the task with ID 1 is successfully updated to completed.
Constraints:
  • Task titles must be non-empty strings.

  • Task IDs must be unique integers starting from 1.

  • Status must be one of: ['pending', 'in_progress', 'completed'].

  • The maximum number of tasks is 1000.

  • Assume all inputs are valid without additional validations.

Related HubSpot Software Engineer interview prep

Start practicing HubSpot questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free