Atlassian Coding Interview: Support Agent Ratings
Based on questions reported for Atlassian interviews
The interviewer opens
Hi, and thank you for joining. Welcome to your interview for the software engineer role at Atlassian. We'll work through one coding problem together, and I'd like you to think out loud as you code. If you need to step out or take a break, you can pause the interview any time with the Pause button at the top right.
The problem is about building a leaderboard from customer-support ratings, which is the kind of feedback data a support tool like Jira Service Management deals with. It's in the Problem tab on the right, so please read it through, take your time, and ask me any questions before you start.
The problem
Build the leaderboard for a customer-support rating system: given the ratings recorded so far, return every rated agent with their average rating, highest first.
ratings: a list of records{agent, score}in the order they came in;agentis a name,scorean integer from 1 to 5.
Return one record {agent, average} per agent with at least one rating, where average is the mean of that agent's scores (unrounded). Order by average, highest first; agents with equal averages are ordered by name, alphabetically. An empty input gives an empty list.
Example: [{alice,5},{bob,3},{alice,4},{carol,4},{bob,5}] → [{alice,4.5},{bob,4.0},{carol,4.0}]
Up to 10^5 ratings.