Reported March 2024
Trade Desk

Light Sources

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

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

Trade Desk sent you a problem called Light Sources in March 2024, and you've got 24-72 hours to prep. This one doesn't hand you an obvious algorithmic pattern, which means the trick is in how you model the problem space. You're probably dealing with a geometry or simulation angle, where the actual code matters less than spotting what the problem is really asking. StealthCoder sits in the background during the live OA as a safety net if you freeze on the setup.

Pattern and pitfall

Light Sources typically maps to a geometry or simulation problem where you compute visibility, coverage, or distance from one or more light sources in a 2D or 3D space. The trap is overthinking the physics and missing the simple model. Most candidates either treat it as a raw math problem (distance formulas, angle calculations) or miss that it's a shortest-path or reachability variant in disguise. The pattern hinges on whether you're calculating coverage zones, ray tracing, or obstacle-aware visibility. Since no specific pattern was hinted, start by clarifying: are you counting lit cells, finding dark spots, or determining if a point is illuminated. StealthCoder can read the exact problem statement live and suggest the right approach while you're in the OA.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Light Sources 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. If you're reading this with an OA window open, you're who this was built for.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Trade Desk's OA.

Trade Desk reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Light Sources FAQ

Is this a math problem or a graph problem?+

Light Sources is usually hybrid. You'll need distance or angle math to model what 'lit' means, then apply a traversal or flood-fill to find which cells or regions qualify. Don't assume pure geometry. Test both angles.

What's the trick Trade Desk is testing?+

Often the trick is realizing you don't need to trace rays in full physics detail. Instead, mark cells within a radius or angle, or use BFS from sources to find reachable tiles. Overcomplicating the light physics is the main gotcha.

How do I prep in 48 hours if I don't have the exact problem?+

Practice 2D grid traversal, distance formulas, and BFS. Solve a few problems on visibility or flood-fill. Sketch the problem by hand once you see it live. Understand what 'lit' means in the first 5 minutes.

Are there obstacles, or is it open space?+

The problem statement will clarify. If obstacles exist, you're likely doing BFS with obstacles. If not, it's radius-based or angle-based marking. Don't assume either way until you read it.

Should I use a priority queue or simple BFS?+

Start with simple BFS unless the problem explicitly asks for shortest paths with weighted edges. Trade Desk problems often reward clarity over fancy data structures. Only upgrade if naive traversal times out.

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

OA at Trade Desk?
Invisible during screen share
Get it