Skip to content
tezvyn:

Top 30 Rendering Interview Questions and Answers

30 multiple-choice questions on Rendering, drawn from 30 bites out of the 43 tagged Rendering on Tezvyn. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.

30 questions. Pick an answer, or open “Show the answer” to read it.

Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.

  1. Question 1 of 30

    Why can defining styles with StyleSheet.create be preferable to inline literal objects in a long list?

    Show the answer

    Answer: c · It reuses a stable object reference across renders instead of allocating a new object each time

    StyleSheet styles are created once and referenced by key, giving stable references that avoid per-render allocations. React Native has no CSS cascade, and unit handling is not what StyleSheet.create provides.

    Read the full bite: Inline styles vs StyleSheet.create

  2. Question 2 of 30

    When rendering a dynamic list, what problem does the key prop solve if items are later reordered or filtered?

    Show the answer

    Answer: b · It provides a stable identifier so React can distinguish individual elements as the collection changes

    The key acts as a stable name tag so React can tell one output from another when items shift, disappear, or join the line. Preventing console warnings is only a side effect of adding keys, not their core purpose.

    Read the full bite: Lists and Keys in React

  3. Question 3 of 30

    Which statement best explains why radiometry is crucial for a self-driving car's camera system?

    Show the answer

    Answer: d · It quantifies the physical energy of light hitting the sensor, enabling objective machine interpretation.

    Radiometry measures the actual physical energy of light (in watts), which is critical for machines like self-driving cars to objectively interpret their environment, independent of human perception. Option B is incorrect because radiometry specifically avoids human perception weighting, which is the domain of photometry.

    Read the full bite: Radiometry: Measuring Light as Physics, Not Perception

  4. Question 4 of 30

    Which optical phenomenon is NOT directly accounted for by a standard Bidirectional Reflectance Distribution Function (BRDF)?

    Show the answer

    Answer: a · The way light penetrates and exits a marble sculpture.

    The card explicitly states that standard BRDF models are for opaque surfaces only and do not account for light transmitted through a material (translucency) or scattered underneath the surface, which describes light interacting with a marble sculpture. The other options are all forms of surface reflection that BRDFs are designed to model.

    Read the full bite: BRDF: Modeling How Surfaces Reflect Light

  5. Question 5 of 30

    Why does a nested Text inherit color and fontSize from its parent while a nested View inherits nothing?

    Show the answer

    Answer: c · Text maps to platform attributed-text where spans inherit attributes, while Views are independent boxes with no general style cascade

    Text inheritance reflects native attributed-text systems where text runs cascade attributes; Views are deliberately independent layout boxes with no cascade. React Native does not implement a general CSS cascade, so the first and last options are wrong.

    Read the full bite: Why Text inherits styles but View does not

  6. Question 6 of 30

    Under the New Architecture, what is the most accurate primary reason StyleSheet.create outperforms inline literal styles in long lists?

    Show the answer

    Answer: c · It provides stable object references, avoiding per-render allocations and reducing diff and GC pressure

    The durable benefit is referential stability that cuts allocations and garbage during frequent list re-renders. The bridge-ID serialization story is much diminished under Fabric and JSI, so attributing the gain primarily to it today overstates the mechanism.

    Read the full bite: How StyleSheet.create reduces styling overhead

  7. Question 7 of 30

    When is useLayoutEffect the most appropriate choice over useEffect?

    Show the answer

    Answer: d · To measure a DOM element's dimensions and update its position before the user sees any intermediate layout.

    useLayoutEffect is specifically designed for scenarios where you need to read DOM layout and make synchronous updates to prevent visual flickers before the browser paints. Option D directly describes this primary use case. Option C describes useEffect, which runs asynchronously after the browser has painted.

    Read the full bite: useLayoutEffect: Synchronous Effects Before Browser Paint

  8. Question 8 of 30

    When a Text widget rebuilds with a new string but the same key, what happens to its Element and RenderObject?

    Show the answer

    Answer: b · The existing Element compares the new Widget and, if compatible, updates the RenderObject without recreating either object.

    Because the new Widget matches the existing Element's type and key, the Element is updated in place and calls updateRenderObject on the existing RenderObject, avoiding recreation of both. Distractor A is tempting but wrong because the Element is also reused, not recreated, which preserves state and keeps rebuilds inexpensive.

    Read the full bite: Relationship between Widget, Element, and RenderObject trees and their benefits

  9. Question 9 of 30

    When using will-change for a transform animation, which practice best balances performance gains with resource costs?

    Show the answer

    Answer: a · Toggle it via JavaScript right before the animation and clear it afterward

    Toggling will-change via script provides the browser time to promote a layer without retaining costly optimizations indefinitely. Leaving it in a stylesheet permanently wastes memory by keeping layers alive forever, which can degrade performance on low-end devices.

    Read the full bite: CSS will-change: purpose, appropriate use, and overuse consequences

  10. Question 10 of 30

    During a Flutter UI update triggered by setState(), what is the primary function of the Element tree?

    Show the answer

    Answer: d · It manages the lifecycle and state of UI components, efficiently reconciling new widget configurations with existing ones.

    The Element tree is the mutable, long-lived part that persists across frames, responsible for efficiently comparing new widget configurations with existing ones and updating only necessary parts. Option A is incorrect because Flutter explicitly avoids rebuilding the entire Element and RenderObject trees to optimize performance.

    Read the full bite: Flutter's Three Trees: Widget, Element, and RenderObject

  11. Question 11 of 30

    While profiling, the Color Offscreen-Rendered Yellow overlay highlights your shadowed, rounded cards. Which change most directly removes the off-screen pass?

    Show the answer

    Answer: a · Provide an explicit shadowPath so the shadow shape need not be computed off-screen

    A shadow without a shadowPath forces an off-screen pass to derive its shape from the alpha channel; supplying shadowPath gives a known shape and eliminates that pass. Blanket shouldRasterize can backfire on changing content and does not address the root cause.

    Read the full bite: Diagnose dropped frames during animation

  12. Question 12 of 30

    In an ISR-enabled Next.js application, what is the immediate user experience when accessing a page whose cached content has expired?

    Show the answer

    Answer: a · The user is served the stale, cached page while a new version is generated in the background.

    The card states that if a page is past its 'best before' date, the user still sees the old content instantly, but their visit triggers a background process to create a new version. This 'stale-while-revalidate' approach means the user doesn't wait, making option C incorrect.

    Read the full bite: ISR: Static Speed with Dynamic Freshness

  13. Question 13 of 30

    When implementing a static blue circle with CustomPaint, why is it important that shouldRepaint returns false?

    Show the answer

    Answer: b · It tells Flutter to skip repainting when the painter's properties haven't changed, preserving GPU performance.

    Returning false lets Flutter cache the rasterized picture and avoid wasting GPU time when the painter is unchanged. Option C is wrong because the build phase finishes before paint begins, so shouldRepaint has no effect on widget rebuilding.

    Read the full bite: Describe CustomPaint and CustomPainter and implement a circle

  14. Question 14 of 30

    When implementing shouldRepaint for a CustomPainter with color and stroke width properties, which strategy best balances correctness and performance?

    Show the answer

    Answer: d · Return true only when color or stroke width differ between old and new delegates

    Returning true only when specific visual fields change lets the framework safely skip paint calls. Always returning true wastes cycles, deep equality often costs more than painting, and always returning false produces stale frames.

    Read the full bite: In a CustomPainter, what is the purpose of the shouldRepaint method?

  15. Question 15 of 30

    A CustomPainter rebuilds a large Path inside paint every frame even when its data is unchanged. What is the most effective first fix?

    Show the answer

    Answer: b · Precompute the Path and implement shouldRepaint to skip unchanged repaints

    Caching the Path and a correct shouldRepaint stop redundant per-frame work, the actual cause. saveLayer is itself expensive and does not auto-cache, and blanket RepaintBoundary wrapping wastes memory without fixing the recompute.

    Read the full bite: Diagnosing and fixing CustomPainter jank

  16. Question 16 of 30

    Which configuration correctly implements ISR for a semi-static page inside a Next.js App Router Server Component?

    Show the answer

    Answer: c · Pass next: { revalidate: 60 } to fetch or export const revalidate = 60 from the page

    Option C is correct because App Router Server Components use either the fetch revalidate option or a segment-level revalidate export. Option A is wrong because Server Components cannot use useEffect, which is a client-side hook.

    Read the full bite: Describe an ideal ISR scenario and configure it in a Server Component

  17. Question 17 of 30

    Which scenario best justifies using dynamic rendering for a Next.js page?

    Show the answer

    Answer: b · To display a user's personalized order history, requiring real-time data.

    Dynamic rendering is ideal for pages with content unique to each user or requiring real-time data, as it generates the page on demand for every request. Option D is incorrect because static generation typically offers faster initial load times for globally accessible content by pre-rendering pages at build time, avoiding server-side processing per request.

    Read the full bite: Dynamic Rendering: On-Demand Pages in Next.js

  18. Question 18 of 30

    Why can :has() be more expensive than a typical descendant selector for the rendering engine?

    Show the answer

    Answer: d · Its match depends on descendants, so DOM changes can force style invalidation up the tree

    Because :has() evaluates an element based on its descendants or siblings, mutations below can invalidate ancestors, forcing upward re-evaluation. It does not refetch stylesheets or universally disable caching.

    Read the full bite: Performance concerns with the :has() selector

  19. Question 19 of 30

    When a Text widget rebuilds with new content, which statement accurately describes the framework's behavior across the three trees?

    Show the answer

    Answer: d · The widget is recreated, while the element persists and updates its existing render object.

    Widgets are ephemeral blueprints that are rebuilt on state changes, while elements are long-lived and own the render object, updating it rather than recreating it; option C is tempting but wrong because destroying the heavy render object on every rebuild would eliminate the performance benefit of the separation.

    Read the full bite: Flutter's Widget, Element, and RenderObject trees: roles and relationships

  20. Question 20 of 30

    When Vue re-renders a component after a state change, what specific job does the virtual DOM perform before the browser screen updates?

    Show the answer

    Answer: c · It generates a lightweight tree that is diffed against the prior tree to identify minimal real DOM operations

    The virtual DOM is an in-memory intermediate representation, so Vue diffs the new tree against the old one to compute and apply only the smallest necessary real DOM updates. Option D is tempting but wrong because it reflects the common misconception that the virtual DOM directly manipulates the browser DOM without an intermediate diffing step.

    Read the full bite: What is the Virtual DOM's role during a Vue state update?

  21. Question 21 of 30

    In Flutter's three-tree architecture, which component serves as the mutable lifecycle bridge between immutable widget configurations and render objects?

    Show the answer

    Answer: c · Element tree

    The Element tree owns the mutable lifecycle and reconciles widgets with render objects. A common misconception is that widgets directly create render objects, but widgets are immutable configurations that do not perform this bridging.

    Read the full bite: Walk me through Flutter's rendering pipeline and its phases.

  22. Question 22 of 30

    What is the primary effect of using a dynamic function like cookies() within a Next.js component?

    Show the answer

    Answer: d · It forces the page to be rendered on the server for each user request.

    Dynamic functions act as "static-breakers," explicitly telling Next.js to render the page on the server for every visit, rather than generating a static HTML file at build time. Option B is incorrect because these functions prevent build-time pre-rendering for the affected route.

    Read the full bite: Dynamic Functions in Next.js

  23. Question 23 of 30

    When animating a CustomPainter using an AnimationController, which strategy best avoids widget rebuilds and layout passes while keeping the animation smooth?

    Show the answer

    Answer: a · Supply the AnimationController as the repaint Listenable and let paint read the current animation value, with shouldRepaint returning false

    Supplying the AnimationController as the repaint Listenable allows the render object to repaint directly, bypassing both the build and layout phases entirely. Creating a new painter instance every frame seems like standard immutable widget practice, but it forces the framework to constantly re-evaluate shouldRepaint and forfeits the Listenable optimization, causing unnecessary overhead.

    Read the full bite: When would you implement a CustomPainter and how does shouldRepaint work?

  24. Question 24 of 30

    Which approach best describes how Partial Prerendering (PPR) enhances user experience for pages combining static and dynamic elements?

    Show the answer

    Answer: a · It sends a static HTML shell instantly, then streams server-rendered dynamic content into designated client-side placeholders.

    PPR's key mechanism is to immediately deliver a static HTML shell, providing an instant first meaningful paint. Subsequently, dynamic components are rendered on the server and their HTML is streamed to the client to fill in placeholders, which is distinct from traditional SSR (option D) that waits for all data, or purely client-side rendering (option C).

    Read the full bite: Partial Prerendering (PPR): Static Speed for Dynamic Pages

  25. Question 25 of 30

    What happens to server-rendered HTML once it reaches the browser in a Vue SSR app?

    Show the answer

    Answer: d · The client hydrates the static markup into a fully interactive application.

    The card defines SSR as server HTML generation followed by client hydration. Option B is a common misconception—SSR does not eliminate client-side JavaScript; hydration is essential for interactivity.

    Read the full bite: What is SSR and what are its advantages over a client-side SPA?

  26. Question 26 of 30

    What feature of Fabric enables synchronous layout and measurement that the old UIManager could not provide?

    Show the answer

    Answer: b · Its C++ shadow tree is accessible from multiple threads via JSI without bridge serialization

    Fabric's shadow tree lives in C++ and is reachable across threads through JSI without serialization, allowing synchronous measurement the async bridge-based UIManager could not. It does not move rendering to the JS thread, cache UI to disk, or disable concurrency.

    Read the full bite: How Fabric Improves Rendering Over the Old UIManager

  27. Question 27 of 30

    A WebGL scene with thousands of moving objects shows high CPU time in driver validation. Which fix most directly targets this bottleneck?

    Show the answer

    Answer: c · Merge node geometry and submit a single batched draw call

    Merging geometry into a single buffer replaces thousands of API calls with one, eliminating per-call driver validation overhead. Halving the back-buffer is a fill-rate optimization that reduces GPU fragment work but does not address CPU-side draw-call overhead.

    Read the full bite: Optimize a canvas with thousands of moving objects

  28. Question 28 of 30

    For which task would CustomPaint be the most suitable Flutter tool?

    Show the answer

    Answer: c · Drawing a unique, animated waveform visualization that requires pixel-level control.

    CustomPaint is ideal for performance-sensitive custom graphics and pixel-level control, like complex data visualizations or unique graphical effects. Simpler widgets like Container or DecoratedBox are typically sufficient for basic custom styling of standard widgets, making option A a less suitable use case for CustomPaint.

    Read the full bite: CustomPaint: Drawing Your Own Widgets in Flutter

  29. Question 29 of 30

    What is the primary mechanism Vue uses to ensure efficient updates to the browser's UI?

    Show the answer

    Answer: c · It compares a newly generated Virtual DOM tree with the previous one to identify and apply only the necessary real DOM changes.

    The card explains that Vue's process involves creating a new Virtual DOM tree, performing a 'diffing' algorithm to compare it with the old tree, and then applying only the minimal set of changes to the real DOM. Option C accurately describes this mechanism. Option B is incorrect because the Virtual DOM's main purpose is to avoid the inefficiency of re-rendering the entire UI.

    Read the full bite: Vue's Virtual DOM: Efficient UI Updates

  30. Question 30 of 30

    When a CustomPainter calls canvas.translate(50, 0) then draws a shape at (0,0), how does this affect the shape's on-screen position?

    Show the answer

    Answer: c · The canvas's coordinate system origin moves 50 units right, causing the shape to appear at (50,0) on the screen.

    The card emphasizes that transformations move the coordinate system (the 'paper'), not the drawing ('pen'). Therefore, translating the canvas shifts its origin, making subsequent drawings at (0,0) appear at the new origin. Option A describes a common misconception where the drawing itself is moved after being placed.

    Read the full bite: Canvas Transformations: Moving the Paper, Not the Pen

Could you explain these out loud?

That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon