FastPrepFind Top Two Teams
Problems/Find Top Two Teams

Find Top Two Teams

Autodesk logoAutodesk● EasyFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A community member reported that this exercise appeared in an Autodesk CodeSignal online assessment on September 30, 2026. The report did not include a separate copy of the prompt. Our version is self-contained and keeps the reported ranking rules. The smaller team index breaks the tie only when league points and goal difference are both tied. The original Autodesk wording and the final tie rule were not available. Our version is about 97% the same as the reported question.

Special thanks: 🌷 A special thank you to our lovely, amazing frenz who shared that this question appeared again on September 30, 2026! ૮₍ ˃ ⤙ ˂ ₎ა 💜

The arrays wins, draws, scored, and conceded describe the statistics of n teams. Team i earns 3 * wins[i] + draws[i] league points.

Return the indices of the highest-ranked and second-highest-ranked teams in that order. Rank the teams using these rules:

  1. More league points ranks higher.
  2. If points tie, a larger goal difference scored[i] - conceded[i] ranks higher.
  3. If both tie, the smaller team index ranks higher.

Function

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

Examples

Example 1

wins = [1, 2, 3]draws = [1, 1, 1]scored = [10, 20, 30]conceded = [12, 23, 12]return = [2, 1]

The teams earn 4, 7, and 10 league points. Team 2 ranks first and team 1 ranks second, so the result is [2, 1].

Constraints

  • 2 <= n <= 100000.
  • wins.length == draws.length == scored.length == conceded.length == n.
  • 0 <= wins[i], draws[i], scored[i], conceded[i] <= 10^9.

More Autodesk interview questions

  • Diagonal Bounce TraversalOA · Seen Oct 2026
  • Interleave Array HalvesOA · Seen Oct 2026
  • Latest Arrival to Catch a BusOA · Seen Oct 2026
  • In-Memory Database with TTLOA · Seen Mar 2026
  • Non-Repeating CharacterONSITE INTERVIEW · Seen Nov 2026
  • Remove Trailing ZerosONSITE INTERVIEW · Seen Nov 2026
  • Reverse Linked ListONSITE INTERVIEW · Seen Nov 2026
  • LRU Cache with TTLONSITE INTERVIEW · Seen Oct 2026
  • Deep Merge with a Conflict ResolverONSITE INTERVIEW · Seen Mar 2026

Similar questions at other companies

  • Macaron Order with Set DiscountsShopify · OAShopify interview questions
  • 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

Autodesk interview experiences

  • Autodesk SDE Intern OA and Interviews: 5 Experiences
All Autodesk interview questionsSee Autodesk hiring insights
Saved
class Solution {
    public int[] findTopTwoTeams(int[] wins, int[] draws, int[] scored, int[] conceded) {
      // write your code here
    }

}
Checking account…