Skip to main content

Command Palette

Search for a command to run...

Top 3 General Motors Coding Interview Questions from 2025

Updated
2 min read

Introduction

In this blog post, we'll share the most commonly asked coding interview questions at General Motors. If you don't have months to study for your interviews, you can use AI tools like Chatmagic to generate solutions quickly and efficiently - helping you pass the interviews and get the job offer!

Problem #2: Minimum Path Sum

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time. Example 1: Input: grid = [[1,3,1],[1,5,1],[4,2,1]] Output: 7 Explanation: Because the path 1 → 3 → 1 → 1 → 1 minimizes the sum. Example 2: Input: grid = [[1,2,3],[4,5,6]] Output: 12 Constraints: m == grid.length n == grid[i].length 1 <= m, n <= 200 0 <= grid[i][j] <= 200

Topics: Array, Dynamic Programming, Matrix

Problem #3: Widest Vertical Area Between Two Points Containing No Points

Given n points on a 2D plane where points[i] = [xi, yi], Return the widest vertical area between two points such that no points are inside the area. A vertical area is an area of fixed-width extending infinitely along the y-axis (i.e., infinite height). The widest vertical area is the one with the maximum width. Note that points on the edge of a vertical area are not considered included in the area. Example 1: ​ Input: points = [[8,7],[9,9],[7,4],[9,7]] Output: 1 Explanation: Both the red and the blue area are optimal. Example 2: Input: points = [[3,1],[9,0],[1,0],[1,4],[5,3],[8,8]] Output: 3 Constraints: n == points.length 2 <= n <= 105 points[i].length == 2 0 <= xi, yi <= 109

Topics: Array, Sorting

More from this blog

C

Chatmagic blog

2894 posts

Top 3 General Motors Coding Interview Questions from 2025