FastPrepRank Teams by Votes
Problems/Rank Teams by Votes

Rank Teams by Votes

Atlassian logoAtlassian● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Atlassian full-time online assessment. The report links to the exact Rank Teams by Votes exercise but does not copy its full statement. Our version follows that linked exercise and uses a fixed function interface.

Each vote ranks the same teams from highest to lowest. Rank teams by the number of first-place votes; break ties using second-place votes, then later positions, and finally alphabetical order.

Function

rankTeams(votes: String[]) → String

Examples

Example 1

votes = ["ABC","ACB","ABC","ACB","ACB"]return = "ACB"

Team A is always first; C has more second-place votes than B.

Constraints

  • 1 <= votes.length <= 1000
  • Each vote contains the same distinct uppercase teams.
  • There are at most 26 teams.

More Atlassian Online Assessment questions

  • Planning ProductionOA · Seen Feb 2025
  • K-Means ClusteringOA · Seen Feb 2025
  • Minimum Sorted Erasure OperationsOA · Seen Jun 2024
  • Count Analogous ArraysOA · Seen Mar 2024
  • Get Maximum ScoreOA · Seen Mar 2024
  • Better Compression 🦀OA · Seen Mar 2024
  • Romanizer 🐡OA · Seen Mar 2024
  • Flower Bouquets 💐OA · Seen Mar 2024
  • Binary Search Tree IteratorOA · Seen Nov 2023
  • Binary Tree Level Order TraversalOA · Seen Nov 2023

Similar questions at other companies

  • Top K Frequent ElementsAmazon · OA · PHONE SCREEN
  • Count Servers With No Requests in a Time WindowIBM · OAIBM interview questions
  • Maximum Escape Game ScoreMicrosoft · OAMicrosoft interview questions
  • Minimum Distinct Prefix CostChubb · OAChubb interview questions
  • Minimum Distinct Prefix CostGoldman Sachs · OAGoldman Sachs interview questions
  • Convert Sparse Records to a Filled TableNetflix · OANetflix interview questions
  • Rearrange Songs by AuthorZomato / Eternal · OAZomato / Eternal interview questions
  • Aggregate Paginated Project Run RecordsReplit · OA
  • Efficient TeamsExpedia · OAExpedia interview questions
  • One-Hot String MatrixIntuit · OAIntuit interview questions

Atlassian interview experiences

  • Atlassian MLE Phone Screen: Model Deployment Design: 1 Experience
  • Atlassian Coding Screens and Karat: 3 Experiences (Part 2 of 2)
  • Atlassian Full Stack Interviews: 11 Experiences (Part 1 of 2)
All Atlassian interview questionsSee Atlassian hiring insights
Saved
class Solution {
    public String rankTeams(String[] votes) {
      // Write your code here.
    }

}
Checking account…