← Atlassian Interview Insights

Atlassian·Machine Learning Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
May 2026Remote

Summary

Atlassian ML engineer round that started from a familiar LeetCode problem and then kept pushing further than I expected. The weighted averaging follow-up was fine, but the space optimization discussion is where things got interesting and a little uncomfortable.

Questions Asked (2)

Q1

Given a stream of integers and a window size, modify the standard moving average so that more recent values are weighted more heavily than older ones. How would you implement a weighted moving average?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Started with the straightforward approach, linearly increasing weights assigned by position in the window.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements: window size, weighting scheme (e.g., linear, exponential), and whether the stream is infinite. Then propose an efficient implementation using a data structure like a deque or a circular buffer, and discuss trade-offs between time and space complexity.

Pro tip: Mention that exponential weighting can be implemented in O(1) time and space using a running sum with a decay factor, which is often preferred for real-time ML systems. This shows you understand practical constraints beyond textbook algorithms.

1. Clarify requirements

Ask about window size, weighting scheme (linear, exponential, custom), and whether the stream is bounded or infinite. Confirm if updates need to be real-time.

2. Choose weighting scheme

Decide on a weighting function, such as linearly decreasing weights or exponential decay. Explain how weights are assigned to each position in the window.

3. Design data structure

Use a deque or circular buffer to maintain the window. For exponential weighting, a single running sum with a decay factor suffices.

4. Implement update and query

Describe how to add a new value, evict the oldest, and compute the weighted average. For deque, maintain sum of weights and weighted sum; for exponential, update running sum and weight sum.

5. Analyze complexity and trade-offs

Compare time and space complexity of different approaches. Discuss trade-offs between accuracy, memory, and computational cost.

Key Points to Mention

  • Weighting schemes: linear, exponential, or custom; explain how weights are normalized.
  • Data structures: deque for fixed window, circular buffer for efficiency, or running sum for exponential weighting.
  • Time complexity: O(1) per update for exponential, O(1) amortized for deque with precomputed weights, O(n) for naive recomputation.
  • Space complexity: O(window size) for deque, O(1) for exponential.
  • Handling edge cases: initial window not full, division by zero when sum of weights is zero.
  • Practical considerations: numerical stability, floating-point precision, and suitability for real-time ML pipelines.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Can you optimize the weighted moving average to avoid storing the entire window? Walk through a recurrence-based approach like exponential smoothing, and explain the trade-offs compared to exact weighted averaging.

Algorithms & Data StructuresTechnical Trade-offsSystem Design
Author's notes

This is the part that actually made the interview worth thinking about afterward.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the memory bottleneck of exact weighted moving average (WMA) and then introduce exponential smoothing as a recurrence-based alternative that uses O(1) memory. Walk through the recurrence formula, discuss how it approximates a weighted average with exponentially decaying weights, and compare trade-offs in terms of memory, computation, and fidelity to exact WMA.

Pro tip: Emphasize that exponential smoothing is not just a memory optimization but also a modeling choice—its exponential weighting often aligns better with real-world data where recent observations matter more. Mention that the smoothing factor α controls the trade-off between responsiveness and stability, and that it can be tuned like a hyperparameter.

1. Identify the memory issue

Explain that exact WMA requires storing the entire window of N values, leading to O(N) memory. This can be problematic for large windows or streaming data.

2. Introduce exponential smoothing recurrence

Present the recurrence: S_t = α * X_t + (1 - α) * S_{t-1}, where S_t is the smoothed value, X_t is the new observation, and α is the smoothing factor (0 < α ≤ 1). Highlight that only the previous smoothed value and the new data point are needed, achieving O(1) memory.

3. Relate to weighted moving average

Show that exponential smoothing is equivalent to a weighted average with weights that decay exponentially: w_i = α (1 - α)^i. This means older observations contribute less, but never exactly zero, unlike a fixed window.

4. Discuss trade-offs

Compare exact WMA vs. exponential smoothing: exact WMA gives precise control over window size and weights, but uses O(N) memory and O(N) computation per update (or O(1) with a circular buffer but still O(N) memory). Exponential smoothing uses O(1) memory and O(1) computation per update, but its effective window is infinite (though decaying) and the weighting scheme is fixed to exponential decay. Also, exponential smoothing introduces a bias-variance trade-off controlled by α.

5. Conclude with practical considerations

Mention that the choice depends on the application: if exact WMA with a specific window is required (e.g., for regulatory or exact reporting), then storing the window may be necessary. For real-time streaming or memory-constrained environments, exponential smoothing is often preferred. Also note that other recurrence-based approaches like moving average with a sliding window can be done in O(1) memory using a ring buffer, but still require O(N) memory for the buffer; exponential smoothing is truly O(1).

Key Points to Mention

  • Exact WMA requires O(N) memory to store the window; exponential smoothing uses O(1) memory.
  • Exponential smoothing recurrence: S_t = α X_t + (1-α) S_{t-1}, with α controlling the decay rate.
  • Exponential smoothing is equivalent to a weighted average with exponentially decaying weights.
  • Trade-offs: exact WMA offers precise control over window and weights; exponential smoothing is more memory-efficient but has infinite (decaying) window and fixed exponential weighting.
  • The smoothing factor α can be tuned to balance responsiveness and stability, similar to a hyperparameter.
  • For streaming data or large windows, exponential smoothing is often preferred; for exact windowed averages, a ring buffer may be used but still requires O(N) memory.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.