PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Atlassian

Merge intervals and design rating APIs

Last updated: May 5, 2026

Quick Overview

This question evaluates algorithmic problem-solving for interval manipulation and stateful data-structure design for maintaining and ordering agent averages, probing skills in sorting/merging, incremental updates, complexity analysis, and deterministic tie-breaking within the Coding & Algorithms domain.

  • medium
  • Atlassian
  • Coding & Algorithms
  • Software Engineer

Merge intervals and design rating APIs

Company: Atlassian

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

### Problem 1: Merge overlapping intervals You are given a list of closed intervals `intervals`, where `intervals[i] = [start_i, end_i]` and `start_i <= end_i`. **Task:** Merge all overlapping intervals and return a new list of non-overlapping intervals that cover the same ranges. **Input:** - `intervals`: an array/list of `[start, end]` pairs (not necessarily sorted) **Output:** - A list of merged, non-overlapping intervals (order can be by increasing start) **Follow-up:** - Support inserting one additional interval `newInterval` into the existing set and return the merged result efficiently. --- ### Problem 2: Implement agent-rating APIs with ordering by average Design and implement a data structure that supports the following APIs for rating “agents” by name. - `rateAgent(name, score)`: record a new rating for the agent `name`. - `name` is a string identifier. - `score` is an integer in `[1, 5]`. - `getTopAgents()`: return a list of agent names sorted by their **current average score** in **descending** order. **Details / requirements:** - Each agent can receive many ratings over time. - The average for an agent is computed over all ratings recorded so far for that agent. - `getTopAgents()` may be called many times; aim for an efficient approach across many operations. - Define a deterministic tie-breaker for equal averages (e.g., by name ascending). **Constraints (assume typical interview scale):** - Up to ~`10^5` total API calls. - Many repeated `getTopAgents()` calls should not require excessive recomputation each time.

Quick Answer: This question evaluates algorithmic problem-solving for interval manipulation and stateful data-structure design for maintaining and ordering agent averages, probing skills in sorting/merging, incremental updates, complexity analysis, and deterministic tie-breaking within the Coding & Algorithms domain.

Related Interview Questions

  • Find a secret word using match feedback - Atlassian (hard)
  • Compute a moving average on a stream - Atlassian (hard)
  • Implement sequential and parallel URL requests - Atlassian (medium)
  • Implement sliding-window rate limiter function - Atlassian (medium)
  • Filter Invalid Data Events - Atlassian (easy)
Atlassian logo
Atlassian
Feb 11, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
5
0
Loading...

Problem 1: Merge overlapping intervals

You are given a list of closed intervals intervals, where intervals[i] = [start_i, end_i] and start_i <= end_i.

Task: Merge all overlapping intervals and return a new list of non-overlapping intervals that cover the same ranges.

Input:

  • intervals : an array/list of [start, end] pairs (not necessarily sorted)

Output:

  • A list of merged, non-overlapping intervals (order can be by increasing start)

Follow-up:

  • Support inserting one additional interval newInterval into the existing set and return the merged result efficiently.

Problem 2: Implement agent-rating APIs with ordering by average

Design and implement a data structure that supports the following APIs for rating “agents” by name.

  • rateAgent(name, score) : record a new rating for the agent name .
    • name is a string identifier.
    • score is an integer in [1, 5] .
  • getTopAgents() : return a list of agent names sorted by their current average score in descending order.

Details / requirements:

  • Each agent can receive many ratings over time.
  • The average for an agent is computed over all ratings recorded so far for that agent.
  • getTopAgents() may be called many times; aim for an efficient approach across many operations.
  • Define a deterministic tie-breaker for equal averages (e.g., by name ascending).

Constraints (assume typical interview scale):

  • Up to ~ 10^5 total API calls.
  • Many repeated getTopAgents() calls should not require excessive recomputation each time.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Atlassian•More Software Engineer•Atlassian Software Engineer•Atlassian Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.