Hubspot Software Engineer Onsite Coding Questions
5+ questions from real Hubspot Software Engineer Onsite Coding rounds, reported by candidates who interviewed there.
What does the Hubspot Onsite Coding round test?
The Hubspot onsite coding round is the core technical evaluation. Software Engineer candidates typically see 2-3 algorithm and data structure problems. Problems range from medium to hard difficulty, and interviewers evaluate both correctness and code quality.
Top Topics in This Round
Hubspot Software Engineer Onsite Coding Questions
#277 Find the Celebrity
LeetCode #277: Find the Celebrity. Difficulty: Medium. Topics: Two Pointers, Graph Theory, Interactive. Asked at Hubspot in the last 6 months.
#2043 Simple Bank System
LeetCode #2043: Simple Bank System. Difficulty: Medium. Topics: Array, Hash Table, Design, Simulation. Asked at Hubspot in the last 6 months.
HTTP GET Request Implementation - Coding Round
## Problem Implement an HTTP GET request handler. Given a URL string and optional query parameters, construct and send the request, then parse and return the response body as a string. Handle redirects (up to 3 hops) and surface HTTP error codes as exceptions. ```python def http_get(url: str, params: dict = None, timeout_ms: int = 5000) -> str: ... ``` **Example:** ``` Input: url="https://api.example.com/users", params={"page": 1, "limit": 10} Output: '{"users": [...], "total": 42}' Input: url="https://api.example.com/gone" Raises: HTTPError(404, "Not Found") ``` ## Follow-ups 1. How would you add retry logic with exponential backoff for 5xx responses? 2. The API rate-limits at 100 req/min. How do you enforce that client-side across concurrent callers? 3. How would you cache GET responses with TTL invalidation? 4. What changes if you need to stream a large response body instead of buffering it?
## Problem Merge two or more arrays, possibly sorted, into a single result array. ## Likely LeetCode equivalent LC 88 (Merge Sorted Array) is closely related. ## Tags arrays, two_pointers, sorting
## Problem Given a string `s` and an integer `k`, return the substring of length exactly `k` that appears most frequently. If there is a tie, return the lexicographically smallest one. ```python def most_frequent_substring(s: str, k: int) -> str: ... ``` **Example:** ``` Input: s="abcabcabc", k=3 Output: "abc" # appears 3 times Input: s="aabaab", k=2 Output: "aa" # appears 2 times; "aa" < "ab" lexicographically Input: s="abcd", k=5 Output: "" # no valid substring ``` ## Approach Slide a window of size `k` across `s`, counting occurrences in a hash map. Track the max frequency and apply the lexicographic tiebreak in a single pass. Time: O(n*k) naive, O(n) with rolling hash. ## Follow-ups 1. How would you handle the case where `k` equals `len(s)`? 2. Extend to return the top-3 most frequent substrings in order. 3. What data structure would you use if the string is streamed and you need a running answer? 4. How does a rolling hash (Rabin-Karp) improve time complexity here?
See All 5 Questions from This Round
Full question text, answer context, and frequency data for subscribers.
Get Access