PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Atlassian

Implement agent voting with average and sorting

Last updated: May 17, 2026

Quick Overview

This question evaluates the ability to design in-memory data structures and algorithms for recording and aggregating agent votes, including computing average ratings, sorting by aggregate score with tie-breaking, handling update semantics for repeated votes, and accounting for items with no votes.

  • medium
  • Atlassian
  • Coding & Algorithms
  • Software Engineer

Implement agent voting with average and sorting

Company: Atlassian

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Design an in-memory “agent voting” module that records ratings agents give to items (e.g., tickets/articles). Requirements: - Each vote is: `(agentId, itemId, rating)` where `rating` is an integer (e.g., 1–5). - Support computing the **average rating** for a given `itemId`. - Support returning items **sorted by average rating** (descending). Specify how ties are broken (e.g., by `itemId` ascending). Clarify behaviors: - If the same agent votes on the same item multiple times, should the latest vote replace the previous one? - What should be returned for items with no votes? Provide the core data structures and methods, and analyze time/space complexity.

Quick Answer: This question evaluates the ability to design in-memory data structures and algorithms for recording and aggregating agent votes, including computing average ratings, sorting by aggregate score with tie-breaking, handling update semantics for repeated votes, and accounting for items with no votes.

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)
  • Merge intervals and design rating APIs - Atlassian (medium)
Atlassian logo
Atlassian
Jan 5, 2026, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
2
0

Design an in-memory “agent voting” module that records ratings agents give to items (e.g., tickets/articles).

Requirements:

  • Each vote is: (agentId, itemId, rating) where rating is an integer (e.g., 1–5).
  • Support computing the average rating for a given itemId .
  • Support returning items sorted by average rating (descending). Specify how ties are broken (e.g., by itemId ascending).

Clarify behaviors:

  • If the same agent votes on the same item multiple times, should the latest vote replace the previous one?
  • What should be returned for items with no votes?

Provide the core data structures and methods, and analyze time/space complexity.

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.