Medium data structure and algorithm practice puzzle.
A tilemap stores a level as a grid, which turns collision into arithmetic. Given a tile map where 1 is solid, the tile size in pixels, and a player's box as x, y, width and height in pixels, return true if the box overlaps any solid tile. Only check the tiles the box covers: the first column is x / size rounded down and the last is (x + w - 1) / size rounded down, and the same for rows. Anything off the edge of the map counts as solid, so the player can't walk out of the world.
Solve it three ways: snap the jigsaw pieces together, fill in the blanks, or type it from scratch against the tests. This one is free.
Every line of the solution comes with a note explaining why it is there, and a step by step replay shows the code running. At level 3, where you type it yourself, you can ask for an AI mock interview on this problem that ends with a hiring manager's scorecard.
Then grow it into a real project with the Software Engineer button: this puzzle becomes the Entity Heatmap, a pipeline you can run and download. See every Software Engineer project.
Browse all 576 puzzles