[{"id":"webperformanceadvanced-001","courseId":"web-performance-advanced","domain":"measurement","topic":"Resource timing sequence","prompt":"A page loads a script from its own origin. You read the PerformanceResourceTiming timestamps for that one fetch. Put these timestamps in the order the browser records them.","hint":"Picture the fetch as network work done in sequence, from finding the server to the final byte of the reply.","explain":"A fetch is timed by a series of checkpoints, each taken at a boundary between two kinds of network work. Together they trace a request from its beginning to the point where the reply is complete.","source":"https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming","interaction":{"type":"sort","items":[{"text":"domainLookupStart","why":"Recorded just before the browser starts looking up the server's domain name."},{"text":"connectStart","why":"Recorded just before the browser starts connecting to the server, after the name lookup has finished."},{"text":"requestStart","why":"Recorded just before the browser starts requesting the resource, once the connection is established."},{"text":"responseStart","why":"Recorded immediately after the first byte of the response arrives, which may be an interim response."},{"text":"responseEnd","why":"Recorded immediately after the last byte of the resource arrives or the connection closes, whichever is first."}]},"options":[],"answer":"o:abcde","explanation":"PerformanceResourceTiming lists its timestamps in the order they are recorded for a fetch: domain lookup, connection, request, first response byte, then last response byte.","concept":"PerformanceResourceTiming lists its timestamps in the order they are recorded for a fetch: domain lookup, connection, request, first response byte, then last response byte.","rev":1,"updatedAt":"2026-10-27","kind":"scenario","takeaways":["Resource timestamps are recorded in sequence, so the gap between neighbouring ones shows where a fetch spent its time."]},{"id":"webperformanceadvanced-002","courseId":"web-performance-advanced","domain":"measurement","topic":"Long Animation Frames","prompt":"You report long animation frames to your analytics, but only those where a user's input landed during the frame. Which check on a long animation frame entry selects them?","hint":"Duration alone can't tell you whether a user did something during the frame.","explain":"Long frames are judged by how long they ran, but a useful report also needs the cause. Entries carry more fields than their length, and some fields stay empty unless a certain event landed in the frame.","source":"https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/Long_animation_frame_timing","interaction":{"type":"single"},"options":[{"id":"a","text":"entry.firstUIEventTimestamp > 0","why":"That field is set when a UI event occurs during the frame, so a value above zero flags an interaction."},{"id":"b","text":"entry.scripts.length > 0","whyNot":"Scripts running during a frame don't show whether user input arrived; many frames without input run scripts too."},{"id":"c","text":"entry.duration > 50","whyNot":"A 50 ms threshold is the Long Tasks cutoff; it finds long frames but says nothing about user input."},{"id":"d","text":"entry.startTime > 0","whyNot":"startTime is set on every entry, so this check passes for all frames and selects nothing in particular."}],"answer":"a","explanation":"A long animation frame's firstUIEventTimestamp is set when a UI event occurs during the frame, so its presence detects frames where an interaction happened.","concept":"A long animation frame's firstUIEventTimestamp is set when a UI event occurs during the frame, so its presence detects frames where an interaction happened.","rev":1,"updatedAt":"2026-10-27","kind":"scenario","takeaways":["Filter long frames on interaction fields, not just duration, to find the stalls users actually felt."]},{"id":"webperformanceadvanced-003","courseId":"web-performance-advanced","domain":"measurement","topic":"Element Timing","prompt":"Element Timing records render times for every image and text block on a page automatically, so no markup is needed to observe them.","hint":"Consider whether the page has to opt elements in before a measurement API can see them.","explain":"Some timing APIs watch everything the browser renders; others watch only what the page names. Knowing which model applies tells you whether a missing entry means a slow element or an unmarked one.","source":"https://developer.mozilla.org/en-US/docs/Web/API/PerformanceElementTiming","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"Element Timing observes nothing by default; an element is in scope only after the author adds the attribute."},{"id":"b","text":"False","why":"Only elements marked with the elementtiming attribute produce entries, such as images and grouped text."}],"answer":"b","explanation":"Element Timing reports render timing only for elements the author flags with the elementtiming attribute, such as images and groups of text nodes.","concept":"Element Timing reports render timing only for elements the author flags with the elementtiming attribute, such as images and groups of text nodes.","rev":1,"updatedAt":"2026-10-27","kind":"scenario","takeaways":["An unmarked element produces no element entry, so a missing image in the data may just be unflagged."]},{"id":"webperformanceadvanced-004","courseId":"web-performance-advanced","domain":"measurement","topic":"Beacon API for metrics","prompt":"A page sends its final analytics events as the user navigates away. A plain fetch() started during unload is sometimes dropped. What does navigator.sendBeacon() guarantee that avoids this?","hint":"Focus on the browser's promise about requests when a page is leaving, not on speed.","explain":"A request started by page script can be dropped once the page begins to close. Developers have worked around that in several ways, and each workaround trades off responsiveness.","source":"https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API","interaction":{"type":"single"},"options":[{"id":"a","text":"The browser starts the request before unload and runs it to completion","why":"The Beacon API guarantees that a beacon is initiated before the page unloads and is run to completion."},{"id":"b","text":"The page waits for the server's response before it unloads","whyNot":"Beacons expect no response; the request is fire-and-forget, and the page does not wait on the server."},{"id":"c","text":"The request is sent synchronously, so it blocks the unload","whyNot":"Beacons are asynchronous and non-blocking; synchronous requests are the older workaround that hurts responsiveness."},{"id":"d","text":"The response can be read inside the unload handler","whyNot":"Beacon requests do not expect a response, so there is nothing to read back."}],"answer":"a","explanation":"The Beacon API is asynchronous and non-blocking; the browser guarantees to initiate beacon requests before the page is unloaded and run them to completion, and no response is expected.","concept":"The Beacon API is asynchronous and non-blocking; the browser guarantees to initiate beacon requests before the page is unloaded and run them to completion, and no response is expected.","rev":1,"updatedAt":"2026-10-27","kind":"scenario","takeaways":["Use sendBeacon for analytics sent on unload; it returns true only if the browser queued the request."]},{"id":"webperformanceadvanced-005","courseId":"web-performance-advanced","domain":"measurement","topic":"Reporting API","prompt":"A site wants browser-generated notices about its security policy and retired features through the Reporting API. Which TWO of these are documented report types?","hint":"Separate browser notices about policies and features from measured timings.","explain":"Reports are browser notices about a page, such as policy violations or retiring features, delivered to script or a server. Measured timings live in other interfaces.","source":"https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"csp-violation","why":"Content Security Policy violations are one of the documented report types."},{"id":"b","text":"deprecation","why":"Deprecated feature usage, meaning features that will stop working soon, is a documented report type."},{"id":"c","text":"largest-contentful-paint","whyNot":"LCP is a timing metric read from performance entries, not a report type."},{"id":"d","text":"layout-shift","whyNot":"Layout shifts are exposed as their own performance entries, not delivered as reports."},{"id":"e","text":"resource-timing","whyNot":"Resource timing is a performance interface with its own entries, and it has no report type."},{"id":"f","text":"performance-timing","whyNot":"Navigation timing is read directly from timing objects on the page; it isn't delivered as a report."}],"answer":"ab","explanation":"The Reporting API delivers browser-generated reports, including csp-violation and deprecation types, as objects with type, url and body properties.","concept":"The Reporting API delivers browser-generated reports, including csp-violation and deprecation types, as objects with type, url and body properties.","rev":1,"updatedAt":"2026-10-27","kind":"scenario","takeaways":["Reporting API reports are notices about policies and deprecations, not performance measurements."]}]