FastPrepRank the Top Two Competition Teams
Problems/Rank the Top Two Competition Teams

Rank the Top Two Competition Teams

ZipRecruiter logoZipRecruiter● EasyFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter OA report describes four aligned arrays of team stats, three points per win plus one per draw, goal-difference tie-breaking, and returning the top two indices. We supplied the final index tie rule and limits. Our version is about 94% the same as the reported question.

Four aligned arrays describe each team. Team i earns 3 * wins[i] + draws[i] points and has difference scored[i] - conceded[i].

Rank teams by points descending, then difference descending, then index ascending. Return the indices of the top two teams.

Function

topTwoTeams(wins: int[], draws: int[], scored: int[], conceded: int[]) → int[]

Examples

Example 1

wins = [3,2,1]draws = [0,2,5]scored = [5,5,5]conceded = [1,1,1]return = [0,1]

The primary point totals determine the top two.

Example 2

wins = [2,2,1]draws = [0,0,3]scored = [10,7,9]conceded = [4,4,4]return = [0,2]

Equal points are ordered by larger scored-minus-conceded difference.

Constraints

  • 2 <= wins.length <= 100000
  • All four arrays have equal length and contain values from 0 through 100000.

More ZipRecruiter Online Assessment questions

  • Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
  • Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
  • Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
  • Minimum Changes to Draw a YOA · Seen Oct 2024
  • Apply Binary State OperationsOA · Seen Sep 2024
  • Simulate Orchard Rot SpreadOA · Seen Sep 2024
  • Compare Odd- and Even-Index SumsOA · Seen Sep 2024
  • Coordinate Removals with Column GravityOA · Seen Sep 2024
  • Lexicographically Smallest End ReversalOA · Seen Sep 2024
  • Recursively Expanded Shell Command CountsOA · Seen Sep 2024

Similar questions at other companies

  • Build the Task HierarchyPendo · OA
  • Count User Mentions in Chat MessagesRamp · OARamp interview questions
  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Competition Winner and Runner-Up (Forward Deployed Engineer)Boston Consulting Group · OABoston Consulting Group interview questions
  • Word Frequency Counts in Alphabetical OrderAbridge · OAAbridge interview questions
  • Rank Football TeamsCapital One · OACapital One interview questions
  • Maximum Apples That Fit in a BoxVirtu Financial · OAVirtu Financial interview questions
  • Rank Football TeamsPersona · OAPersona interview questions
  • Meandering ArrayVerisk · OA
  • Minimum Magic Stones After MergesElevenLabs · OAElevenLabs interview questions

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public int[] topTwoTeams(int[] wins, int[] draws, int[] scored, int[] conceded) {
        // Write your code here.
    }

}
Checking account…