GFG App
Open App
Browser
Continue

# Amazon Interview Experience for SDE-1

This is a written round on paper for everyone. Three coding questions were given. Two out of three must be correct covering every single edge case to qualify for the next round. Only the most optimal solution was to be considered.

• Maximum Subarray Sum: You have given an array (ARR) of length N, consisting of integers. You have to find the sum of the subarray (including empty subarray) having the maximum sum among all subarrays. A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning, and 0 or more integers from the end of an array.
• Connect n ropes with a minimum cost: You have been given ‘N’ ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to the sum of their lengths. We need to connect the ropes at a minimum cost.
The test data is such that the result will fit into a 32-bit integer.
• Left View of Binary Tree: Given a binary tree. Print the Left View of the Tree.
My Personal Notes arrow_drop_up