Array

Build array skills from basic operations to interview questions on rearrangement, hashing, subarrays, matrices and sliding windows.

154 online
Overall Progress
PLUS – Videos, editorials, planner all in one place – Videos, editorials, personalised planner & TUFY all in one place to save your time.

Planly

Know more

Striver’s Arrays Sheet contains 69 array coding problems: 19 beginner foundation exercises alongside the retained selection of 50 interview practice questions. The beginner coverage includes printing an array, sum and average, minimum and maximum, linear search, target counts, matrix operations and dynamic arrays. These exercises give basic array operations a place before more involved interview applications.

Use the groups to connect related ideas without assuming every problem in a group has the same solution. A question asking for original positions differs from one asking for values. A longest range differs from a count of all ranges. Reading those requirements carefully is part of the practice, even when the title sounds familiar.

Array topics and coding patterns covered

The foundation practice includes one-dimensional arrays, row and column sums, both diagonals, matrix transpose and a direct matrix search. Dynamic-array exercises cover reading and printing a list, changing values, keeping selected elements and removing elements. Counting a specified target is a different requirement from finding the most frequent value, and returning both minimum and maximum differs from returning only the largest element.

  • One-dimensional array input, output, scans, target counts and reversal.
  • Matrix printing, row and column totals, diagonals, transpose and search.
  • Dynamic arrays, followed by the retained interview problems on rearrangement, subarrays and combined patterns.

Beginner lessons and prerequisites

The linked beginner lessons explain one-dimensional arrays, declaration and initialization, indexing, traversal and functions that receive arrays. Separate lessons cover multidimensional arrays and vectors. Be comfortable with input, loops and functions before starting these topic-specific exercises.

Be comfortable with zero-based indexing, loops and function inputs. Explain the difference between changing an existing value and inserting another element. A known index supports direct access, while finding an unknown value may require a scan. If these operations are unfamiliar, trace them on a small array before adding several pointers or a map.

  • Keep positions separate from the values stored at those positions.
  • Check whether the result is returned or written into the original input.
  • Recognize subarrays, subsequences and subsets before selecting a method.