Microsoft SDE Intern Interview Experience
💼 LTIMindtree Interview Experience (On-Campus) | Fresher | 2026
Salesforce SMTS | Interview Experience | Rejected
JPMC | SDE2 (Associate) - Java Backend - Interview Experience + Compensation
Microsoft - SDE2 - Coding Round
Media.net SDE intern question for technical round 1
Summary
I was asked the following coding problem during my technical round 1 for the SDE intern position at Media.net.
Full Experience
During my technical round 1 for the SDE intern position at Media.net, I was presented with the following problem:
Interview Questions (1)
You are given a 2D grid of size m x n, where each cell contains a ball painted with a color, represented by a lowercase English letter ('a' to 'z'). Your goal is to recolor the balls such that:
1. In each row, no color appears more than twice.
2. No two adjacent balls (up, down, left, right) share the same color.
You may recolor any ball using any lowercase letter from 'a' to 'z'
Return the minimum number of recolorings required to make the grid valid according to the constraints.
Example
Input:
grid = [
['a', 'a', 'a'],
['b', 'b', 'b']
]
Output:
2
Explanation:
In row 0: 'a' appears 3 times, which violates the "at most 2 per row" rule.
Recolor one 'a' to another color (say 'c'), and ensure no two adjacent cells have the same color.
Row 1 also needs 1 change.
So, minimum 2 changes required.
Constraints
1. 1 ≤ m, n ≤ 10
2. grid[i][j] is a lowercase English letter ('a' to 'z')