← Atlassian Interview Insights

Atlassian·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Atlassian Data Scientist interview with a coding question that required both a Python pandas solution and an R equivalent for labeling game outcomes. Pretty technical for a DS role but not unreasonable if you know your vectorized operations.

Questions Asked (1)

Q1

Given a games DataFrame with columns for team IDs and scores, write a function that categorizes each game's score margin into labels like 'Blowout Win', 'Close Win', 'Tie', 'Close Loss', or 'Blowout Loss'. Then apply it to create a new column, and provide both a vectorized pandas solution (no row-level Python loops) and an idiomatic R solution using dplyr or base R.

Product Analytics & MetricsAlgorithms & Data StructuresTechnical Trade-offs
Author's notes

The part that tripped me up initially was the 'no per-row Python loop' constraint.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the score margin definition and thresholds for each label, then present a vectorized pandas solution using numpy.select or pd.cut, and finally provide an idiomatic R solution using dplyr::case_when or base R's ifelse. Emphasize avoiding row-level loops and discuss trade-offs like readability, performance, and maintainability.

Pro tip: Mention that vectorized operations are not just faster but also more idiomatic in pandas and R, and that using pd.cut or case_when makes the code self-documenting and easy to adjust thresholds.

1. Clarify requirements and edge cases

Confirm the definition of score margin (e.g., home_score - away_score) and the exact thresholds for each label (e.g., >10 for Blowout Win, 1-10 for Close Win, 0 for Tie, etc.). Ask about handling missing values or ties.

2. Design vectorized pandas solution

Use numpy.select with conditions and choices, or pd.cut with bins and labels, to categorize the margin column without row-wise apply. Assign the result to a new column.

3. Design idiomatic R solution

Use dplyr::mutate with case_when for clear, vectorized conditional logic, or base R's ifelse for a compact solution. Ensure the margin is computed and categorized in one pipeline.

4. Compare and discuss trade-offs

Highlight performance benefits of vectorization, readability differences between pandas and R approaches, and how each solution scales with large DataFrames.

Key Points to Mention

  • Vectorization avoids slow Python loops and leverages C-level operations in pandas/numpy.
  • pd.cut is ideal for fixed bins, while numpy.select handles arbitrary conditions.
  • dplyr::case_when is the tidyverse standard for multiple conditions and is more readable than nested ifelse.
  • Base R's ifelse can be used but may become unwieldy with many conditions.
  • Thresholds should be configurable (e.g., as parameters) for reusability.
  • Always consider edge cases like ties, missing scores, and negative margins.

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