Grokking the Engineering Manager Coding Interview
Ask Author
Back to course home

0% completed

Vote For New Content
Algorithms to use with the "Array" and "Matrix" data structures

matthew.carnahan1

Jul 5, 2024

The week 1 material introduces the data structures "Arrays" and "Matrices". I don't recall any specific algorithms were covered though. It seems like when running code that exploits an array or matrix, the main takeaways are:

  1. Write the code in a way that minimizes the amount of times it has to loop over the array/matrix.
  2. Write the code in a way that minimizes (and ideally eliminates) duplicate operations. For example, when building an array with cumulative sums, calculate each value as the previous index's cumulative sum, plus the next value.

Does everyone concur with this? Are there any other takeaways for writing code that uses arrays/matrices? Were there specific algorithms that I missed?

2

0

Comments
Comments

On this page

What Is an Array?

Key Points

Why Do We Need Arrays?

Memory Representation of an Array

How Arrays Are Stored in Memory

Memory Layout Example

Static vs. Dynamic Arrays

  1. Static Arrays
  1. Dynamic Arrays
  1. Static Vs. Dynamic Arrays Comparision

Which One Should You Use?

Basic Concepts and Operations in Arrays

  1. Accessing Elements
  1. Inserting Elements
  1. Deleting Elements
  1. Searching for an Element
  1. Updating an Element

Key Considerations for Arrays in Coding Interviews

  1. Validate Assumptions
  1. Handle Boundaries
  1. Efficiency Considerations
  1. Loops & Naming
  1. Algorithm Choice
  1. Testing & Edge Cases
  1. Handling Special Values
  1. Modifying While Iterating
  1. Array Methods