SF-PD2 User Interface Practice Question
An enterprise Salesforce implementation requires a Lightning Web Component to display massive amounts of tabular data with extremely high rendering performance. The standard lightning-datatable component fails to meet performance SLAs during stress testing. Which architectural approach should the developer implement to optimize rendering performance?
⚠ Common exam trap
Developers often attempt to solve performance bottlenecks by writing recursive wire adapters or leveraging native browser print styling, overlooking that DOM node bloat is the root cause.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Implement a custom virtual scrolling component that dynamically renders only the rows visible within the current viewport and recycles DOM elements during scroll events.
When standard components fail due to DOM node limits and heavy memory footprints with large datasets, developers must implement a custom virtual scrolling mechanism. Virtual scrolling renders only the visible rows in the viewport and recycles DOM elements as the user scrolls, drastically reducing memory usage and maintaining smooth sixty frames per second rendering.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Implement a custom virtual scrolling component that dynamically renders only the rows visible within the current viewport and recycles DOM elements during scroll events.
Why this is correct
Virtual scrolling keeps the DOM lightweight by rendering just a fraction of the total dataset at any given time, preventing browser lag and memory exhaustion when handling tens of thousands of records in a single table.
- ✗
Wrap the standard lightning-datatable inside an Aura component and leverage the deprecated locker service bypass configuration to speed up internal data grid rendering cycles.
Why it's wrong here
Wrapping lightning-datatable in Aura adds a rendering layer and cannot bypass Locker Service, which has no supported bypass configuration; the deprecated setting never accelerated grid rendering. It is tempting because Aura predates LWC and some legacy workarounds existed, but Aura is for maintaining older components, not for optimising LWC datatable performance.
- ✗
Increase the Locker Service strictness level in the Organization Security settings to force asynchronous thread rendering for all tabular user interface components.
Why it's wrong here
Locker Service strictness governs DOM and API isolation between components, not rendering thread scheduling; no setting makes tabular rendering asynchronous. It is tempting because Locker Service does affect Lightning component behaviour, so administrators may assume a security-level tweak could influence performance, but it exists to enforce namespace and API boundaries, not to accelerate datatable rendering.
- ✗
Utilize native browser web workers to fetch, sort, and directly manipulate the document object model outside of the main Lightning Web Component rendering thread.
Why it's wrong here
Web workers cannot touch the DOM, which stays on the main thread, so direct manipulation is impossible and data must still be serialised back. Workers suit offloading computation such as parsing or sorting, not rendering.
About these practice questions
Courseiva writes every SF-PD2 question from scratch — 226 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Salesforce exam blueprint
This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.