HubSpot software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
No verified questions yet for HubSpot.
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.-1 means unlimited; otherwise usage must not exceed the quota, including a quota of zero.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.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.root or a missing item fails. Querying usage returns -1 for a missing ID or a file ID.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.[ ["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"] ]
[true, true, true, true, true, 40, 0, 40, false, false, 40]
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:[ ["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"] ]
[true, true, true, false, true, true, 0, -1, true, -1, 7]
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:10^12 bytes; accumulated usage may exceed this value in unlimited folders. Nonpositive sizes and quotas below -1 must be rejected.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.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: tm = TaskManager() tm.add_task("Write documentation", "Create user guides and API docs") 1 1.Example 2: tm.update_task(1, status="completed") True 1 is successfully updated to completed.Constraints: 1. ['pending', 'in_progress', 'completed']. 1000. Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free