Client-Side Routing
How a URL becomes a rendered screen with no page load: a route table, nested outlets, navigation, guards and lazily loaded route code. Interviewers start here because the URL is shared state.
on this pageshowhide
explore
- URL as Application State5 questions
- Route Tables & Typed Params6 questions
- Nested Routes & Layout Outlets6 questions
- Navigation, History & Restoration6 questions
- Guards, Redirects & Access6 questions
- Lazy Routes & Preloading6 questions
questions
page 2 of 2How would you divide access decisions between client route guards and server enforcement across many role-gated screens?
basics
~20 sPolicy gets one owner: the server. It hands the client a computed capability set that guards, menus and links read, so the app stops offering screens that would only fail — while the server authorizes every request.
As the lead on an app with hundreds of lazily loaded routes, how do you decide what preloads, on which signals, and how far ahead?
basics
~20 sTier it by confidence and cost: preload the matched branch on strong intent like hover or focus, nominate a short list of likely-next routes for idle time, leave the long tail to the click, and tune from measured hit rate.
How do you decide how many layout levels a deeply nested route hierarchy needs and what each level owns?
basics
~20 sAdd a level only when something at that depth must persist across navigations below it, own a region of the screen, or scope an access check or data load. URL segments do not by themselves justify levels.
When would a router render two matched branches into separate named outlets at once, and what does that cost?
basics
~20 sUse named outlets when two regions of a screen are independently routable and worth linking to — a list beside a detail, or a persistent side panel. The cost is that one URL must describe several branches at once.
How would you decide whether an app's route table is declared explicitly in code or derived from the project's file layout?
basics
~20 sDecide by how regular the URL surface is and who reads it. Derivation removes registration and makes URLs findable by file; an explicit table makes the whole surface readable and programmable. Either way the effective table must be printable.
showing 31–35 of 35