Grokking the Modern Frontend System Design Interview
0% completed
Exercise: Place Photos in the Shortest Column
Design a Masonry Photo Grid placed Lumen's photos with a small layout engine. It walks the photos in order and puts each one at the bottom of the column that is shortest at that moment. This exercise writes the part of that engine that chooses the column.
The Task
Write placeTiles(tileHeights, columns, gap), which returns the column chosen for each tile.
tileHeightsholds the height of each tile in pixels, in the order the photos arrived.- `columns
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%