Courseiva
User Interface →hardMultiple Select

SF-PD2 User Interface Practice Question

A developer is building a Lightning Web Component that must expose a public method callable from an Aura component on the same page. The method accepts a string and returns a promise that resolves with a boolean. Which TWO steps are required to make this method callable from the Aura parent? (Choose two.)

⚠ Common exam trap

The trap here is believing that metadata files or Aura-specific constructs like aura:method are needed to expose a Lightning Web Component method, when the only requirement is the @api decorator plus an element reference in the parent.

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

✓

Annotate the method with @api and declare it as a public property or method on the Lightning Web Component class.

Exposing a Lightning Web Component method to an Aura parent requires two things: the method must be decorated with @api so the framework registers it as public, and the Aura parent must obtain the element reference, typically via component.find with an aura:id, to call that method. The promise returned is handled asynchronously by the Aura caller, matching the stated contract.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Annotate the method with @api and declare it as a public property or method on the Lightning Web Component class.

    Why this is correct

    The @api decorator exposes a class member as part of the component's public API. When a method is decorated with @api, the Lightning Web Component framework registers it so that parents, including Aura components, can invoke it through the element reference. Without this decorator the method remains private and is not addressable from outside the component, regardless of how the parent tries to call it.

  • ✓

    In the Aura parent, use the aura:component's find method or a template query to obtain the element, then invoke the method on that element reference.

    Why this is correct

    Aura parents access a Lightning Web Component's public API through the DOM element reference. Using component.find with an aura:id, or a template query, returns the element, and calling the method on that reference invokes the exposed @api method. The returned value is a promise, so the Aura parent must handle it asynchronously, which aligns with the requirement that the method returns a promise.

  • ✗

    Register the method name in the component's .js-meta.xml file under the targetConfigs section.

    Why it's wrong here

    The .js-meta.xml file declares targets, property definitions, and supported objects for the component, but it does not register callable methods. Method exposure is controlled exclusively by the @api decorator in the JavaScript class. Adding a method name to targetConfigs has no effect on runtime callability and would not enable an Aura parent to invoke the method.

  • ✗

    Wrap the Lightning Web Component inside an aura:method declaration so the Aura parent can call it directly.

    Why it's wrong here

    aura:method is an Aura construct used to expose methods on Aura components to their own children or parents. It has no role in exposing Lightning Web Component methods. Placing a Lightning Web Component inside an aura:method tag is invalid markup, and the Aura parent still cannot reach the Lightning Web Component method without the element reference and @api decorator.

  • ✗

    Add the method to the component's exported functions list using the export keyword alongside the @api decorator.

    Why it's wrong here

    The export keyword is used for JavaScript module exports and does not make a class method callable by a parent component in the Lightning Web Components framework. Public API exposure is handled by the @api decorator, which the framework reads during component registration. Combining export with @api does not change how parents address the method and is not a documented requirement.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

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 →

How Courseiva writes practice questions · Editorial policy

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.