← Meta Interview Insights

Meta·QA / Test Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Had a technical screen for a test engineer role at Meta. Just one question but it was more conceptual than I expected, less about writing code and more about knowing your tools.

Questions Asked (1)

Q1

In XPath, what is the difference between a single forward slash and a double forward slash?

Technical Trade-offsAPI & Integrations
Author's notes

I knew this one but fumbled the explanation a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining the core difference: single slash (/) selects from the root node or an absolute path, while double slash (//) selects nodes anywhere in the document (descendant-or-self axis). Then, explain the performance and precision trade-offs, and give a concrete example to illustrate when each is appropriate in test automation.

Pro tip: Mention that using // can be slower and less precise because it searches the entire DOM, so in test automation you should prefer specific paths (using / or relative XPath with attributes) to make tests more robust and faster.

1. Define the core difference

Explain that / is an absolute path starting from the root node, while // is a relative path that searches anywhere in the document (descendant-or-self axis).

2. Illustrate with examples

Give a simple example like /html/body/div vs //div to show how / requires the exact hierarchy and // finds all matching elements regardless of location.

3. Discuss performance and precision

Highlight that // can be slower and may return multiple unintended matches, while / is faster and more precise but brittle if the DOM structure changes.

4. Relate to test automation

Explain how this impacts locator strategy: prefer specific paths or relative XPath with attributes for stability, and use // sparingly when you need to find elements by partial attributes.

Key Points to Mention

  • Single slash (/) selects from the root node or an absolute path.
  • Double slash (//) selects nodes anywhere in the document (descendant-or-self axis).
  • // is generally slower because it traverses the entire DOM.
  • // can return multiple elements, so it may require indexing or additional predicates.
  • / is more precise but brittle to DOM changes.
  • In test automation, prefer robust locators (e.g., relative XPath with attributes) over // to avoid flaky tests.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.