Reported March 2024
Morgan Stanleysimulation

Break The Bricks

Reported by candidates from Morgan Stanley's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Morgan Stanley OA. Under 2s to a working solution.
Founder's read

Morgan Stanley sent you a problem called Break The Bricks in March 2024, and you've got 24-72 hours to lock in a solution. The good news: this is a simulation problem with a clear state-space. You track brick positions, ball trajectories, paddle movement, and collision logic. The bad news: off-by-one errors and edge cases are everywhere. This is exactly the kind of problem where StealthCoder becomes your safety net if you blank on the collision math during the live OA.

Pattern and pitfall

Break The Bricks is a brick-breaker game simulation. You'll model a ball moving across a grid or continuous space, detect collisions with bricks and paddle, update state after each tick, and return the game outcome or final score. The pattern is simulation plus geometry: track positions, velocities, and collision boundaries. The trap is sloppy collision detection (walls, paddle corners, brick overlaps). Most candidates overthink the physics or mishandle corner cases like the ball hitting two bricks at once. The algorithmic meat is state management and boundary logic, not algorithmic complexity. If you freeze on collision math during the OA, StealthCoder reads the board and walks you through the state updates in real time.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Break The Bricks cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Morgan Stanley's OA.

Morgan Stanley reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Break The Bricks FAQ

Is this really a hard problem or is it just tedious?+

It's tedious with a nasty collision-detection bite. The core logic is straightforward, but the edge cases (ball clipping corners, multiple simultaneous collisions, paddle at screen edge) trip up most people. It's more about careful implementation than algorithmic insight.

Do I need to use a physics engine?+

No. Morgan Stanley wants simulation logic, not a real physics library. Model the ball as a point or small circle, bricks as rectangles, and detect overlaps per frame. Discrete time steps are fine unless the problem specifies continuous motion.

What's the most common mistake?+

Mishandling the paddle collision or assuming the ball always hits one brick per frame. Also, forgetting to clamp paddle movement to the screen boundaries, or not reversing velocity correctly when the ball bounces off a wall.

How much time should I spend coding vs. planning?+

Spend 10-15 minutes sketching the state variables, collision cases, and update order on paper. Then code. Jumping straight to code on a simulation problem usually means rewriting halfway through.

What if the problem includes gravity or advanced physics?+

It probably doesn't. Morgan Stanley's version is likely arcade-style: constant velocity, simple bounces, no acceleration. If gravity is in the spec, apply it as a constant downward velocity change each frame.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Morgan Stanley.

OA at Morgan Stanley?
Invisible during screen share
Get it