FastPrepDiagonal Bounce Traversal
Problems/Diagonal Bounce Traversal

Diagonal Bounce Traversal

Autodesk logoAutodesk● EasyINTERNOA

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report names a diagonal-bounce matrix task but omits its full rules. The traversal origin, endpoint and returned sequence are practice assumptions. Approximate source match: 40%.

You are given an integer matrix matrix. Return the values visited by a diagonal path.

For this exercise, assume the path starts at the top-left cell and initially moves down and right. Each step advances one column. Before a step would leave the top or bottom edge, reverse the vertical direction. Stop after visiting the last column.

For a matrix with one row, stay on that row. Return the visited values in order, including the starting cell. The matrix is not changed.

Function

diagonalBounce(matrix: int[][]) → int[]

Examples

Example 1

matrix = [[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15]]return = [1,7,13,9,5]
matrix
01234012345167891021112131415

The visited cells are (0,0), (1,1), (2,2), (1,3), and (0,4). Their values are [1,7,13,9,5].

Example 2

matrix = [[9,8,7]]return = [9,8,7]
matrix
0120987

There is one row, so the path visits its three values from left to right.

Constraints

  • 1 <= matrix.length <= 100
  • 1 <= matrix[r].length <= 1000
  • -10^6 <= matrix[r][c] <= 10^6
  • All rows have the same length.

More Autodesk interview questions

  • Interleave Array HalvesOA · Seen Oct 2026
  • Latest Arrival to Catch a BusOA · Seen Oct 2026
  • Find Top Two TeamsOA · Seen Sep 2026
  • In-Memory Database with TTLOA · Seen Mar 2026
  • LRU Cache with TTLONSITE INTERVIEW · Seen Oct 2026
  • Deep Merge with a Conflict ResolverONSITE INTERVIEW · Seen Mar 2026

Similar questions at other companies

  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Costliest ChocolateRippling · OARippling interview questions
  • Online No-Intercept Linear RegressionTwo Sigma · OATwo Sigma interview questions
  • Plus Mult ArrayIBM · OAIBM interview questions
  • Progressive Tax CalculatorInteractive Brokers · OA
  • 2020 Account Balance with Monthly Card FeesDRW · OADRW interview questions
  • Array Challenge (QR Intern)Akuna Capital · OAAkuna Capital interview questions
  • Latency Bucket CounterDatadog · OA · PHONE SCREENDatadog interview questions
  • First Fibonacci Number at Least the Array SumBitGo · OABitGo interview questions
  • Metro Fare With a Daily CapMicrosoft · OAMicrosoft interview questions

Interview reports that mention this question

  • Autodesk SDE Intern OA and Interviews: 5 Experiences
All Autodesk interview questionsSee Autodesk hiring insights
Saved
class Solution {
    public int[] diagonalBounce(int[][] matrix) {
        // write your code here
    }
}
Checking account…