American Express On-Campus OA Experience (2026) | Summer Internship
Anonymous User
179

Appeared for the American Express on-campus OA on 13th August 2026 for the Summer Internship role. The coding round had 3 questions, and it was quite implementation-heavy overall. I don't remember the 3rd question well.

Question 1

Given an array A of n integers (both positive and negative), choose two contiguous fragments — one of size K and one of size L. The two fragments may overlap. Each element contributes to the final sum only once: if it lies in only one of the two fragments, it's added with its original sign; if it lies in both fragments, it's added with its sign flipped (negated). Find the maximum possible sum.

Function signature: int solution(vector &A, int K, int L)

Example: A = [1, 3, -4, 2, -2], K = 3, L = 2
Fragments: [1, 3, -4] (indices 0-2) and [-4, 2] (indices 2-3)
Index 2 (-4) is shared → contributes as +4
Result: 1 + 3 + 4 + 2 = 10

Closest LeetCode: 1031 (Maximum Sum of Two Non-Overlapping Subarrays) — but this variant allows overlap with a sign-flip twist, so it's a harder version.

Question 2

Given an N x M boolean grid representing a map, where A[R][C] = true means a solar power plant can be built on that cell, and false means it cannot. Place two square-shaped power plants such that:

Both squares are the same size
Every cell inside each square is true
The two squares do not share any cell (no overlap)
A single cell (1×1) counts as a valid square

Find the maximum possible side length of the two equal squares. Constraints: N, M ≤ 700.

Closest LeetCode: 221 (Maximal Square) — but this only covers the base DP

Comments (1)