HSBC Technology India Off Campus OA 2023 Experience | Graph Algorithms Dijkstras Algorithm Shortest Path and Grid Based Optimization

HSBC · Question · Posted Jun 2026

Problem Statement You are given an m x n grid where each cell contains a positive cost. Starting from the top-left cell (0,0), find the minimum total cost required to reach the bottom-right cell (m-1,n-1). You can move in four directions: Up Down Left Right The cost of a path is the sum of all cells visited, including the starting and ending cells. Return the minimum cost required to reach the destination. Example 1 Input grid = [  [1,3,1],  [1,5,1], ...

The full answer & interview discussion are available to premium members.

Log in Create a free account