Goldman Sachs | OA | Sonu's Chalk Arrangement | SDE internship + Full Time
GoldmanSachs · Question · Posted Apr 2026
Problem: Sonu's Chalk Arrangement Objective: Sonu wants to arrange his collection of chalks to achieve two objectives: Mimic Ramu's Pattern: Sonu's arrangement must follow the same "increase-decrease" variation order as Ramu's arrangement. Maximize Niceness: Among all arrangements that mimic the pattern, choose the one that results in the highest "overall niceness." Definition of Niceness: The "niceness" of an arrangement of N chalks with heights (h1,h2,hn) is the sum of the absolute differences between adjacent chalks: Niceness=i=1∑N−1∣hi−hi+1∣ Pattern Mimicry If Ramu's ...
The full answer & interview discussion are available to premium members.
Log in Create a free account