Preparing your design workspace

Loading the problem and your saved attempt…

Design a Pinned Favorites Bar

Model a small, ordered bar of pinned web links and app shortcuts that the user can pin, unpin, reorder, and open.

For this exercise, assume a desktop app shows a favorites bar: one row of shortcuts that the user has pinned, like a browser's bookmarks bar or an operating system taskbar. A favorite is either a web link, which stores a URL, or an app shortcut, which stores the ID of an installed app. Every favorite shows a label.

The user can pin a new favorite at the end of the bar or at a chosen position, unpin a favorite, move a favorite to a new position, and open a favorite. Opening a web link shows the page in the browser, and opening an app shortcut starts the app. Positions count from 1 at the left.

The bar holds at most 10 favorites, the same URL or app can be pinned only once, and the bar keeps exactly the order the user chose.

A request that breaks a rule (the bar is full, the URL or app is already pinned, the favorite does not exist, or the position is out of range) is rejected with a clear result and changes nothing.

If an app shortcut points to an app that is no longer installed, opening it fails with a clear result, and the bar stays as it is. Design the objects, their responsibilities, the interfaces, and the interactions. No code is needed. One follow-up adds folders to the bar.

Drawing the bar, icons, drag-and-drop gestures, saving the bar to disk, syncing between devices, several user profiles, and suggesting favorites from usage are out of scope. Everything runs on one UI thread.