MongoDB Software Engineer Interview Experience
MongoDB · Entry level
Interview process
I think I did pretty decently overall, though I felt there was definitely room for improvement. The technical questions were very appropriate for an Entry Level SWE role, and you could arrive at coherent answers by practicing the 150 Neetcode questions, and using proper application from DSA classes. Though the hiring manager interview at the end was stranger, as it focused more on just general problem solving / knowledge questions as opposed to a full-on behavioural. The behavioural questions I felt I could've done better, mostly because I was unprepared for it and should have spent more time making my responses more coherent.
Interview rounds · 2
- 1
Recruiter screen
Behavioral- Q1. Tell me about a time when you had to mediate a conflict.
- Q2. Tell me about a technical challenge that you have overcome.
- 2
Technical round
TechnicalData Structures & AlgorithmsBehavioralCoding- Q1. Valid Parentheses
Q2. # Problem Statement: Dynamic Product Queue Design a data structure that maintains a list of integers and supports efficient product calculation. The structure follows a **First-In-First-Out (FIFO)** eviction policy. --- ### Functional Requirements | Method | Description | | :--- | :--- | | **`insert(x: int)`** | Adds a new integer `x` to the end of the list. | | **`query() -> int`** | Returns the product of **all** current elements in the list. | | **`evict()`** | Removes the **oldest** element currently in the list. | --- ### Constraints & Goals * **Efficiency:** The product should not be recalculated from scratch during every `query` or `insert`. Aim for $O(1)$ time complexity for all operations where possible. * **The Zero Problem:** The solution must correctly handle the presence of `0`, which nullifies the product, and ensure the product recovers correctly once the zero is evicted. * **Precision:** If implementing in a language with fixed-size integers, consider potential overflow. (In Python, this is less of a concern due to arbitrary-precision integers). --- ### Implementation Template ```python from collections import deque class ProductList: def __init__(self): """ Initialize the data structure. """ self.product = 1 self.queue = deque() self.zero_count = 0 def insert(self, x: int) -> None: """ Adds an element to the stream. """ pass def query(self) -> int: """ Returns the product of all elements in the queue. """ pass def evict(self) -> None: """ Removes the oldest element from the queue. """ pass ``` --- ### Example Walkthrough 1. **Insert(2)**: List = `[2]`, Product = **2** 2. **Insert(5)**: List = `[2, 5]`, Product = **10** 3. **Insert(0)**: List = `[2, 5, 0]`, Product = **0** 4. **Insert(3)**: List = `[2, 5, 0, 3]`, Product = **0** 5. **Evict()**: Removes `2`. List = `[5, 0, 3]`, Product = **0** 6. **Evict()**: Removes `5`. List = `[0, 3]`, Product = **0** 7. **Evict()**: Removes `0`. List = `[3]`, Product = **3**
How they answeredclass Productlist:
def __init__(self) -> None:
self.computed = 1
self.index = 0
self.zeroTracker = deque()
self.numberStream = deque()
# 4 -> 3 ->
# the zero is a sort of time bomb
# O(1)
def insert(self, x: int) -> None:
if x != 0:
self.computed *= x
self.index += 1
else:
self.computed = 1
self.zeroTracker.append(self.index)
self.index = 0
self.numberStream.append(x)
# O(1)
def query(self) -> int:
if len(self.zeroTracker) > 0:
return 0
return self.computed
# O(1)
def evict(self) -> None:
if len(self.zeroTracker) == 0:
self.computed = self.computed // self.numberStream[0]
self.numberStream.popleft()
return
front = self.zeroTracker[0]
if front == 0:
self.zeroTracker.popleft()
else:
self.zeroTracker[0] -= 1
self.numberStream.popleft()
- Q3. Tell me about a time when you received negative feedback and how you handled it.
- Q4. What is your favourite programming language and why?
- Q5. Describe a situation where you were given an ambiguous task or vague instructions. How did you go about clarifying the expectations to ensure the project stayed on track?
Tips from the candidate
I think people should focus a lot on technical fundamentals. There was a strong DSA component needed to do well here. You should understand your concepts very well to the point you can recognise the tricks automatically. I suggest taking time to relearn fundamentals at the lower level of Data Structures - do not blindly grind out LC problems, make sure you really know the ins and outs really well. Make sure not to neglect behaviourals - really go and write down your responses in STAR format, and rehearse them mentally and internally - they should be second nature.
Company culture
I think I really liked the hiring manager - I was worried at first since I believed my behavioural interview wasn't the best, but I think I did make up for it in the "technical discussion" afterwards, where we kind of just went through a problem he contrived for incoming hires. I also really liked working with the other two engineers, who just did two DSA technicals, and were very friendly and cooperative, and overall gave a very nice impression of the company.