Pinterest 00:00:01 Publish the image once and use it on many boards An illustrator saves a kitchen photo to a visual board. Design a Pinterest-style system where pins have board-specific metadata, while the underlying image and its resized versions can be shared. The service checks the person and the limit of 100 pins an hour, and returns a signed address for ten minutes. The store announces the new file. The queue holds the job until a worker confirms it. 150, 236, 474 and 736 pixels wide, in WebP and JPEG, under names made from the image id and the width. An event fills the word index and the vector index. They may lag behind the row. Separate storage completion from search indexing and asynchronous image processing. The first reader needs a clearly defined fallback while a new rendition or search entry is still pending. 00:00:55 Mix a home feed without repeating the same image A returning visitor has new pins from followed boards and many possible recommendations. Pull candidates from several sources, then decide how to mix, deduplicate and paginate them. The person was last here three days ago. Recent pins are read now. Nobody wrote them into this feed beforehand. 40% followed, 40% interests, 15% popular, 5% exploration. No image twice. Later pages will not rank again. Keep the resulting session order stable as the visitor scrolls. The percentages in the exercise are a product experiment, not facts about a real recommendation engine. 00:01:35 Search with a picture instead of a phrase The visitor likes the shape of a kitchen but cannot describe it. An image encoder maps that query to a vector, which can be compared with compatible vectors for existing pins. A kitchen that is hard to describe in words. About 30 ms. It must be the same model version that made the stored vectors. One batch, mostly from the cache. The rest wait for scrolling. A nearest neighbor is a candidate, not a guarantee of relevance or permission. Fetch the rows, check visibility and rerank before showing the gallery. 00:02:07 Reserve space before pictures arrive A masonry grid feels stable when the client knows each image's aspect ratio before its bytes arrive. Place the next pin in the currently shorter column and predict its height. They came with the cards. No picture has loaded yet. With a tile width of one hundred and a width-to-height ratio of one half, the reserved height is two hundred. Another image has a ratio of two, so its reserved height at the same width is fifty. Only pins near the screen are put on the page. The rest are positions. Virtualize distant tiles so a long board does not retain every image in memory. Geometry metadata helps the client reserve space while the image is still being fetched. 00:02:47 Remove an image from every surface The illustrator requests removal of the shared image. One pin, a board card, a search candidate and a CDN rendition may all refer to it. Enumerate those paths before promising when it disappears. One row, however many pins point at it. Every read path checks the state, so cards vanish at once. Cached cards are deleted and the edge is purged by image id, all sizes. Remove indexed text and vectors through durable events. A fingerprint may help identify an exact re-upload; transformed copies require a separate detection and review policy. Apply an authoritative block on serving, then propagate purge and deletion work with retries and auditing. Previously downloaded copies are a separate boundary.