FastPrepTimed Coin Collection in a 2×N Grid
Problems/Timed Coin Collection in a 2×N Grid

Timed Coin Collection in a 2×N Grid

Atlassian logoAtlassian● HardFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Atlassian full-time online assessment. Our version follows the whole prompt as shown in the report.

Start at the top-left cell of a 2 by n grid at time zero. Move each second to an orthogonally adjacent unvisited cell until every cell has been visited exactly once. Visiting cell (r,c) at time t earns t * coins[r][c]. Return the maximum total.

Function

maxTimedCoins(coins: int[][]) → long

Examples

Example 1

coins = [[1,4,3,2],[2,1,3,2]]return = 77

An optimal route visits top-left, traverses the bottom row to the right, then returns along the top row.

Example 2

coins = [[1,3],[4,2]]return = 19

The route top-left, bottom-left, bottom-right, top-right earns 0+4+4+9.

Constraints

  • 1 <= n <= 100000
  • 1 <= coins[r][c] <= 100000

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

  • Maximum Sum RectangleDeloitte · OADeloitte interview questions
  • Cherry PickupInfosys · OAInfosys interview questions
  • Safest Shortest Path Through a GridSnowflake · OASnowflake interview questions
  • Minimum Cost Path with TeleportationsAmazon · OA
  • Maximum Non-Decreasing Array LengthVisa · OAVisa interview questions
  • Minimum Starting Health in a GridIntuit · OAIntuit interview questions
  • Largest Two Non-Overlapping Buildable SquaresAmerican Express · OAAmerican Express interview questions
  • Constrained Jump SequencesPhonePe · OAPhonePe interview questions
  • Drone Delivery with Battery Swap StationsCisco · OACisco interview questions
  • Maximize CollaborationTikTok · OATikTok 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 long maxTimedCoins(int[][] coins) {
      // Write your code here.
    }

}
Checking account…