Back to interview questions

100+ Shopify Interview Questions and Answers

100+ Shopify Interview Questions and Answers

Explore 120 Shopify interview questions and answers covering Liquid, themes, storefront APIs, apps, checkout extensions, integrations, testing, and security.

Explore 120 Shopify interview questions and answers covering Liquid, themes, storefront APIs, apps, checkout extensions, integrations, testing, and security.

By

Team Sherlock.sh

Add Sherlock as a preferred source on Google

Shopify development spans theme-based storefronts, custom storefronts, apps, and commerce integrations. Themes use Liquid, HTML, CSS, and JavaScript, while APIs and extensions provide different ways to work with store data and checkout behavior. A practical developer interview tests which part of the platform owns a feature and how to build it within that boundary.

This guide to 100+ Shopify Interview Questions and Answers contains 120 questions across beginner, intermediate, and experienced levels. It covers Liquid, theme architecture, product and cart behavior, GraphQL APIs, authentication, webhooks, checkout extensions, performance, accessibility, testing, and integration design for Shopify developer roles.

How can recruiters detect AI-assisted cheating, deepfakes, and impersonation during Shopify interviews?

Shopify interviews often combine a Liquid or JavaScript exercise with questions about theme structure, API access, and commerce workflows. A candidate may need to explain a variant-selection bug, choose between the Admin and Storefront APIs, or identify a checkout customization's constraints. Unauthorized real-time help can make an answer sound convincing without showing that the candidate understands the execution context.

Sherlock AI helps recruiters detect potential AI-assisted cheating, deepfakes, candidate impersonation, and unauthorized real-time assistance during Shopify developer interviews.

Pair interview-integrity checks with a small storefront or integration scenario and follow-up questions about permissions, failed requests, duplicate events, and buyer experience. Ask candidates to explain how they would test a change without exposing credentials or disrupting a live store. Review suspicious activity in context rather than treating a signal as proof of misconduct.

Shopify Interview Questions

Use this question bank to select topics for theme, app, storefront, checkout, or integration responsibilities. Begin with the relevant platform boundaries, then add implementation and troubleshooting scenarios. Confirm the API version, store plan, and extension target before evaluating an answer that depends on feature availability.

Shopify Interview Questions for Beginners

These beginner questions cover storefront and app responsibilities, theme files, Liquid objects and filters, templates, sections, blocks, products, variants, and carts. They establish where a value comes from, where code executes, and which platform component controls the buyer-facing result.

  1. What does Shopify manage for a merchant, and what can a developer customize through a theme, an app, or a custom storefront?

  2. How do products, options, and variants differ in Shopify?

  3. How do Shopify collections differ from product tags and navigation menus?

  4. Why is inventory tracked by both variant and location rather than only by product?

  5. What is the difference between an order's payment status and its fulfillment status?

  6. What is the difference between Shopify's Online Store channel and a headless storefront?

  7. What are the main directories in a Shopify theme, and what belongs in each one?

  8. What is Liquid, and how does its server-side rendering differ from browser JavaScript?

  9. How do Liquid objects, tags, and filters work together to render storefront content?

  10. When would you use assign instead of capture in Liquid?

  11. How do nil, false, empty, and blank affect Liquid conditionals and default values?

  12. When should a Liquid for loop be combined with paginate?

  13. What does the Liquid render tag do, and how do you pass data into a snippet?

  14. What roles do theme.liquid, content_for_header, and content_for_layout play?

  15. How do sections, blocks, and snippets serve different purposes in a Shopify theme?

  16. What does a JSON template contain, and how does it enable Online Store 2.0 page customization?

  17. What do settings, blocks, and presets control in a section's schema?

  18. Why use section groups for shared header and footer areas?

  19. How do reusable theme blocks differ from blocks defined inside a section?

  20. What is the difference between an app block and an app embed block?

  21. How do settings_schema.json and settings_data.json differ?

  22. Why must an add-to-cart form submit a variant ID rather than a product ID?

  23. Why should a theme use Shopify's money filters rather than manually formatting a price?

  24. How do image_url and image_tag help render responsive product images?

  25. What is a metafield, and how do its namespace, key, type, and owner identify custom data?

  26. What is a metaobject, and when is it more useful than a single metafield?

  27. When should a merchant-editable product attribute use a metafield rather than a tag or hard-coded theme text?

  28. How can dynamic sources connect a theme setting to product-specific content?

  29. When would a theme use the Ajax API instead of the GraphQL Storefront API?

  30. How do the GraphQL Admin API and Storefront API differ in purpose and access?

  31. What are GraphQL queries, mutations, variables, and selection sets in a Shopify integration?

  32. Which Shopify tokens may appear in storefront browser code, and which must remain secret?

  33. What are app access scopes, and why should an app request only the scopes it needs?

  34. What is a Shopify webhook, and how is it different from repeatedly polling an API?

  35. How do development, unpublished, and live themes support a safe Shopify CLI workflow?

  36. What does Theme Check detect, and what does it not prove about a storefront?

  37. What accessibility basics should be built into product pages, navigation, and forms?

  38. Which SEO metadata and canonical information should a Shopify theme render?

  39. How do Checkout UI extensions and Shopify Functions customize different parts of the purchase flow?

  40. What are Hydrogen and Oxygen, and how do they fit into a Shopify headless implementation?

Shopify Interview Questions for Intermediate

These intermediate questions examine reusable theme components, API queries and mutations, authentication, webhooks, metafields, cart interactions, and extension development. They focus on correct data handling, predictable error paths, and choosing the appropriate Shopify surface.

  1. How would you build a reusable announcement section with merchant-editable text and a configurable link?

  2. How would you render a product badge from a typed metafield while handling missing values safely?

  3. How would you create an alternate product JSON template without duplicating its main Liquid section?

  4. How should a JavaScript component initialize and clean up when sections are reloaded in the theme editor?

  5. How would you pass Liquid data to JavaScript without breaking quoting or introducing script injection?

  6. How would you keep the selected variant, price, media, availability, and URL synchronized on a product page?

  7. How would you add a selected variant to the cart with the Ajax API and handle validation failures?

  8. Why can one variant appear on multiple cart lines, and how should a cart editor target the correct line?

  9. How can bundled section rendering update a cart drawer after a cart mutation, and how should missing section HTML be handled?

  10. How would you implement collection filtering and sorting while preserving pagination and shareable URLs?

  11. How would you implement predictive search that avoids stale results and remains keyboard-accessible?

  12. How do theme translations differ from market-specific currency, pricing, and product availability?

  13. How would you prevent conflicting canonical URLs and duplicate product structured data in a customized theme?

  14. How would you optimize a product page's largest image without lazy-loading its likely LCP element?

  15. How would you reduce unnecessary JavaScript and app-asset loading on storefront pages?

  16. How would you manage focus, keyboard controls, and status announcements in an asynchronous cart drawer?

  17. How would you define and expose a product metafield with the right type, validation, and storefront access?

  18. How would you model a reusable size guide or brand profile with metaobjects and product references?

  19. How would you retrieve all matching products using GraphQL cursor pagination without assuming one response is complete?

  20. Why can a GraphQL request return HTTP 200 even when a Shopify mutation failed, and what must the client inspect?

  21. How should an integration use GraphQL query cost and throttleStatus when scheduling requests and retries?

  22. What security checks are needed when implementing Shopify's authorization code grant for a standalone app?

  23. How do App Bridge ID tokens, formerly called session tokens, and token exchange authenticate an embedded app?

  24. When should an app use online versus offline access tokens, and how should it handle expiry and renewal?

  25. How would you verify an HTTPS Shopify webhook without changing the bytes used for its HMAC signature?

  26. How would you acknowledge webhooks quickly while reliably queuing work and suppressing duplicate deliveries?

  27. How would you add an app permission without assuming that every existing installation has already granted it?

  28. Why would an app use a theme app extension instead of directly modifying a merchant's theme files?

  29. How would you create a cart through the Storefront API and send the buyer to Shopify checkout?

  30. How should a headless storefront keep product-query context and cart buyer identity consistent across markets?

  31. How does the Customer Account API differ from merchant app authentication and legacy Storefront customer access tokens?

  32. What does an app proxy signature prove, and what additional authorization is needed for customer-specific actions?

  33. How do a Shopify Function's input query, configuration, executable logic, and output work together?

  34. How would you choose a Checkout UI extension target and verify its available APIs, capabilities, and eligibility?

  35. How do ProductVariant, InventoryItem, InventoryLevel, and Location relate in an inventory integration?

  36. Why should an order integration work with fulfillment orders instead of treating an order as one shipment?

  37. What does deploying a Shopify app version release, and what still needs a separate backend deployment?

  38. How would you test a Shopify integration using a development store, fixtures, and real end-to-end flows?

  39. What should an app do when it is uninstalled, and why is uninstall handling different from data redaction?

  40. How do selling plans and subscription contracts differ from an ordinary one-time purchase?

Shopify Interview Questions for Experienced

These experienced-level questions address storefront architecture, performance, accessibility, security, API evolution, checkout constraints, and reliable integrations. They test how a developer manages platform limits, asynchronous updates, and changes across stores without compromising data or customer experience.

  1. How would you choose between an Online Store theme, a headless storefront, and an app-led extension for a complex commerce requirement?

  2. How would you prevent one shop's authenticated request, cache entry, or background job from accessing another shop's data?

  3. How would you keep a local Shopify data replica correct despite duplicate, delayed, out-of-order, or missed webhooks?

  4. How would you design a Shopify-to-ERP order integration that avoids duplicate downstream orders after partial failures?

  5. How would you design an API worker pool that respects per-app, per-shop limits without letting one large merchant starve other shops?

  6. How would you run and recover a large catalog import or export using bulk operations, checkpoints, and per-record error handling?

  7. How would you adapt a theme and integration for products with many variants without relying on obsolete product-model limits?

  8. How would you use metafieldsSet and compareDigest to prevent two writers from silently overwriting custom data?

  9. How would you prevent lost inventory updates when Shopify and a warehouse system both change stock levels?

  10. How would you coordinate expiring offline token refresh, secret rotation, and uninstall revocation across multiple app workers?

  11. How would you upgrade Shopify API and webhook versions safely and detect requests that have fallen forward to another version?

  12. How would you migrate a legacy REST Admin integration to GraphQL without merely translating each REST call one-for-one?

  13. How would you migrate a legacy Checkout API integration to the Storefront Cart API while preserving the buyer journey?

  14. How would you replace legacy checkout.liquid or Shopify Scripts behavior without assuming a one-to-one extension exists?

  15. How would you design and test a Shopify Function under its execution limits without assuming unrestricted network or database access?

  16. How would you test discount logic for combination rules, allocation, currency precision, and boundary conditions?

  17. How would you secure requests from a Checkout UI extension to your app backend and authorize the requested operation?

  18. How would you prevent a headless B2B storefront from exposing another company's catalog or negotiated prices?

  19. How would you keep market pricing, currency, language, tax presentation, and checkout context consistent across a global storefront?

  20. How would you design Hydrogen caching so public catalog data is fast but buyer-specific prices, carts, and account data do not leak?

  21. How would you diagnose a slow Hydrogen page and separate critical commerce data from optional recommendations or content?

  22. Why must server-side Storefront API calls forward trustworthy buyer context, and how would you prevent spoofed IP headers?

  23. How would you manage customer authentication and cart association securely across login, logout, and multiple browser tabs?

  24. How would you implement Shopify web-pixel analytics while respecting sandbox boundaries, consent changes, and duplicate events?

  25. How would you preserve search visibility when moving a Shopify theme storefront to a headless implementation?

  26. How would you design nested theme blocks and section contracts that remain reusable and behave correctly in the theme editor?

  27. How would you release a theme update without overwriting merchant settings, JSON-template changes, or concurrent admin edits?

  28. How would you identify whether a storefront performance regression comes from Liquid rendering, theme JavaScript, images, or third-party apps?

  29. How would you reconcile a stale cart UI when inventory, discounts, or market context changes before checkout?

  30. How would you review a theme or app extension for cross-site scripting across HTML, attributes, URLs, and embedded JSON?

  31. How would you minimize, authorize, store, and log protected customer data in a Shopify app?

  32. How would you implement auditable customer-data requests and redaction across databases, queues, caches, and backups?

  33. How would you keep the purchase journey usable when a recommendation, loyalty, or other external service becomes slow or unavailable?

  34. How would you make a subscription integration resilient to payment failures, contract changes, and repeated billing-related events?

  35. How would you reconcile partial fulfillment, cancellation, refund, return, and restocking events without treating them as the same operation?

  36. How would you enforce paid-app entitlements without trusting browser parameters or confusing installation with an approved subscription?

  37. What automated test matrix would you use for a Shopify release spanning themes, app APIs, webhooks, and checkout extensions?

  38. How would you coordinate app configuration, extension versions, backend code, and database migrations so a rollback remains safe?

  39. How would you investigate and mitigate a flash-sale incident involving cart errors, API throttling, and inconsistent inventory?

  40. How would you validate a Shopify replatforming and plan its cutover so catalog data, customer access, inventory, and historical records remain usable?

Shopify Interview Questions and Answers

The answers follow the same order as the question bank. They explain the mechanism and its limits, then connect it to a code example or practical scenario. Read each example with its stated theme context, API surface, permissions, and store configuration in mind.

Shopify Interview Questions and Answers for Beginners

The beginner answers connect Shopify terminology to concrete rendering and shopping behavior. They distinguish Liquid output from browser-side interactions, a product from its purchasable variants, and theme customization from app or checkout functionality.

1. What does Shopify manage for a merchant, and what can a developer customize through a theme, an app, or a custom storefront?

Shopify provides the commerce platform: product and customer records, order management, checkout, payment integrations, and tools for inventory, shipping, and taxes. The merchant still configures the business rules and operates the store; Shopify does not decide the catalog or fulfillment process for them.

A theme controls the Shopify-hosted Online Store's presentation using Liquid, templates, sections, CSS, and JavaScript. An app adds integrations, admin workflows, or supported extensions through authenticated APIs and extension points. A custom storefront replaces the customer-facing presentation layer and uses Shopify's commerce APIs.

These are different boundaries. Theme Liquid cannot run an arbitrary backend service, and choosing headless does not mean replacing Shopify's checkout or gaining unrestricted access to its internals.

2. How do products, options, and variants differ in Shopify?

A product is the catalog record for an item, containing shared information such as its title, description, and media. Options describe choices a buyer can make, such as capacity and finish. A variant represents a particular sellable combination of option values.

For a water bottle, “Capacity” might offer 500 ml and 750 ml, while “Finish” offers steel and black. The 750 ml black bottle is one variant, with its own ID, price, SKU, availability, and inventory relationship. Not every theoretical combination must exist.

Even a product without customer-selectable options has a default variant. Product pages organize the experience around the product, but adding an item to a cart identifies the chosen variant, not merely the parent product.

3. How do Shopify collections differ from product tags and navigation menus?

Collections organize catalog items into browsable groups, such as “Trail running” or “Summer clearance.” They have their own merchandising presentation and can be linked from the storefront. Product tags are text labels attached to products; they can support administration and collection conditions, but a tag is not itself a collection page.

Navigation menus contain links. A menu item can point to a collection, product, page, or another destination without changing catalog membership.

For example, adding a “Sale” menu link does not put products on sale or add them to that collection. Also, Shopify's newer collections model is rolling out beyond the legacy manual/smart distinction, so the available membership controls should be checked in the merchant's admin rather than assuming only two collection types exist.

4. Why is inventory tracked by both variant and location rather than only by product?

A product-level quantity cannot distinguish which sellable version is available or where it can be fulfilled. A medium jacket might be out of stock while the large jacket remains available; the medium version might also exist at a retail location but not at the shipping warehouse.

In Shopify's API model, a variant is associated with an inventory item, and inventory levels connect that item to locations. Inventory updates therefore need the correct item and location rather than only a product ID.

The quantity's meaning also matters. Available stock is not necessarily the same as on-hand stock because some units may be committed or otherwise unavailable. Accurate location-level records support fulfillment routing, pickup availability, transfers, and reliable stock synchronization.

5. What is the difference between an order's payment status and its fulfillment status?

Payment status describes what has happened to the money. For example, an order can be pending payment, authorized, paid, or refunded. Authorization generally means funds are approved for later capture; it is not the same as completed collection of payment.

Fulfillment status describes progress in supplying the ordered items, such as unfulfilled, partially fulfilled, or fulfilled. These dimensions are independent: an order can be paid but unfulfilled, or fulfilled while payment remains pending under an agreed payment arrangement.

For a two-item order, shipping one item can produce partial fulfillment even if the entire order was paid upfront. A refund does not automatically explain whether goods were returned or restocked, and fulfilled does not by itself prove carrier delivery.

6. What is the difference between Shopify's Online Store channel and a headless storefront?

The Online Store channel uses a Shopify-hosted theme. Shopify renders Liquid, supplies page-specific objects, and provides the theme editor so merchants can manage supported sections, blocks, and settings.

A headless storefront separates the customer interface from that theme layer. Developers own the frontend's routing, rendering, and deployment, and connect it to Shopify through APIs such as the Storefront API and Customer Account API. Shopify can still provide catalog management, carts, and checkout.

Headless is useful when the experience requires a frontend architecture that a theme cannot comfortably support. It also moves more responsibility to the development team, including SEO, caching, consent-aware analytics, and compatibility with installed apps. An app designed to inject a theme block does not automatically appear in a custom storefront.

7. What are the main directories in a Shopify theme, and what belongs in each one?

Shopify themes use a defined directory structure so the platform knows how to render pages and expose merchant controls.

Directory

Main responsibility

layout

Shared page shells, commonly theme.liquid.

templates

Page-type templates and alternate templates.

sections

Configurable page components and JSON section groups.

blocks

Reusable theme-block Liquid files.

snippets

Reusable implementation fragments rendered from other files.

assets

CSS, JavaScript, images, and other static theme assets.

config

Theme setting definitions and saved configuration.

locales

Customer-facing and theme-editor translation data.

For example, a product JSON template chooses and configures sections; a section can call a product-price snippet and load assets. Keeping these responsibilities separate avoids turning one template into an unmaintainable mixture of page configuration, repeated markup, and browser behavior.

8. What is Liquid, and how does its server-side rendering differ from browser JavaScript?

Liquid is Shopify's template language. In an Online Store theme, Shopify evaluates Liquid on its servers using the objects available for the request and returns rendered output, usually HTML. The browser receives that output, not a live Liquid execution environment.

Browser JavaScript runs after or while the page loads. It can respond to clicks, change the DOM, and request updated data or section HTML. Changing a JavaScript variable does not automatically rerun the Liquid that originally produced the page.

For example, Liquid can render the initial selected variant's price, while JavaScript updates the displayed price when the buyer changes options. Liquid is not an unrestricted backend language: theme code cannot open arbitrary database connections or directly perform privileged Admin API operations.

9. How do Liquid objects, tags, and filters work together to render storefront content?

Objects provide data, tags control template behavior, and filters transform values. Output expressions use double braces, while tags use brace-percent delimiters. Filters follow a pipe and can be chained from left to right.

In a product-template section, product.title reads a property, an if tag decides whether to show the vendor, and escape makes plain text suitable for HTML output.

Liquid example

<h1>{{ product.title | escape }}</h1>
{% if product.vendor != blank %}
  <p>Made by {{ product.vendor | escape }}</p>
{% endif %}
<h1>{{ product.title | escape }}</h1>
{% if product.vendor != blank %}
  <p>Made by {{ product.vendor | escape }}</p>
{% endif %}
<h1>{{ product.title | escape }}</h1>
{% if product.vendor != blank %}
  <p>Made by {{ product.vendor | escape }}</p>
{% endif %}

This distinction helps separate data access from presentation logic. A filter changes the value being rendered; it does not save a change to the product in Shopify. Escaping must also match the output context rather than treating every kind of content as interchangeable.

10. When would you use assign instead of capture in Liquid?

Use assign when a variable should hold an existing value, object, or filtered result. Use capture when building a string from multiple pieces of template output, including conditional content. Capturing a number as text does not preserve it as a numeric value.

For example, inside a product section, the selected variant remains an object when assigned, while the caption below becomes a string.

Liquid example

{% assign chosen_variant = product.selected_or_first_available_variant %}
{% capture item_caption %}{{ product.title }} — {{ chosen_variant.title }}{% endcapture %}
<p>{{ item_caption | strip | escape }}</p>
{% assign chosen_variant = product.selected_or_first_available_variant %}
{% capture item_caption %}{{ product.title }} — {{ chosen_variant.title }}{% endcapture %}
<p>{{ item_caption | strip | escape }}</p>
{% assign chosen_variant = product.selected_or_first_available_variant %}
{% capture item_caption %}{{ product.title }} — {{ chosen_variant.title }}{% endcapture %}
<p>{{ item_caption | strip | escape }}</p>

The final escape is appropriate because this caption is plain text inside HTML. Watch captured whitespace, and avoid variable names that shadow built-in objects such as product or cart.

11. How do nil, false, empty, and blank affect Liquid conditionals and default values?

Only nil and false are falsy in Liquid. An empty string, an empty array, and the number zero are still truthy, so a simple if is not always a useful content-presence check.

Compare with empty when checking an empty value or an empty resource object. Compare with blank for a broader absence check, including whitespace-only text. The default filter replaces nil, false, and empty values; it should not be treated as a general whitespace-cleaning operation.

For a section checkbox, preserve an intentionally false value when applying a fallback:

Liquid example

{% assign show_vendor = section.settings.show_vendor | default: true, allow_false: true %}
{% assign show_vendor = section.settings.show_vendor | default: true, allow_false: true %}
{% assign show_vendor = section.settings.show_vendor | default: true, allow_false: true %}

Without allow_false: true, a merchant's explicit decision to hide the vendor could be replaced by the fallback true.

12. When should a Liquid for loop be combined with paginate?

Use paginate when a supported Liquid array needs to be displayed across pages rather than assuming a for loop can retrieve an entire collection. Ordinary for loops are limited to 50 iterations per page; pagination provides the page slice and navigation information. The permitted page size is 1–250.

This example belongs in a collection-template section and displays 24 products per page:

Liquid example

{% paginate collection.products by 24 %}
  <ul>
    {% for item in collection.products %}
      <li><a href="{{ item.url | escape }}">{{ item.title | escape }}</a></li>
    {% endfor %}
  </ul>
  {{ paginate | default_pagination }}
{% endpaginate %}
{% paginate collection.products by 24 %}
  <ul>
    {% for item in collection.products %}
      <li><a href="{{ item.url | escape }}">{{ item.title | escape }}</a></li>
    {% endfor %}
  </ul>
  {{ paginate | default_pagination }}
{% endpaginate %}
{% paginate collection.products by 24 %}
  <ul>
    {% for item in collection.products %}
      <li><a href="{{ item.url | escape }}">{{ item.title | escape }}</a></li>
    {% endfor %}
  </ul>
  {{ paginate | default_pagination }}
{% endpaginate %}

Pagination is not a workaround for unlimited catalog traversal: Liquid pagination stops at the 25,000th item. Large browsing experiences need narrower collections or filters rather than enormous pages.

13. What does the Liquid render tag do, and how do you pass data into a snippet?

The render tag inserts the output of a snippet, such as a reusable price label or product card. Pass named parameters to make the snippet's inputs explicit instead of relying on locally assigned variables in its caller.

For example, a product section can render snippets/variant-price.liquid with a chosen variant:

Liquid example

{% assign chosen_variant = product.selected_or_first_available_variant %}
{% render 'variant-price', item_variant: chosen_variant %}
{% assign chosen_variant = product.selected_or_first_available_variant %}
{% render 'variant-price', item_variant: chosen_variant %}
{% assign chosen_variant = product.selected_or_first_available_variant %}
{% render 'variant-price', item_variant: chosen_variant %}

Inside that snippet, the parameter is available as item_variant:

Liquid example

<span class="price">{{ item_variant.price | money }}</span>
<span class="price">{{ item_variant.price | money }}</span>
<span class="price">{{ item_variant.price | money }}</span>

Snippet-created variables remain local, and changes to passed variables do not modify the caller's variables. This is not total isolation from Shopify data: global and relevant contextual objects remain accessible. Explicit parameters still make the component easier to reuse and understand.

14. What roles do theme.liquid, content_for_header, and content_for_layout play?

layout/theme.liquid is the default shared page shell. It commonly contains the document structure, metadata, shared assets, and references to header and footer section groups. The selected template supplies the page-specific content within that shell.

content_for_header belongs inside the HTML head and supplies content Shopify needs for platform functionality. Keep it intact rather than parsing, filtering, or rebuilding its output. content_for_layout belongs in the body where the rendered template should appear.

Liquid example

<!doctype html>
<html lang="{{ request.locale.iso_code | escape }}">
  <head>
    <meta charset="utf-8">
    {{ content_for_header }}
  </head>
  <body>
    {{ content_for_layout }}
  </body>
</html>
<!doctype html>
<html lang="{{ request.locale.iso_code | escape }}">
  <head>
    <meta charset="utf-8">
    {{ content_for_header }}
  </head>
  <body>
    {{ content_for_layout }}
  </body>
</html>
<!doctype html>
<html lang="{{ request.locale.iso_code | escape }}">
  <head>
    <meta charset="utf-8">
    {{ content_for_header }}
  </head>
  <body>
    {{ content_for_layout }}
  </body>
</html>

This deliberately minimal layout illustrates placement, not a complete production theme. A real layout also needs appropriate metadata, navigation, accessibility structure, and assets.

15. How do sections, blocks, and snippets serve different purposes in a Shopify theme?

Sections are configurable page components, such as a product-information area or image banner. JSON templates and section groups arrange section instances, and the theme editor exposes their supported settings.

Blocks divide a section into smaller merchant-configurable pieces. A product-information section might contain a title, price, and purchase controls. Blocks can be section-local definitions, reusable theme blocks, or app-provided blocks, depending on how the component is built.

Snippets are implementation-level Liquid fragments. A section and several blocks might all call the same price-formatting snippet, but that snippet is not independently addable in the theme editor.

The practical choice depends on who needs control: use sections and blocks for merchant composition, and snippets to remove duplicated code without introducing another editable component.

16. What does a JSON template contain, and how does it enable Online Store 2.0 page customization?

A JSON template stores page configuration rather than HTML markup. Its sections object identifies section instances and their settings, while its order array determines their display order. The referenced Liquid section files generate the actual markup.

For example, templates/product.json could reference an existing sections/main-product.liquid file:

JSON example

{
  "sections": {
    "main": {
      "type": "main-product",
      "settings": {}
    }
  },
  "order": ["main"]
}
{
  "sections": {
    "main": {
      "type": "main-product",
      "settings": {}
    }
  },
  "order": ["main"]
}
{
  "sections": {
    "main": {
      "type": "main-product",
      "settings": {}
    }
  },
  "order": ["main"]
}

This structure underpins Online Store 2.0 customization: merchants can add, remove, and reorder eligible sections without rewriting the page's code. Alternate JSON templates can reuse the same section implementations with different configurations. Do not place arbitrary Liquid or HTML directly between JSON entries; presentation belongs in the referenced sections.

17. What do settings, blocks, and presets control in a section's schema?

A section's schema describes the controls and composition options exposed in the theme editor. It is JSON inside a {% schema %} block, not markup rendered to the customer.

Settings define inputs such as a heading, image, or color. Section-level values are read through section.settings. Blocks define or permit child components and, for section-local blocks, their individual settings. Presets provide starting configurations and make a section available through the editor's Add section workflow where permitted.

A slideshow preset, for example, can start with two slide blocks and a default heading. The schema does not render those slides by itself: the Liquid implementation must read the settings and output the content. Schema JSON also does not execute embedded Liquid expressions.

18. Why use section groups for shared header and footer areas?

Section groups let merchants manage shared layout areas with the same kind of add, remove, and reorder controls used for page sections. A header group can contain an announcement bar and navigation, while a footer group can contain links and a newsletter section.

The group is a JSON file in the sections directory. A layout renders it with the plural sections tag:

Liquid example

{% sections 'header-group' %}
<main id="MainContent">
  {{ content_for_layout }}
</main>
{% sections 'footer-group' %}
{% sections 'header-group' %}
<main id="MainContent">
  {{ content_for_layout }}
</main>
{% sections 'footer-group' %}
{% sections 'header-group' %}
<main id="MainContent">
  {{ content_for_layout }}
</main>
{% sections 'footer-group' %}

Here, the theme must provide the corresponding group files. Unlike a page template's section list, these groups are shared by pages using that layout. That avoids copying the header into every template while retaining merchant control over its composition.

19. How do reusable theme blocks differ from blocks defined inside a section?

Reusable theme blocks live in their own Liquid files under blocks. Their rendering logic and settings can be used by multiple compatible sections, and they can support nested child blocks. This suits components such as headings, images, or reusable content groups.

Section blocks are defined within one section's schema, with rendering handled by that section's implementation. They are local to that section and do not support nested section blocks.

For example, a reusable text block can serve several layout sections, while a tightly coupled slideshow might define its slide structure locally. These are distinct composition models: Shopify currently does not allow section blocks and theme blocks to be mixed within the same section. A reusable snippet is different again because it has no independent merchant-editable block settings.

20. What is the difference between an app block and an app embed block?

An app block places app-provided content within the page's editable content structure, such as a product-review summary beneath the product title. The host section or theme block must support app blocks. In current theme-app-extension schemas, new app blocks use the content target; the older section target remains supported as a legacy value.

An app embed block is for content that does not fit a normal content position, such as a floating chat widget or an integration loaded near the page head or body. Merchants enable it through the theme editor's App embeds controls.

Both belong to theme app extensions and avoid directly patching merchant theme files. Neither is a general way to modify checkout-step pages; checkout customization uses its own supported extension mechanisms.

21. How do settings_schema.json and settings_data.json differ?

config/settings_schema.json defines the theme-wide settings shown in the theme editor: their groups, input types, IDs, labels, and defaults. It describes what the merchant can configure, such as typography or the overall color scheme.

config/settings_data.json stores selected configuration values and theme presets. It represents configuration state, not the definition of each input. Liquid accesses a theme-wide setting through the settings object, such as settings.logo.

Section and block settings are defined separately in their own schemas, and JSON templates and section groups also store instance configuration. During a theme update, replacing setting definitions is not equivalent to replacing merchant choices. Blindly pushing an old settings_data.json can overwrite changes made in the live theme editor, so deployment must preserve the intended store configuration.

22. Why must an add-to-cart form submit a variant ID rather than a product ID?

A cart line must identify the exact sellable item. A product ID does not specify which size, color, or other option combination the buyer selected; the variant ID does. Even a product with no visible option choices has a variant to submit.

This minimal product-section form adds the initially selected available variant. It assumes an ordinary one-time purchase and does not implement a variant picker.

Liquid example

{% assign chosen_variant = product.selected_or_first_available_variant %}
{% form 'product', product %}
  <input type="hidden" name="id" value="{{ chosen_variant.id }}">
  <input type="hidden" name="quantity" value="1">
  <button type="submit" {% unless chosen_variant.available %}disabled{% endunless %}>
    Add to cart
  </button>
{

{% assign chosen_variant = product.selected_or_first_available_variant %}
{% form 'product', product %}
  <input type="hidden" name="id" value="{{ chosen_variant.id }}">
  <input type="hidden" name="quantity" value="1">
  <button type="submit" {% unless chosen_variant.available %}disabled{% endunless %}>
    Add to cart
  </button>
{

{% assign chosen_variant = product.selected_or_first_available_variant %}
{% form 'product', product %}
  <input type="hidden" name="id" value="{{ chosen_variant.id }}">
  <input type="hidden" name="quantity" value="1">
  <button type="submit" {% unless chosen_variant.available %}disabled{% endunless %}>
    Add to cart
  </button>
{

When options change, the picker must update the submitted id and availability state together. Submitting the product ID, or leaving the original variant ID unchanged, can produce an error or add the wrong item.

23. Why should a theme use Shopify's money filters rather than manually formatting a price?

Shopify's money filters apply the store's configured money format to Liquid price values. They avoid hard-coding a dollar sign, assuming a decimal separator, or manually manipulating Shopify's price representation.

Use the correct value first: a selected variant's price is different from a product-level minimum price. Then choose a filter appropriate to the presentation, such as money or money_with_currency.

Liquid example

{% assign chosen_variant = product.selected_or_first_available_variant %}
<span>{{ chosen_variant.price | money_with_currency }}</span>
{% assign chosen_variant = product.selected_or_first_available_variant %}
<span>{{ chosen_variant.price | money_with_currency }}</span>
{% assign chosen_variant = product.selected_or_first_available_variant %}
<span>{{ chosen_variant.price | money_with_currency }}</span>

This belongs in a product context. The filter formats the supplied amount; it does not choose a market, perform an independent currency conversion, or calculate a discount. Currency and pricing context must already be correct. JavaScript that updates prices must remain consistent with the server-rendered presentation.

24. How do image_url and image_tag help render responsive product images?

image_url requests a transformed Shopify CDN image at an appropriate size. image_tag produces the HTML image element and can add responsive candidates, sizing information, and dimensions derived from the image. This is preferable to sending every visitor the original full-resolution upload.

For a below-the-fold product image, the following example offers several widths and describes its expected layout size:

Liquid example

{% if product.featured_image %}
  {{ product.featured_image
    | image_url: width: 1200
    | image_tag: widths: '360, 720, 1200',
      sizes: '(min-width: 990px) 50vw, 100vw',
      loading: 'lazy'
  }}
{% endif %}
{% if product.featured_image %}
  {{ product.featured_image
    | image_url: width: 1200
    | image_tag: widths: '360, 720, 1200',
      sizes: '(min-width: 990px) 50vw, 100vw',
      loading: 'lazy'
  }}
{% endif %}
{% if product.featured_image %}
  {{ product.featured_image
    | image_url: width: 1200
    | image_tag: widths: '360, 720, 1200',
      sizes: '(min-width: 990px) 50vw, 100vw',
      loading: 'lazy'
  }}
{% endif %}

The sizes value must match the real CSS layout. Provide meaningful image alt text, retain dimensions to reduce layout shifts, and do not copy lazy loading onto the main above-the-fold image that is likely to determine loading performance.

25. What is a metafield, and how do its namespace, key, type, and owner identify custom data?

A metafield adds typed custom data to an existing Shopify resource, such as a product, variant, order, or customer. Its namespace and key form an identifier within that owner: custom.care_instructions on one product is a different stored value from the same identifier on another product.

The namespace organizes fields and can relate to ownership rules. The key names the field. The type determines how the value is validated and interpreted, such as text, a number, a date, or a reference. The owner is the resource receiving that value.

For example, a product's washing instructions can be a multiline-text metafield. A definition establishes a consistent structure and validation across products. Access and storefront visibility still need consideration; custom data is not automatically appropriate for public display.

26. What is a metaobject, and when is it more useful than a single metafield?

A metaobject is a reusable structured record with several related fields. Its definition specifies the field structure, while individual entries store actual content. Unlike a product metafield, the record does not have to exist solely as one field attached to one product.

For example, a “Material guide” metaobject might contain a name, image, care instructions, and sourcing description. Several products can reference the same guide through a metaobject-reference metafield, allowing one editorial update to improve all of those product pages.

A single metafield is simpler for one product-specific attribute, such as a warranty duration. A metaobject is more useful when the content has its own structure, lifecycle, or reuse requirements. Its access settings and, where applicable, publication state determine whether the storefront can use it.

27. When should a merchant-editable product attribute use a metafield rather than a tag or hard-coded theme text?

Use a metafield when the attribute has a defined meaning, needs an appropriate data type, and should be edited independently for each product. Examples include a numeric warranty duration, care instructions, or a reference to a size chart.

A typed definition gives merchants a consistent input and can enforce validation. The theme can then render the value without parsing an informal naming convention. By contrast, a tag such as warranty_24_months mixes meaning and data into a string and is easier to mistype.

Tags remain useful as simple labels for organization and rule matching. Hard-coded theme text is appropriate for genuinely shared presentation, not product facts that vary. Putting product attributes in metafields also keeps the content available when the theme is replaced.

28. How can dynamic sources connect a theme setting to product-specific content?

Dynamic sources let a merchant connect a compatible section or block setting to resource data instead of entering a fixed value. In a product template, a text setting might connect to the current product's care-instructions metafield.

The developer defines a compatible setting type and renders that setting, while the merchant selects the connection in the theme editor. The same template then displays different instructions for different products without duplicating the section or adding product-handle conditionals.

Availability depends on the template's resource context, the setting type, and the source's type and access settings. Dynamic sources are not available for general theme-wide settings. Test products with missing values as well as populated values so the component does not leave empty headings or awkward blank areas.

29. When would a theme use the Ajax API instead of the GraphQL Storefront API?

The Ajax API is usually the straightforward choice for browser interactions in a Shopify-hosted theme: adding to the current cart, changing quantities, retrieving recommendations, or using predictive search. It works with the storefront session and does not require exposing an Admin API token.

The GraphQL Storefront API is designed for custom commerce experiences, including headless storefronts that manage their own API-driven cart flow. It is not a drop-in replacement for the theme's existing session cart.

This browser-side helper reads the current theme cart using a locale-aware path:

JavaScript example

async function readThemeCart() {
  const response = await fetch(window.Shopify.routes.root + 'cart.js');
  if (!response.ok) throw new Error('Unable to load the cart');
  return response.json();
}
async function readThemeCart() {
  const response = await fetch(window.Shopify.routes.root + 'cart.js');
  if (!response.ok) throw new Error('Unable to load the cart');
  return response.json();
}
async function readThemeCart() {
  const response = await fetch(window.Shopify.routes.root + 'cart.js');
  if (!response.ok) throw new Error('Unable to load the cart');
  return response.json();
}

Use the Ajax API only in its supported Shopify-hosted theme context, not as a general API for an independently hosted storefront.

30. How do the GraphQL Admin API and Storefront API differ in purpose and access?

The GraphQL Admin API supports merchant-facing management and integrations, such as updating products, synchronizing inventory, and processing order workflows. Access depends on an authorized app installation, granted scopes, and any additional resource restrictions. Admin access tokens must never be embedded in public storefront code.

The Storefront API serves buyer-facing commerce: discovering published catalog content, creating and updating carts, and obtaining the checkout URL. Its permissions and exposed schema are deliberately different from the Admin API; it is not an anonymous route into merchant administration.

Both use GraphQL, but operations and types are not interchangeable. An inventory-sync service needs Admin capabilities, while a custom product listing normally uses Storefront capabilities. For versioned examples in this guide, the stable API baseline is 2026-10.

31. What are GraphQL queries, mutations, variables, and selection sets in a Shopify integration?

A GraphQL query reads data, while a mutation requests a state change. Variables supply typed inputs separately from the operation text. A selection set lists the fields the client wants returned, including nested fields.

This Storefront API 2026-10 query retrieves a bounded product list. The variable count can be supplied as a JSON number rather than interpolated into the query string.

GraphQL example

query CatalogPreview($count: Int!) {
  products(first: $count) {
    nodes {
      id
      title
      handle
    }
  }
}
query CatalogPreview($count: Int!) {
  products(first: $count) {
    nodes {
      id
      title
      handle
    }
  }
}
query CatalogPreview($count: Int!) {
  products(first: $count) {
    nodes {
      id
      title
      handle
    }
  }
}

JSON example

{"count": 6}
{"count": 6}
{"count": 6}

A cart mutation follows the same selection-set principle but changes cart state. Successful HTTP transport does not prove an operation succeeded: inspect GraphQL errors and, for mutations that expose them, payload-level user errors. Query only the fields the interface actually needs.

32. Which Shopify tokens may appear in storefront browser code, and which must remain secret?

A public Storefront API access token may appear in browser or mobile storefront code; Shopify designs that token type for a public client. It grants the configured Storefront capabilities, not Admin access or proof of a customer's identity. Some Storefront operations also support tokenless access.

Private Storefront tokens, Admin API access tokens, and app client secrets must remain secret. Keep them in the appropriate trusted server environment, not Liquid output, browser bundles, public environment variables, or repositories. A secret placed in a frontend build-time environment variable can still become public in the generated JavaScript.

Shopify's authenticated embedded-app mechanisms can mediate Admin access without exposing an Admin token; that is not permission to place the token in a public storefront. Protect customer-specific credentials and cart secrets separately as well.

33. What are app access scopes, and why should an app request only the scopes it needs?

Access scopes define the Shopify resources and operations an app is permitted to use. For example, an app that only reads product data can request read_products; a feature that edits that data needs the corresponding write capability.

Requesting only necessary scopes limits the impact of compromised credentials, reduces unnecessary access to merchant information, and makes the permission request easier to explain. Scopes should follow real features rather than a speculative list of everything the app might do later.

Declaring a scope in app configuration is not the same as having it granted on a store. The app must verify its actual authorization and handle missing or revoked permissions. Some data also has separate approval or access requirements, so a broad-looking scope is not a guarantee of unrestricted access.

34. What is a Shopify webhook, and how is it different from repeatedly polling an API?

A webhook is a notification Shopify sends after an event covered by a subscribed topic, such as creation of an order. Instead of repeatedly asking an API whether anything changed, an app receives a signal when relevant activity occurs.

This reduces unnecessary polling and can make integrations more responsive. For example, an order-created notification can enqueue work to synchronize that order with a fulfillment system. The receiving service should authenticate HTTPS deliveries, acknowledge them promptly, and process expensive work separately.

Webhooks are not an exactly-once transaction stream. Deliveries can be duplicated or arrive out of order, so handlers need idempotency and reconciliation. Polling still has a role for an initial data import, periodic consistency checks, or recovering information missed during an outage.

35. How do development, unpublished, and live themes support a safe Shopify CLI workflow?

A development theme is a temporary, hidden theme used by Shopify CLI for previewing local changes against a store's data. shopify theme dev supports that feedback loop without making the work the live customer-facing theme.

An unpublished theme is a saved, non-live theme suitable for a longer-lived review or release candidate. A live theme is the published theme buyers normally see. Pushing files and publishing a theme are separate decisions.

A safe workflow keeps source control, confirms the target store and theme, develops and checks changes, then previews an unpublished candidate before an explicit publication step. Preserve merchant configuration and a known-good rollback candidate. A preview theme is not a separate store database, so actions such as order tests still require an appropriate test setup.

36. What does Theme Check detect, and what does it not prove about a storefront?

Theme Check statically analyzes Liquid and JSON in themes and theme app extensions. Depending on enabled rules, it can flag syntax problems, missing templates, unused variables or snippets, unknown or deprecated tags, and patterns associated with poor performance.

Run it from the theme directory during development and in continuous integration:

Shell example

A clean result means the analyzed files passed the configured checks, not that the storefront is correct. Theme Check does not demonstrate that a variant picker works, a cart handles network failure, all layouts are accessible, or installed apps coexist safely.

Complement it with browser testing, realistic catalog data, keyboard and screen-reader checks, and performance measurements. Changes to lint configuration also deserve review: disabling a rule can hide a problem without fixing it.

37. What accessibility basics should be built into product pages, navigation, and forms?

Start with semantic HTML: links navigate, buttons perform actions, headings describe the page structure, and form controls have associated labels. Product option groups need clear names, and availability must not be communicated through color alone.

Navigation, variant selection, and purchase controls must work with a keyboard and show visible focus. Image alternatives should describe meaningful product information; decorative images should not create unnecessary announcements. Maintain readable contrast and support zoom and smaller screens.

Forms need understandable instructions and errors connected to the relevant fields. Dynamic cart updates should announce meaningful results without overwhelming assistive technology. Dialogs and drawers need appropriate focus handling, including returning focus when closed.

Automated checks help, but they do not replace manual testing of the complete path from finding a product to reaching checkout.

38. Which SEO metadata and canonical information should a Shopify theme render?

A theme should render a descriptive page title, an appropriate meta description, and a canonical URL in the document head. Use Shopify's page-context objects rather than assigning the same title and description to every page or manually inventing canonical URLs.

This is a minimal metadata fragment for a layout:

Liquid example

<title>{{ page_title | escape }}</title>
{% if page_description != blank %}
  <meta name="description" content="{{ page_description | escape }}">
{% endif %}
<link rel="canonical" href="{{ canonical_url | escape }}">
<title>{{ page_title | escape }}</title>
{% if page_description != blank %}
  <meta name="description" content="{{ page_description | escape }}">
{% endif %}
<link rel="canonical" href="{{ canonical_url | escape }}">
<title>{{ page_title | escape }}</title>
{% if page_description != blank %}
  <meta name="description" content="{{ page_description | escape }}">
{% endif %}
<link rel="canonical" href="{{ canonical_url | escape }}">

Social-sharing metadata and accurate structured data can complement this foundation. Avoid duplicate or conflicting markup from themes and apps, and keep product structured data aligned with visible product information. Metadata supports discoverability; it does not guarantee indexing, rankings, or search-result presentation.

39. How do Checkout UI extensions and Shopify Functions customize different parts of the purchase flow?

Checkout UI extensions add supported interface elements at defined checkout targets, such as an explanatory message or an additional input. They use Shopify's extension APIs and UI components rather than arbitrary access to the checkout page's DOM.

Shopify Functions customize supported backend decisions, such as discount calculations, cart validation, or delivery and payment customization. They execute within Shopify's controlled runtime and do not render a theme section or replace an app's general-purpose backend.

For example, an extension can explain a purchase requirement to the buyer while a validation Function enforces the supported rule. Client-side messaging alone is not a reliable enforcement boundary. Availability varies by target, Function API, distribution, and plan; UI extensions on the information, shipping, and payment steps require Shopify Plus.

40. What are Hydrogen and Oxygen, and how do they fit into a Shopify headless implementation?

Hydrogen is Shopify's headless storefront toolkit. In the 2026-10 generation, it provides Shopify-specific building blocks for API access, carts, variant selection, analytics, and related commerce behavior while the chosen framework owns routing, rendering, and UI. It is no longer accurate to describe this generation as usable only within the older Remix-based architecture.

Oxygen is Shopify's hosting platform for compatible storefront deployments. The current React Router starter deploys to Oxygen, while the Next.js starter has a Vercel deployment path. Hydrogen and Oxygen therefore answer different questions: how to integrate Shopify commerce, and where a compatible application runs.

Neither replaces Shopify's commerce backend or checkout. A headless implementation still needs deliberate decisions about customer authentication, caching, secrets, SEO, and the merchant's content-editing workflow.

Shopify Interview Questions and Answers for Intermediate

The intermediate answers explain implementation choices and their practical boundaries. Examples identify required data, access scopes, and execution context, while testing discussions cover both a successful interaction and the failures a buyer, merchant, or integration may encounter.

41. How would you build a reusable announcement section with merchant-editable text and a configurable link?

Create one section file with settings for the announcement text and destination. A preset makes it available in the theme editor; each section instance then has its own settings. This minimal sections/announcement.liquid example renders nothing when its text is blank and avoids an empty link when no destination is selected.

Liquid example

{% if section.settings.text != blank %}
  <div class="announcement">
    {% if section.settings.link != blank %}
      <a href="{{ section.settings.link | escape }}">
        {{ section.settings.text | escape }}
      </a>
    {% else %}
      <p>{{ section.settings.text | escape }}</p>
    {% endif %}
  </div>
{% endif %}
{% schema %}
{
  "name": "Announcement",
  "settings": [
    {"type": "text", "id": "text", "label": "Text"},
    {"type": "url", "id": "link", "label": "Link"}
  ],
  "presets": [{"name": "Announcement"}]
}
{% endschema %}
{% if section.settings.text != blank %}
  <div class="announcement">
    {% if section.settings.link != blank %}
      <a href="{{ section.settings.link | escape }}">
        {{ section.settings.text | escape }}
      </a>
    {% else %}
      <p>{{ section.settings.text | escape }}</p>
    {% endif %}
  </div>
{% endif %}
{% schema %}
{
  "name": "Announcement",
  "settings": [
    {"type": "text", "id": "text", "label": "Text"},
    {"type": "url", "id": "link", "label": "Link"}
  ],
  "presets": [{"name": "Announcement"}]
}
{% endschema %}
{% if section.settings.text != blank %}
  <div class="announcement">
    {% if section.settings.link != blank %}
      <a href="{{ section.settings.link | escape }}">
        {{ section.settings.text | escape }}
      </a>
    {% else %}
      <p>{{ section.settings.text | escape }}</p>
    {% endif %}
  </div>
{% endif %}
{% schema %}
{
  "name": "Announcement",
  "settings": [
    {"type": "text", "id": "text", "label": "Text"},
    {"type": "url", "id": "link", "label": "Link"}
  ],
  "presets": [{"name": "Announcement"}]
}
{% endschema %}

Keep the schema valid JSON rather than placing Liquid expressions inside it. Add styling in the theme's asset system, and use section-specific IDs if subsequent interactive behavior needs to distinguish multiple instances. Test blank settings, long text, and keyboard-visible link focus.

42. How would you render a product badge from a typed metafield while handling missing values safely?

Read the typed metafield's .value, not an assumed raw string. For a product metafield defined as single_line_text_field at custom.badge, check both its type and value before generating markup.

Liquid example

{% assign badge = product.metafields.custom.badge %}
{% if badge.type == 'single_line_text_field' %}
  {% if badge.value != blank %}
    <span class="product-badge">{{ badge.value | escape }}</span>
  {% endif %}
{% endif %}
{% assign badge = product.metafields.custom.badge %}
{% if badge.type == 'single_line_text_field' %}
  {% if badge.value != blank %}
    <span class="product-badge">{{ badge.value | escape }}</span>
  {% endif %}
{% endif %}
{% assign badge = product.metafields.custom.badge %}
{% if badge.type == 'single_line_text_field' %}
  {% if badge.value != blank %}
    <span class="product-badge">{{ badge.value | escape }}</span>
  {% endif %}
{% endif %}

The type check prevents accidental output if a migrated definition no longer has the expected shape. Escaping is appropriate here because the badge is plain text, not merchant-authored HTML. A boolean badge needs an explicit == true check; a reference metafield needs its referenced object's fields. Rich text requires its supported rendering approach rather than treating .value as safe HTML. Missing, inaccessible, or deleted data should simply omit the optional badge without leaving an empty visual container.

43. How would you create an alternate product JSON template without duplicating its main Liquid section?

Add an alternate template such as templates/product.story.json and reference the existing main product section by its section type. The JSON template describes section instances, their settings, blocks, and display order; the reusable Liquid implementation stays in sections/main-product.liquid.

JSON example

{
  "sections": {
    "main": {
      "type": "main-product",
      "settings": {}
    }
  },
  "order": ["main"]
}
{
  "sections": {
    "main": {
      "type": "main-product",
      "settings": {}
    }
  },
  "order": ["main"]
}
{
  "sections": {
    "main": {
      "type": "main-product",
      "settings": {}
    }
  },
  "order": ["main"]
}

This assumes that main-product already exists in the theme. Preserve any required block configuration from that theme when creating the real alternate template, and add only settings that its schema declares. Assign the alternate template to the intended products in Shopify admin, then customize that template in the theme editor. Do not paste Liquid markup into the JSON or fork the main section merely to change presentation settings. Verify that changes intended for the alternate template do not accidentally alter shared global settings.

44. How should a JavaScript component initialize and clean up when sections are reloaded in the theme editor?

Initialization must work for newly inserted DOM, not only the first page load. Listen for shopify:section:load to initialize the affected section and shopify:section:unload to release listeners, timers, observers, and pending requests. Initialization must be idempotent so repeated editor updates do not multiply handlers.

A custom element can make attachment and cleanup follow the DOM lifecycle automatically. This browser JavaScript assumes each instance contains a button and a panel:

JavaScript example

class NoticeToggle extends HTMLElement {
  connectedCallback() {
    this.abort?.abort();
    this.abort = new AbortController();
    const button = this.querySelector('button');
    const panel = this.querySelector('[data-panel]');
    if (!button || !panel) return;
    button.addEventListener('click', () => {
      panel.hidden = !panel.hidden;
      button.setAttribute('aria-expanded', String(!panel.hidden));
    }, {signal: this.abort.signal});
  }
  disconnectedCallback() { this.abort?.abort(); }
}
if (!customElements.get('notice-toggle')) {
  customElements.define('notice-toggle', NoticeToggle);
}
class NoticeToggle extends HTMLElement {
  connectedCallback() {
    this.abort?.abort();
    this.abort = new AbortController();
    const button = this.querySelector('button');
    const panel = this.querySelector('[data-panel]');
    if (!button || !panel) return;
    button.addEventListener('click', () => {
      panel.hidden = !panel.hidden;
      button.setAttribute('aria-expanded', String(!panel.hidden));
    }, {signal: this.abort.signal});
  }
  disconnectedCallback() { this.abort?.abort(); }
}
if (!customElements.get('notice-toggle')) {
  customElements.define('notice-toggle', NoticeToggle);
}
class NoticeToggle extends HTMLElement {
  connectedCallback() {
    this.abort?.abort();
    this.abort = new AbortController();
    const button = this.querySelector('button');
    const panel = this.querySelector('[data-panel]');
    if (!button || !panel) return;
    button.addEventListener('click', () => {
      panel.hidden = !panel.hidden;
      button.setAttribute('aria-expanded', String(!panel.hidden));
    }, {signal: this.abort.signal});
  }
  disconnectedCallback() { this.abort?.abort(); }
}
if (!customElements.get('notice-toggle')) {
  customElements.define('notice-toggle', NoticeToggle);
}

Set the initial accessibility attributes in Liquid too. Handle section/block selection separately when a slideshow or collapsible panel must stay visible while selected in the editor.

45. How would you pass Liquid data to JavaScript without breaking quoting or introducing script injection?

Serialize for JSON and then escape for the HTML context that contains it. JSON serialization handles string quoting, but it is not a universal defense when inserted into an HTML script element. For small values, a quoted data attribute avoids that raw-script parsing boundary.

Liquid example

<div data-product-title="{{ product.title | json | escape }}"></div>
<div data-product-title="{{ product.title | json | escape }}"></div>
<div data-product-title="{{ product.title | json | escape }}"></div>

Read the browser-decoded attribute and parse it as JSON in a separate JavaScript asset:

JavaScript example

const node = document.querySelector('[data-product-title]');
if (node) {
  try {
    const title = JSON.parse(node.dataset.productTitle);
    node.textContent = typeof title === 'string' ? title : '';
  } catch {
    node.textContent = '';
  }
}
const node = document.querySelector('[data-product-title]');
if (node) {
  try {
    const title = JSON.parse(node.dataset.productTitle);
    node.textContent = typeof title === 'string' ? title : '';
  } catch {
    node.textContent = '';
  }
}
const node = document.querySelector('[data-product-title]');
if (node) {
  try {
    const title = JSON.parse(node.dataset.productTitle);
    node.textContent = typeof title === 'string' ? title : '';
  } catch {
    node.textContent = '';
  }
}

Never build JavaScript string literals by surrounding unescaped Liquid output with quotes. Likewise, avoid sending the parsed value to innerHTML; safe transport does not make an unsafe rendering sink safe. Keep private Admin API tokens and other server credentials out of every theme-generated attribute or script.

46. How would you keep the selected variant, price, media, availability, and URL synchronized on a product page?

Treat the selected option combination as one state change with a single authoritative variant result. Resolve it using the theme's supported variant-selection flow, then update the product form's variant ID, price and compare-at price, featured media, availability message, and add-to-cart state together. Initialize from product.selected_or_first_available_variant so a valid variant deep link is respected.

Distinguish an impossible option combination from an existing but unavailable variant. Both can disable purchase, but they need different messaging. Update the variant URL parameter with the History API without discarding unrelated parameters, and support browser back/forward navigation.

For asynchronous section requests, cancel obsolete work or reject responses with an old selection sequence number. Otherwise, a slow response can overwrite the buyer's newer choice. Prefer server-rendered, contextual prices over recreating currency formatting and pricing rules in JavaScript. Do not assume a serialized product contains every variant in a large catalog product.

47. How would you add a selected variant to the cart with the Ajax API and handle validation failures?

Send the selected variant's numeric ID and quantity to the locale-aware Ajax cart endpoint, not a product ID. The following browser helper validates quantity and treats non-success HTTP responses as failures:

JavaScript example

async function addVariant(variantId, quantity) {
  if (!Number.isInteger(quantity) || quantity < 1) {
    throw new Error('Enter a valid quantity.');
  }
  const response = await fetch(`${window.Shopify.routes.root}cart/add.js`, {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({items: [{id: variantId, quantity}]})
  });
  const body = await response.json().catch(() => ({}));
  if (!response.ok) {
    throw new Error(body.description || 'The item could not be added.');
  }
  return body;
}
async function addVariant(variantId, quantity) {
  if (!Number.isInteger(quantity) || quantity < 1) {
    throw new Error('Enter a valid quantity.');
  }
  const response = await fetch(`${window.Shopify.routes.root}cart/add.js`, {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({items: [{id: variantId, quantity}]})
  });
  const body = await response.json().catch(() => ({}));
  if (!response.ok) {
    throw new Error(body.description || 'The item could not be added.');
  }
  return body;
}
async function addVariant(variantId, quantity) {
  if (!Number.isInteger(quantity) || quantity < 1) {
    throw new Error('Enter a valid quantity.');
  }
  const response = await fetch(`${window.Shopify.routes.root}cart/add.js`, {
    method: 'POST',
    headers: {'Content-Type': 'application/json'},
    body: JSON.stringify({items: [{id: variantId, quantity}]})
  });
  const body = await response.json().catch(() => ({}));
  if (!response.ok) {
    throw new Error(body.description || 'The item could not be added.');
  }
  return body;
}

The calling submit handler should prevent duplicate clicks, catch errors into an accessible text-only status region, and restore controls in finally. Stock can change after page rendering, so an enabled button does not prove the request will succeed. On an ambiguous network failure, reconcile the cart before retrying; blindly repeating an add can increase quantity twice.

48. Why can one variant appear on multiple cart lines, and how should a cart editor target the correct line?

A variant ID identifies merchandise, not necessarily a unique cart line. The same variant can be split into separate lines because its properties, selling plan, or discount treatment differs. Updating by variant ID alone can therefore change the wrong personalization or purchase option.

Use the current line item's key as the id in an Ajax cart/change.js request. Alternatively, line accepts a one-based position, but positions are unsafe if another operation has changed the cart order. Serialize cart edits and obtain fresh line identities from the returned cart rather than retaining an old array index.

Line keys can change when a line's characteristics change, so they are not permanent database identifiers. If an edit response conflicts with the displayed cart, refresh and reconcile before another write. Replacing line properties also requires care: preserve properties that should remain instead of unintentionally overwriting the entire property set.

49. How can bundled section rendering update a cart drawer after a cart mutation, and how should missing section HTML be handled?

Include a sections list in a supported Ajax cart mutation to receive updated section HTML alongside the cart result. Request the drawer, cart count, and other affected section IDs, up to the supported five-section limit. Use the actual section IDs rendered by the theme; a section type or filename is not always the instance ID.

A valid sections_url supplies the page context when the current page is not appropriate. On success, parse the returned fragments, replace only the intended containers, and restore component behavior and focus.

Treat each section result independently: null or missing HTML means rendering failed, not necessarily that the cart mutation failed. Keep existing usable markup, fetch fresh sections or cart state, and provide a normal cart-page fallback. Do not repeat an add operation merely because the drawer could not render. Mutation outcome, rendering outcome, and the status message shown to the buyer are three separate concerns.

50. How would you implement collection filtering and sorting while preserving pagination and shareable URLs?

Use Shopify's storefront filter definitions and their provided parameter names, rather than inventing client-only filters. Render the collection's available filters, active selections, counts, and removal links. Apply sorting through sort_by, and use Liquid paginate for the product collection so the server determines each results page.

The URL should represent the complete filter and sort state. Preserve repeated parameters for multi-select filters and retain unrelated context, but remove page whenever filters or sorting change: an old page number can point beyond the new result set. Pagination links should carry the active filters and sort order forward.

Progressively enhance the normal form and links with section rendering if desired. Update browser history only for the displayed result state, respond to popstate, reject stale requests, and announce the revised result count. Test empty results and refresh/share/back navigation; a visually correct filter that loses its state on reload is incomplete.

51. How would you implement predictive search that avoids stale results and remains keyboard-accessible?

Build predictive search as a progressively enhanced search form with a usable full-results submission. Debounce typing, clear suggestions for empty input, and use Shopify's locale-aware predictive-search endpoint. Abort the previous request and also compare a sequence number or query value before rendering; cancellation alone does not guarantee an older completed response cannot win a race.

For accessibility, implement a coherent combobox pattern: a labeled input, accurate expanded state, a relationship to the suggestions, and an active option that changes with Arrow keys. Escape closes the popup, Enter follows the selected result or submits the query, and Tab must not trap focus.

Announce result counts and errors without repeatedly reading the entire list. Keep loading, no-results, and service-failure states distinct. Insert only trusted server-rendered fragments or safely created text nodes, preserve visible focus, and test touch interaction, keyboard-only use, and screen-reader behavior rather than assuming ARIA attributes alone make the component accessible.

52. How do theme translations differ from market-specific currency, pricing, and product availability?

Theme translations change language: locale JSON supplies interface strings, and Liquid's t filter resolves translation keys. Product descriptions and other merchant content have their own translation workflow. Translating “Add to cart” does not choose the buyer's market or convert a price.

Market context determines commercial behavior such as currency, contextual pricing, catalog availability, and relevant buyer eligibility. A buyer can prefer French while shopping in a market whose currency is not the euro. Keep country and language choices distinct, using Shopify localization mechanisms rather than a cosmetic currency symbol replacement.

In a headless storefront, pass the intended country and language context to Storefront queries and align the cart's buyer identity with that choice. Render the returned money amounts and currency codes; do not calculate a parallel storefront price by applying an arbitrary exchange rate. Test unavailable products and market switches as well as translated labels.

53. How would you prevent conflicting canonical URLs and duplicate product structured data in a customized theme?

Give one theme component ownership of the canonical link and one coordinated implementation ownership of product structured data. Render the canonical URL from Shopify's canonical_url in the document head rather than building a second URL from the current query string. Audit layout snippets, SEO apps, and app embeds for additional canonical tags.

For structured data, use the supported product representation, such as the Liquid structured_data filter, or a carefully maintained implementation—not both for the same product without coordination. The important issue is conflicting Product or Offer entities, not the mere presence of several different schema types on a page.

Inspect rendered HTML across variant links, collection-qualified product paths, translated pages, and unavailable products. Confirm price, currency, availability, product identity, and canonical destination agree with the visible page. Recheck after app installation or theme changes, since duplication often comes from a second integration rather than the original template.

54. How would you optimize a product page's largest image without lazy-loading its likely LCP element?

Identify the likely LCP image from actual mobile and desktop measurements, then make it discoverable in the initial HTML. Do not lazy-load that image. Deliver responsive sizes that match its rendered width, preserve dimensions to prevent layout shifts, and reserve high fetch priority for the image that genuinely needs it.

This product-section Liquid assumes hero is the first visible product image:

Liquid example

{% assign hero = product.featured_image %}
{% if hero %}
  {{ hero | image_url: width: 1600 | image_tag:
    widths: '480, 768, 1100, 1600',
    sizes: '(min-width: 990px) 50vw, 100vw',
    loading: 'eager',
    fetchpriority: 'high'
  }}
{% endif %}
{% assign hero = product.featured_image %}
{% if hero %}
  {{ hero | image_url: width: 1600 | image_tag:
    widths: '480, 768, 1100, 1600',
    sizes: '(min-width: 990px) 50vw, 100vw',
    loading: 'eager',
    fetchpriority: 'high'
  }}
{% endif %}
{% assign hero = product.featured_image %}
{% if hero %}
  {{ hero | image_url: width: 1600 | image_tag:
    widths: '480, 768, 1100, 1600',
    sizes: '(min-width: 990px) 50vw, 100vw',
    loading: 'eager',
    fetchpriority: 'high'
  }}
{% endif %}

Adjust sizes to the real layout; incorrect values can still download an unnecessarily large file. Lazy-load offscreen gallery images, and avoid preloading every image or duplicate sources. Validate the rendered image attributes, network priority, layout stability, and field performance rather than claiming the markup alone guarantees a particular LCP score.

55. How would you reduce unnecessary JavaScript and app-asset loading on storefront pages?

Start with a network and execution inventory by page type. Identify which scripts perform essential behavior, which are only needed for a specific section, and which duplicate another integration. Remove obsolete assets only after checking their owner and downstream dependencies.

Load feature code where the feature exists, use deferred or module scripts when appropriate, and initialize components on demand rather than running every component on every page. Split large optional interactions and avoid repeated third-party loaders. Theme app extensions provide a cleaner boundary for app-owned blocks, embeds, and their assets, but still need measurement and appropriate merchant configuration.

Do not “optimize” by deleting required Shopify output or indiscriminately delaying checkout, consent, accessibility, or variant-selection behavior. Compare before-and-after traces for transferred bytes, long tasks, and interaction latency. Test collection, product, cart, and editor experiences separately; removing work from the home page does not establish that the rest of the storefront improved.

56. How would you manage focus, keyboard controls, and status announcements in an asynchronous cart drawer?

Decide whether the drawer is modal and implement that interaction consistently. A modal drawer needs an accessible name, focus moved inside after opening, keyboard containment, a visible close control, Escape handling, and focus restored to the trigger when it closes. Background content must not remain interactable as though the drawer were absent.

During quantity changes, retain enough stable DOM to avoid losing focus whenever new cart HTML arrives. Disable or mark only the controls that are actually busy, preserve the current item context, and move focus predictably if the edited line disappears.

Use a polite live region for concise outcomes such as “Quantity updated” or a revised total; show validation failures next to the relevant control as well. Do not open the drawer or announce success before the mutation succeeds. Test empty-cart transitions, stock failures, slow responses, rapid updates, and keyboard-only completion of the entire purchase path.

57. How would you define and expose a product metafield with the right type, validation, and storefront access?

Create a metafield definition for the correct owner type, such as PRODUCT, with a stable namespace and key. Choose a type that represents the real value: an integer for a count, a measurement for a dimension, or a product reference for a relationship—not text merely because it is easy to store.

Add suitable supported validations, such as allowed choices or numeric bounds, and handle existing records that fail those rules before migration. Separate merchant-editable fields from app-owned configuration according to the intended ownership and access model.

Storefront API visibility must be configured intentionally, commonly with definition access storefront: PUBLIC_READ for data intended to be public. Verify the applicable Liquid and API access behavior rather than assuming an Admin-readable field appears everywhere. Never expose secrets or customer-private information through public custom data. Test a valid value, invalid update, missing value, and storefront read using the actual client context.

58. How would you model a reusable size guide or brand profile with metaobjects and product references?

Use a metaobject definition for the reusable entity and a product metafield reference for the relationship. A size-guide definition might contain a title, measurement content, and an illustration; a brand profile might contain a name, logo, biography, and website. Products then reference one shared entry rather than copying those fields across hundreds of products.

Choose metaobject_reference for one guide or list.metaobject_reference for several, with validation restricting references to the intended definition. Configure access and any publishable capability deliberately so only the appropriate entries reach the storefront.

Render referenced fields according to their types, and omit optional content when an entry is missing, unavailable, or deleted. Keep product-specific exceptions separate from shared brand data. Before changing the definition, review every consuming theme block and headless query: a shared content model reduces duplication, but a schema change can affect many products simultaneously.

59. How would you retrieve all matching products using GraphQL cursor pagination without assuming one response is complete?

Use the connection's pageInfo to drive iteration. In GraphQL Admin API 2026-10, this query requests one page of matching products:

GraphQL example

query MatchingProducts($after: String, $query: String!) {
  products(first: 100, after: $after, query: $query) {
    nodes { id title }
    pageInfo { hasNextPage endCursor }
  }
}
query MatchingProducts($after: String, $query: String!) {
  products(first: 100, after: $after, query: $query) {
    nodes { id title }
    pageInfo { hasNextPage endCursor }
  }
}
query MatchingProducts($after: String, $query: String!) {
  products(first: 100, after: $after, query: $query) {
    nodes { id title }
    pageInfo { hasNextPage endCursor }
  }
}

Begin with after: null and a fixed search expression such as status:active. Process the returned nodes, then pass endCursor as the next after while hasNextPage is true. Keep the filter and ordering consistent throughout the traversal.

Check transport and GraphQL errors before advancing the cursor, persist progress for long jobs, and apply cost-aware scheduling. Reject an unexpected missing or unchanged cursor rather than looping forever. Paginate nested connections independently; fetching every product does not automatically fetch every variant. For large exports, prefer an appropriate bulk operation. A changing catalog is not a transactionally frozen snapshot, so deduplicate by ID and plan reconciliation where necessary.

60. Why can a GraphQL request return HTTP 200 even when a Shopify mutation failed, and what must the client inspect?

HTTP 200 means the GraphQL endpoint returned a response, not that every requested operation achieved its business goal. The client must inspect three layers: HTTP/network failure, top-level GraphQL errors, and mutation-specific userErrors. It must also check the expected payload rather than assuming a non-null data object proves success.

For example, an Admin mutation can return validation messages with field paths inside its payload while the HTTP status remains 200. Request those error fields in the mutation selection set; otherwise, useful diagnostics may be absent from the response.

Treat partial query data according to the use case. A dashboard might display unaffected fields with a warning, but a dependent write should not proceed on incomplete prerequisites. Classify authentication, permission, validation, throttling, and transient failures separately. An ambiguous timeout after a mutation requires outcome reconciliation or supported idempotency, not an unconditional retry that might duplicate the effect.

61. How should an integration use GraphQL query cost and throttleStatus when scheduling requests and retries?

Schedule GraphQL Admin API work against cost capacity, not a fixed requests-per-second guess. Responses expose extensions.cost, including requested and actual query cost plus throttleStatus values such as currentlyAvailable and restoreRate. Keep scheduling scoped to the relevant app-and-store bucket and coordinate workers sharing that capacity.

An approximate wait estimate for a planned cost is:

JavaScript example

function waitMilliseconds(nextCost, throttleStatus) {
  const deficit = Math.max(0, nextCost - throttleStatus.currentlyAvailable);
  if (deficit === 0) return 0;
  if (throttleStatus.restoreRate <= 0) return null;
  return Math.ceil(1000 * deficit / throttleStatus.restoreRate);
}
function waitMilliseconds(nextCost, throttleStatus) {
  const deficit = Math.max(0, nextCost - throttleStatus.currentlyAvailable);
  if (deficit === 0) return 0;
  if (throttleStatus.restoreRate <= 0) return null;
  return Math.ceil(1000 * deficit / throttleStatus.restoreRate);
}
function waitMilliseconds(nextCost, throttleStatus) {
  const deficit = Math.max(0, nextCost - throttleStatus.currentlyAvailable);
  if (deficit === 0) return 0;
  if (throttleStatus.restoreRate <= 0) return null;
  return Math.ceil(1000 * deficit / throttleStatus.restoreRate);
}

This is a scheduling hint, not a reservation: concurrent calls can consume capacity meanwhile. Reduce unnecessary fields and oversized connections, add jitter and bounded backoff for retryable throttling, and refresh estimates from new responses. Do not retry validation or authorization failures as if they were throttling. Before retrying a mutation after uncertain execution, establish idempotency or reconcile its result.

62. What security checks are needed when implementing Shopify's authorization code grant for a standalone app?

Validate the requested shop as an allowed, strictly formed Shopify shop domain before constructing any authorization or token endpoint. An untrusted shop parameter must not become an arbitrary server-side request destination. Use approved HTTPS redirect URLs and request only the necessary scopes.

Generate an unpredictable OAuth state, bind it to the browser that initiated the flow, and compare it on the callback. Verify the callback HMAC using Shopify's OAuth parameter canonicalization rules and a constant-time comparison; webhook raw-body HMAC rules are different. Reject missing, mismatched, or stale flow state before exchanging the authorization code.

Perform the code exchange server-side with the app secret, then bind the resulting credentials and granted permissions to the verified shop. Secure the app's own browser session and every subsequent endpoint. Encrypt stored credentials, redact them from logs, and never return a private Admin access token to storefront JavaScript. Prefer Shopify's maintained authentication library over a hand-built flow.

63. How do App Bridge ID tokens, formerly called session tokens, and token exchange authenticate an embedded app?

An App Bridge ID token—formerly called a session token—is a short-lived signed JWT that authenticates an embedded admin user's request to the app backend. It is not an Admin API access token and does not independently grant API scopes.

The frontend obtains a fresh token through App Bridge and sends it to the backend. The backend verifies the signature and relevant claims, including expiry, not-before, audience, and the issuer/destination relationship. Derive the shop from that validated identity, not an unsigned body parameter. Shopify's maintained app authentication helpers handle this validation in supported templates.

Token exchange then obtains the appropriate scoped Admin access token for authorized server-side calls. Do not blindly exchange on every call if the framework already manages a valid stored credential, but do authenticate every incoming request. Reject invalid identity tokens, renew short-lived frontend identity as needed, and keep private Admin credentials out of the browser bundle and response payloads.

64. When should an app use online versus offline access tokens, and how should it handle expiry and renewal?

Online tokens are appropriate when an operation should be constrained by the current staff user's identity and permissions. Offline tokens are suitable for installation-level work that must continue without that user present, such as webhook processing and scheduled synchronization. “Offline” describes the execution relationship, not a promise that the credential never expires.

Read expires_in and use the supported renewal flow. Renew online access through authenticated token exchange or authorization as appropriate. Expiring offline tokens use refresh handling; new public apps require them, with existing public apps due to migrate by January 2027. Persist rotated credentials atomically and serialize competing refresh attempts so one worker cannot overwrite newer credentials.

Track the installation, granted scopes, expiry, and revocation state. On authentication failure, distinguish expired credentials from uninstall or revoked access rather than refreshing indefinitely. Background jobs should pause safely when authorization cannot be restored. Store secrets encrypted, omit them from logs, and never substitute an online token for unattended work merely because it happens to be available.

65. How would you verify an HTTPS Shopify webhook without changing the bytes used for its HMAC signature?

Compute the webhook HMAC over the exact received body bytes before JSON parsing or normalization. In a Node.js server, this verification helper assumes rawBody is a Buffer captured by raw-body middleware and signature is the X-Shopify-Hmac-Sha256 header:

JavaScript example

import {createHmac, timingSafeEqual} from 'node:crypto';

function validWebhook(rawBody, signature, secret) {
  if (!Buffer.isBuffer(rawBody) || typeof signature !== 'string') return false;
  if (!/^[A-Za-z0-9+/]{43}=$/.test(signature)) return false;
  const expected = createHmac('sha256', secret).update(rawBody).digest();
  const supplied = Buffer.from(signature, 'base64');
  return supplied.length === expected.length &&
    timingSafeEqual(supplied, expected);
}
import {createHmac, timingSafeEqual} from 'node:crypto';

function validWebhook(rawBody, signature, secret) {
  if (!Buffer.isBuffer(rawBody) || typeof signature !== 'string') return false;
  if (!/^[A-Za-z0-9+/]{43}=$/.test(signature)) return false;
  const expected = createHmac('sha256', secret).update(rawBody).digest();
  const supplied = Buffer.from(signature, 'base64');
  return supplied.length === expected.length &&
    timingSafeEqual(supplied, expected);
}
import {createHmac, timingSafeEqual} from 'node:crypto';

function validWebhook(rawBody, signature, secret) {
  if (!Buffer.isBuffer(rawBody) || typeof signature !== 'string') return false;
  if (!/^[A-Za-z0-9+/]{43}=$/.test(signature)) return false;
  const expected = createHmac('sha256', secret).update(rawBody).digest();
  const supplied = Buffer.from(signature, 'base64');
  return supplied.length === expected.length &&
    timingSafeEqual(supplied, expected);
}

Register that route before JSON middleware can consume or transform its body. Reject invalid signatures before processing payload fields, and parse only after verification. Apply request-size limits and handle malformed JSON separately. Use the app's client secret, not an Admin API token. A valid signature does not make processing idempotent: duplicate detection and authorization-sensitive handling remain necessary after authenticity has been established.

66. How would you acknowledge webhooks quickly while reliably queuing work and suppressing duplicate deliveries?

Acknowledge only after the verified event has been durably accepted. The request handler should validate the HMAC, perform minimal envelope checks, and commit an inbox record plus queued work before returning a successful response. If a database and queue cannot share a transaction, a transactional outbox avoids the gap where acknowledgment succeeds but enqueueing is lost.

Enforce a uniqueness constraint on the chosen delivery identifier and installation scope, using X-Shopify-Webhook-Id for delivery deduplication. Duplicate accepted deliveries can return success without repeating their side effects. When several deliveries of the same underlying event matter, account for X-Shopify-Event-Id as well.

Workers should be retryable and idempotent, with attempt tracking, backoff, and a dead-letter path for investigation. Do not assume arrival order reflects resource update order. A failed durable write must not receive a success acknowledgment, and a successful enqueue must not depend on the worker finishing inside Shopify's delivery timeout.

67. How would you add an app permission without assuming that every existing installation has already granted it?

Declare the new permission in the app's supported scope configuration, deploy that change, and treat each installation's granted scopes as the authority. A released configuration is a request for access, not proof that every merchant has approved it.

For optional functionality, use the supported dynamic scope-request flow and explain the feature requiring access. For required scope changes, follow the appropriate managed-installation or authorization-code approval path. Query the installation's actual access scopes and update local authorization state when scope changes occur.

Gate the new feature until the required permission is present. Existing jobs and UI should degrade safely rather than repeatedly issuing forbidden API calls or implying that installation is broken. Test a new install, an existing install before approval, approval, and permission revocation. Scope approval also does not automatically satisfy protected-customer-data requirements or other resource-specific eligibility checks, which must be handled independently.

68. Why would an app use a theme app extension instead of directly modifying a merchant's theme files?

A theme app extension packages app-owned Liquid, assets, and settings as app blocks or app embeds without rewriting the merchant's theme source. Merchants can control placement and activation through the theme editor, while app updates can be delivered through the extension lifecycle.

This reduces brittle string-based theme edits, merge conflicts during theme upgrades, and leftover injected code after uninstall. App blocks suit content placed in supported sections; app embeds suit broader integrations whose placement is not a normal section block. Compatibility still matters: a theme must support the relevant placement, and installing the app does not guarantee its block has been added or its embed enabled.

Keep assets scoped and lightweight, support editor reload behavior, and explain any activation steps. An extension is not a security boundary for its backend: storefront requests still require the correct authentication and authorization. Private Admin API credentials must remain server-side.

69. How would you create a cart through the Storefront API and send the buyer to Shopify checkout?

Use the Storefront Cart API, not the retired checkout-creation approach. This Storefront API 2026-10 mutation creates a cart from product-variant merchandise IDs:

GraphQL example

mutation StartCart($input: CartInput!) {
  cartCreate(input: $input) {
    cart { id checkoutUrl }
    userErrors { field message }
    warnings { code message }
  }
}
mutation StartCart($input: CartInput!) {
  cartCreate(input: $input) {
    cart { id checkoutUrl }
    userErrors { field message }
    warnings { code message }
  }
}
mutation StartCart($input: CartInput!) {
  cartCreate(input: $input) {
    cart { id checkoutUrl }
    userErrors { field message }
    warnings { code message }
  }
}

Supply input.lines with merchandiseId and quantity, and include the appropriate buyer identity when known. Check HTTP status, top-level GraphQL errors, mutation errors, and warnings before presenting the result. Persist the complete returned cart ID securely; its secret-bearing portion must not be exposed in analytics or logs.

Use the API-returned checkoutUrl to send the buyer to Shopify checkout rather than constructing an order or checkout URL yourself. Reconcile the current cart and retrieve an up-to-date checkout URL at the transition. Keep private Storefront credentials on the server; browser access, when used, requires the appropriate public Storefront authentication rather than an Admin token.

70. How should a headless storefront keep product-query context and cart buyer identity consistent across markets?

Make market selection an explicit part of application state shared by catalog queries and cart operations. For product queries, use the intended country, language, and any supported authenticated buyer context. For a cart, set the corresponding country and customer information through its buyer identity, including cartBuyerIdentityUpdate when the buyer changes context.

In the current Storefront API behavior, a cart's established buyer identity takes precedence over conflicting @inContext buyer or country values. Changing only the product query's country can therefore show one price while the cart retains another context.

After a market switch, reread cart lines, costs, and availability instead of assuming only the currency symbol changes. Explain removed or unavailable merchandise and changes in pricing. Partition cached catalog responses by their relevant context, and keep personalized buyer data out of shared caches. Language selection and country selection should remain independent even when the interface offers a convenient combined selector.

71. How does the Customer Account API differ from merchant app authentication and legacy Storefront customer access tokens?

The Customer Account API serves the authenticated buyer's private account experience, such as orders and profile information. Its hosted customer login and customer-scoped authorization are separate from an app installation's merchant Admin API authorization.

A merchant app's online or offline Admin token must not be handed to a customer frontend to implement “my orders.” The backend must use the correct customer authentication flow, validate OAuth state and the applicable PKCE/OpenID Connect requirements, and protect the resulting customer session and refresh credentials.

Legacy Storefront customer access tokens belong to the older customer-account integration model; they are not interchangeable with Customer Account API tokens or Admin tokens. Choose the flow that matches the store's customer-account setup and the API being called. For headless checkout, use the documented buyer-identity integration for that authenticated customer. Test login, expiry, logout, and cross-customer isolation rather than merely checking that one sample account can retrieve an order.

72. What does an app proxy signature prove, and what additional authorization is needed for customer-specific actions?

A valid app proxy signature establishes that the signed request parameters came through Shopify for the identified shop. It does not mean that the caller is a merchant administrator, nor does it make every payload field trustworthy. Anyone visiting the storefront can reach public proxy routes.

Verify the signature using the app-proxy-specific rules, then derive the shop from the verified parameters. For a logged-in customer action, use the signed logged_in_customer_id, require it to be present, and authorize the requested record against that customer and shop. Never accept an arbitrary customer ID in the request body as proof of identity.

Validate the action and input, protect sensitive state changes against replay and cross-site request risks as appropriate, and apply abuse controls. Do not expose store-setting changes or general Admin operations behind a proxy merely because its signature verifies. Anonymous visitors should receive only functionality intentionally designed to be public.

73. How do a Shopify Function's input query, configuration, executable logic, and output work together?

The input query declares which fields Shopify supplies to the Function at execution time. It is not a request that the Function sends to the Admin API while running. Keep it minimal and use the schema for the chosen Function API version and target.

Extension configuration ties together the target, input-query file, compiled WebAssembly artifact, and executable export. Merchant-specific rules can be stored in supported configuration data, commonly metafields that the input query reads. The executable applies deterministic logic to that input and returns the target's defined output structure, such as permitted discount operations or validation errors.

Shopify interprets that output within its own commerce workflow; returning arbitrary JSON or mutating an input object does not directly change a cart. Handle absent or malformed configuration with an explicit safe behavior. Test realistic input fixtures, limits, and output validity. Network access, capabilities, and availability depend on the specific Function target rather than ordinary server-side assumptions.

74. How would you choose a Checkout UI extension target and verify its available APIs, capabilities, and eligibility?

Begin with the desired placement and behavior, then select a target available in the pinned Checkout UI extension API version. A merchant-positioned block, a fixed-location UI target, and a runnable target have different placement and execution contracts.

Read that target's supported APIs and components before choosing an implementation. Declare required capabilities in the extension configuration, and check whether operations such as network access, buyer-journey interception, or protected customer data need additional permission or approval. Do not assume a feature available on one target exists on another.

Eligibility is surface-specific: information, shipping, and payment-step UI extensions require Shopify Plus, while other surfaces have their own rules. Verify the actual store and checkout configuration, including accelerated flows. Use the version's current supported UI stack rather than copying obsolete extension examples. Test placement, missing optional data, denied capabilities, and editor configuration without relying on unrestricted checkout DOM access.

75. How do ProductVariant, InventoryItem, InventoryLevel, and Location relate in an inventory integration?

A ProductVariant is the sellable product configuration. Its InventoryItem represents the inventory-tracked item, while a Location identifies a stocking or fulfillment place. An InventoryLevel connects an inventory item to a location and exposes the relevant named quantities there.

Consequently, inventory writes need the inventory item and location identities, not just a product ID or SKU. A SKU is useful operational data but should not be assumed globally unique or immutable. Confirm tracking and stocking relationships before applying updates, and distinguish quantity states rather than treating every inventory number as “available.”

Use absolute quantity setting only when the external system is authoritative; otherwise use an appropriate adjustment workflow. For Admin API 2026-10, current inventory mutations have version-specific concurrency and idempotency requirements, including changeFromQuantity for quantity comparisons. Handle stale-value errors by rereading and reconciling rather than overwriting concurrent sales or transfers. Persist mappings and audit the reason for every stock change.

76. Why should an order integration work with fulfillment orders instead of treating an order as one shipment?

An order describes the purchase; a fulfillment order represents work allocated for fulfillment. One order can produce several fulfillment orders because items are assigned to different locations, services, or delivery arrangements. Partial fulfillment and later routing changes mean “one order equals one shipment” is not a reliable model.

Read the relevant fulfillment orders, their current status, assigned location, line items, remaining quantities, and supported actions. Use fulfillment-order line item identities when creating fulfillment work, and create tracking information for the actual shipment rather than marking the entire order complete prematurely.

Access scopes depend on whether the app manages its own service, merchant-managed locations, or third-party fulfillment work. Recheck permission and state when a request fails, because work may have moved, been held, or been canceled since it was first read. Make outbound shipment creation idempotent and reconcile webhook updates so retries cannot produce duplicate shipments or tracking notifications.

77. What does deploying a Shopify app version release, and what still needs a separate backend deployment?

A Shopify app version is a snapshot of the app configuration and extensions released through Shopify. Deploying it can release extension code, extension assets, and applicable configuration changes such as declared scopes. It does not deploy the app's externally hosted web server, database, or background workers.

The backend needs its own hosting deployment, secret configuration, migrations, and operational verification. Coordinate these releases so old and new extension versions can coexist with the backend during propagation and rollback. A newly declared scope still needs the relevant installation's approval before the app can use it.

Separate creating a version from releasing it when staging a rollout, and record which app version corresponds to which backend build. Releasing an earlier Shopify version can revert that configuration and extension snapshot, but it does not undo a database migration or roll back the hosting platform. Verify both sides after deployment, including OAuth URLs, webhooks, and extension-to-backend requests.

78. How would you test a Shopify integration using a development store, fixtures, and real end-to-end flows?

Use a development store to exercise Shopify's actual authentication, configuration, commerce objects, and webhook behavior without modifying production data. Build repeatable fixtures with explicit product, variant, inventory, market, and customer assumptions, and avoid real customer personal data in test snapshots.

Split testing into layers. Unit tests cover local transformations and error classification; contract tests check the pinned API schema and fixture shapes; integration tests verify permissions, pagination, token renewal, and retry behavior. End-to-end flows should install the app, perform the intended merchant or buyer action, observe Shopify's resulting state, and confirm the local system reconciles it.

Include failure cases: revoked scope, duplicate and out-of-order webhook delivery, unavailable stock, stale cart responses, and API throttling. Theme work also needs editor reloads and accessibility testing. Mocked success responses are useful but cannot prove real installation or checkout behavior. Record which tests were actually run and clean up the created test resources.

79. What should an app do when it is uninstalled, and why is uninstall handling different from data redaction?

On a verified app/uninstalled event, mark the installation inactive, stop scheduled work, cancel pending operations that require access, and remove or disable stored credentials. Shopify revokes access on uninstall, so do not rely on a final Admin API call to perform cleanup afterward. Make the handler idempotent and preserve enough minimal lifecycle information to avoid processing stale events as a fresh installation.

Uninstall is an operational lifecycle event, not a replacement for privacy processing. Public apps must also handle the applicable compliance webhooks, including customers/data_request, customers/redact, and shop/redact. Those events concern access to or deletion of retained data and have their own scope and timing.

Apply the app's documented retention policy and relevant obligations to databases, derived datasets, exports, and backups. Do not retain personal data indefinitely merely because API access disappeared, and do not treat deleting an access token as equivalent to redacting all customer information.

80. How do selling plans and subscription contracts differ from an ordinary one-time purchase?

A selling plan describes a purchase option offered with a product, including subscription-related billing, delivery, and pricing policies. The buyer selects the plan together with the variant, and the cart line carries that plan selection. A one-time purchase has no subscription selling-plan selection.

A subscription contract represents the customer's ongoing agreement after the subscription purchase. It contains the continuing relationship and terms that subscription tooling manages, rather than merely pointing to a discounted product in the cart. Updating a selling plan does not automatically rewrite every existing contract.

A subscription integration must handle subsequent billing attempts, payment failures, pauses or cancellations, and resulting orders according to the supported contract workflow. It also needs appropriate scopes and eligibility. Display the correct selling-plan allocation price and cadence on the storefront, preserve the selected plan through cart changes, and distinguish recurring purchases from prepaid delivery arrangements instead of assuming every subscription charges on every delivery.

Shopify Interview Questions and Answers for Experienced

The experienced answers weigh platform capabilities against operational needs. They explain how to diagnose failures, protect credentials and customer data, handle retries and duplicate deliveries, and validate a rollout with evidence rather than assumptions about every store.

81. How would you choose between an Online Store theme, a headless storefront, and an app-led extension for a complex commerce requirement?

Choose the smallest platform surface that meets the requirement without taking away merchant control. A theme fits content-rich commerce that benefits from Shopify's editor, app ecosystem, and managed storefront delivery. An app extension fits a bounded capability, such as merchandising or supported checkout behavior, without replacing the storefront. Headless is justified when interaction design, channel reuse, or integration constraints outweigh operating an additional frontend.

Compare each option against a concrete purchase journey: catalog discovery, localization, identity, cart, checkout, analytics, accessibility, and preview workflows. Verify that required checkout extension points and APIs exist; a custom frontend does not remove Shopify's checkout boundaries.

Prototype the riskiest requirement before committing. Estimate ownership of hosting, caching, security patches, SEO, and support—not just initial development. Prefer a theme plus an extension when that achieves the outcome, and document the measurable benefit that warrants headless complexity.

82. How would you prevent one shop's authenticated request, cache entry, or background job from accessing another shop's data?

Resolve the shop from a verified Shopify authentication flow, then map it to an internal tenant record. Never select an Admin API credential using an unverified query parameter, browser-supplied shop name, or object ID. Authentication establishes identity; every operation must separately check permissions and resource ownership.

Include tenant identity in database keys, cache namespaces, object-storage paths, and idempotency records. Where staff permissions affect results, include the authenticated user or permission context too. Enforce tenant predicates centrally rather than expecting every handler to remember them.

Background jobs should contain an immutable tenant identifier and installation generation, not copied access tokens. Workers reload current encrypted credentials and reject jobs belonging to an uninstalled or replaced installation. Test requests that deliberately mix shop A's identity with shop B's resource IDs, including cached responses, exports, retries, and administrator support tools.

83. How would you keep a local Shopify data replica correct despite duplicate, delayed, out-of-order, or missed webhooks?

Treat webhooks as change notifications, not an ordered transaction log. Verify HTTPS HMAC against the untouched body before parsing, then durably record the delivery and enqueue processing before acknowledging it. A unique shop-and-delivery-ID constraint prevents duplicate ingestion.

JavaScript example:

import {createHmac, timingSafeEqual} from 'node:crypto';

function validWebhook(rawBody, header, secret) {
  if (typeof header !== 'string') return false;
  const expected = createHmac('sha256', secret).update(rawBody).digest();
  const supplied = Buffer.from(header, 'base64');
  return supplied.length === expected.length &&
    timingSafeEqual(supplied, expected);
}
import {createHmac, timingSafeEqual} from 'node:crypto';

function validWebhook(rawBody, header, secret) {
  if (typeof header !== 'string') return false;
  const expected = createHmac('sha256', secret).update(rawBody).digest();
  const supplied = Buffer.from(header, 'base64');
  return supplied.length === expected.length &&
    timingSafeEqual(supplied, expected);
}
import {createHmac, timingSafeEqual} from 'node:crypto';

function validWebhook(rawBody, header, secret) {
  if (typeof header !== 'string') return false;
  const expected = createHmac('sha256', secret).update(rawBody).digest();
  const supplied = Buffer.from(header, 'base64');
  return supplied.length === expected.length &&
    timingSafeEqual(supplied, expected);
}

The helper requires raw bytes and does not implement routing or durable ingestion. Workers should serialize conflicting updates or refetch current resource state, rather than overwrite newer data with a delayed payload. Preserve deletion tombstones so old messages cannot resurrect records. Run overlapping incremental reconciliation plus periodic full comparisons to recover missed events. Track replication lag, retries, and discrepancies; successful delivery alone does not prove replica correctness.

84. How would you design a Shopify-to-ERP order integration that avoids duplicate downstream orders after partial failures?

Use a transactional inbox and an outbound work ledger keyed by shop, Shopify order ID, and operation type. Receiving the same webhook twice must produce the same pending ERP action, not two orders. Keep order creation separate from later payment, cancellation, and fulfillment updates.

Submit a stable external reference or idempotency key to the ERP and persist its returned order ID. If the ERP accepts the order but the response is lost, query by that reference before retrying. A local database transaction cannot atomically commit a remote ERP write; exactly-once delivery is not an honest guarantee.

Persist attempt state, request fingerprints, and sanitized errors. Retry transient failures with backoff, isolate invalid records for correction, and reconcile both systems periodically. If the ERP cannot enforce or search a unique reference, stop ambiguous retries for investigation instead of risking duplicate fulfillment.

85. How would you design an API worker pool that respects per-app, per-shop limits without letting one large merchant starve other shops?

Partition queues and rate-budget state by app and shop. For GraphQL Admin calls, schedule against calculated cost rather than a fixed requests-per-second assumption. Use returned cost and throttle information to update available capacity, and reserve estimated cost atomically across workers so parallel requests do not all spend the same budget.

Apply fair scheduling across shops, with separate priority lanes for interactive work and large synchronization jobs. Bound each tenant's concurrency and backlog; a catalog import should not monopolize the worker pool. Break oversized queries into appropriate pages or use bulk operations.

Treat throttling differently from validation and authorization failures. Retry eligible operations with jitter and a safe idempotency strategy; an unknown mutation result requires reconciliation. Monitor queue age and service time per tenant, not only global throughput, and adjust capacity using observed Shopify responses rather than assuming every merchant has the same limits.

86. How would you run and recover a large catalog import or export using bulk operations, checkpoints, and per-record error handling?

Create an import manifest containing the shop, API version, input checksum, logical record keys, and operation ID. Validate identifiers and dependencies before submitting JSONL through the supported bulk-mutation workflow. For exports, stream the result file and reconstruct parent-child relationships rather than loading the entire catalog into memory.

Persist operation status and processing checkpoints. Completion of a bulk operation does not mean every mutation succeeded: inspect each result's errors and retain its mapping to the original record. Use the documented result correlation fields, not an assumption that output order matches input order.

Retry only unresolved or failed records after checking whether earlier attempts already created their targets. Separate permanent validation errors from transient failures, and reconcile totals and selected records against Shopify. Capture a synchronization boundary and apply subsequent changes so a lengthy export is not mistaken for a perfectly current snapshot. Respect version-specific concurrency and file limits.

87. How would you adapt a theme and integration for products with many variants without relying on obsolete product-model limits?

Remove assumptions that all variants fit in one Liquid array, GraphQL page, or browser JSON payload. Use Shopify's current high-variant product patterns and versioned API schema rather than carrying forward a historical 100-variant limit.

In the theme, build option selection around supported option-value data and resolve the selected combination without requiring every variant to be embedded initially. Preserve variant-specific price, availability, media, and deep links. Fetch or render additional information on demand, and cancel or ignore stale responses when the buyer changes options quickly.

Integrations should paginate variant connections, retain stable variant and inventory-item IDs, and use bulk mechanisms for large synchronization work. Do not join records by display option text alone. Test products above previous limits, unavailable combinations, option renaming, and variants added during synchronization. Measure page weight and selector responsiveness as well as checking that the last variant can actually be purchased.

88. How would you use metafieldsSet and compareDigest to prevent two writers from silently overwriting custom data?

Read the metafield's value and compareDigest together, then submit the digest with the intended replacement. Shopify rejects the write if another writer has changed the stored value. Omitting the digest opts out of that protection; an explicit null means the field must not already exist.

GraphQL example:

mutation SaveMetafields($fields: [MetafieldsSetInput!]!) {
  metafieldsSet(metafields: $fields) {
    metafields { id value compareDigest }
    userErrors { field code message }
  }
}
mutation SaveMetafields($fields: [MetafieldsSetInput!]!) {
  metafieldsSet(metafields: $fields) {
    metafields { id value compareDigest }
    userErrors { field code message }
  }
}
mutation SaveMetafields($fields: [MetafieldsSetInput!]!) {
  metafieldsSet(metafields: $fields) {
    metafields { id value compareDigest }
    userErrors { field code message }
  }
}

Each variable entry supplies its owner, namespace, key, type, value, and previously read digest. On conflict, reload the latest value and apply a defined merge rule or ask the editor to resolve it. Blindly fetching a fresh digest and resubmitting the stale value merely hides the lost update.

The mutation is atomic across its submitted metafields, but that does not create a transaction with external systems. Keep related application state consistent through a separate retryable workflow.

89. How would you prevent lost inventory updates when Shopify and a warehouse system both change stock levels?

Define which system owns each inventory quantity and location before choosing a mutation. Use absolute sets only for the inventory source of truth; otherwise model approved adjustments. Prevent duplicate warehouse events with a business-operation ledger.

For API 2026-10, inventorySetQuantities requires an idempotency key and a changeFromQuantity for every quantity. Supply the observed value, not null, to detect intervening changes.

GraphQL example:

mutation SetStock(
  $input: InventorySetQuantitiesInput!,
  $key: String!
) {
  inventorySetQuantities(input: $input) @idempotent(key: $key) {
    userErrors { field code message }
  }
}
mutation SetStock(
  $input: InventorySetQuantitiesInput!,
  $key: String!
) {
  inventorySetQuantities(input: $input) @idempotent(key: $key) {
    userErrors { field code message }
  }
}
mutation SetStock(
  $input: InventorySetQuantitiesInput!,
  $key: String!
) {
  inventorySetQuantities(input: $input) @idempotent(key: $key) {
    userErrors { field code message }
  }
}

The input identifies the quantity name, reason, inventory item, location, target quantity, and expected changeFromQuantity. Reuse the key when retrying the same operation. A stale-quantity error requires rereading and reconciling intervening sales or adjustments, not disabling the comparison. Serialize conflicting warehouse updates per item/location, and reconcile physical stock and Shopify state without repeatedly overwriting legitimate sales.

90. How would you coordinate expiring offline token refresh, secret rotation, and uninstall revocation across multiple app workers?

Store access tokens, refresh tokens, expirations, and a credential-generation number in an encrypted, shop-scoped record. Derive expiration from the token response. A distributed lock or compare-and-swap update should allow one worker to refresh while others reload the resulting credentials instead of independently rotating them.

Persist the refreshed credential pair atomically. Handle a crash between Shopify's response and storage using the documented refresh-token rules; do not assume refresh tokens are permanently reusable. Distinguish temporary authentication failures from revoked installation access, and avoid infinite refresh loops.

Treat client-secret rotation as a separate rollout affecting verification and token flows. Use only the documented overlap window, then remove the old secret. On uninstall, disable the installation, invalidate credential caches, and reject queued work for its generation. Reinstallation creates a new generation so an old uninstall message or delayed job cannot disable or act through the new installation.

91. How would you upgrade Shopify API and webhook versions safely and detect requests that have fallen forward to another version?

Pin API requests and webhook configuration to a supported stable version; this material targets 2026-10. Inventory every client, background worker, extension, generated schema, and webhook consumer before upgrading. Updating one backend constant does not update all those surfaces.

Review intervening release notes, regenerate types, and validate stored queries and mutation variables against the target schema. Replay sanitized webhook fixtures through both parsers, including missing fields and changed enum values. Introduce tolerant storage changes before deploying producers that need them.

Record the requested version and Shopify's X-Shopify-API-Version response header. For webhooks, record the delivered version header as well. Alert when actual and expected versions differ: requests to an inaccessible version can fall forward. Canary the upgrade, compare business outcomes and error rates, then expand. A rollback is useful only while the previous API version remains supported and its data contracts remain compatible.

92. How would you migrate a legacy REST Admin integration to GraphQL without merely translating each REST call one-for-one?

Migrate business workflows, not endpoint names. Start with the data each screen or synchronization process actually needs, then design bounded GraphQL selection sets that avoid REST-style chains of product, variant, and inventory requests. Keep pagination explicit and use bulk operations for large datasets.

Create a mapping for legacy numeric IDs and GraphQL global IDs; do not infer ownership or resource type from an unvalidated identifier. Rework error handling to inspect transport failures, top-level GraphQL errors, partial data, and mutation userErrors. Replace REST request-bucket scheduling with GraphQL cost-aware scheduling.

Shadow read workflows and compare normalized results before switching traffic. For writes, choose one authoritative path rather than blindly dual-writing and creating duplicate effects. Preserve idempotency, retry, and reconciliation behavior during the transition. Remove REST dependencies only after exercising permissions, pagination boundaries, deleted resources, and recovery from an ambiguous mutation outcome.

93. How would you migrate a legacy Checkout API integration to the Storefront Cart API while preserving the buyer journey?

Replace the legacy checkout object's lifecycle with cart creation, line mutations, buyer identity, discount handling, and navigation to the cart's current checkoutUrl. Checkout IDs are not interchangeable with cart IDs, so migration needs a session transition rather than an ID rename.

Preserve supported merchandise IDs, quantities, selling plans, attributes, and buyer choices when constructing replacement carts. Revalidate availability and pricing instead of copying stale totals. Keep complete cart identifiers protected, and handle expired or missing carts by explaining any reconstructed contents to the buyer.

Test guest and authenticated journeys, market changes, accelerated checkout, discounts, and back navigation. Inspect mutation errors and warnings rather than assuming the requested cart was accepted unchanged. Move order-completion logic to reliable order events: a completed cart is not a durable replacement for an order record. Roll out behind a controlled traffic switch and monitor cart-to-checkout continuity, not merely successful API responses.

94. How would you replace legacy checkout.liquid or Shopify Scripts behavior without assuming a one-to-one extension exists?

Inventory the business intent of each legacy customization before selecting its replacement. Separate visual content, discount calculation, payment or delivery customization, validation, tracking, and post-purchase behavior. A Checkout UI extension presents supported interface elements; a Function implements supported backend logic. Neither grants arbitrary access to checkout's DOM or reproduces every legacy script.

Build a gap matrix against the exact extension target, Function API, store eligibility, distribution model, and supported surfaces. Avoid claiming every Function requires Plus or that one checkout target is available on every plan. Some requirements need a changed merchant process or an alternative supported capability.

Test realistic carts and existing app combinations, then compare observable outcomes with the old rules. Retire conflicting legacy behavior as part of a coordinated cutover. Keep an explicit list of intentional differences and obtain approval for those differences rather than silently describing approximate parity as a complete migration.

95. How would you design and test a Shopify Function under its execution limits without assuming unrestricted network or database access?

Design the Function as a bounded transformation from its declared GraphQL input to the target API's output. Request only necessary fields, precompute merchant configuration outside execution, and avoid algorithms that repeatedly scan every line for every rule. Validate missing configuration and malformed values with a deliberate safe outcome.

The run target is not a general-purpose server with unrestricted database or network access. Certain APIs support restricted fetch targets under specific eligibility and approval rules; verify those rules before making an external dependency part of checkout. Define fallback behavior for absent or failed fetch results.

Use generated types for the selected Function version and fixtures covering large carts, empty inputs, conflicting rules, and unsupported configurations. Check output validity and execution resource usage with Shopify's tooling. Test the built artifact in the relevant commerce flow, because a fast local unit test does not prove compatibility with Shopify's execution limits.

96. How would you test discount logic for combination rules, allocation, currency precision, and boundary conditions?

Start with a rule specification that distinguishes eligibility, candidate generation, combination policy, and final allocation. A Function may propose a discount, but the resulting cart must be tested with Shopify's discount selection and combination behavior; a unit-test output is not proof of the final customer total.

Build fixtures around thresholds: just below, exactly at, and just above minimum spend or quantity. Include excluded products, mixed selling plans, multiple codes, automatic discounts, partial eligibility, shipping discounts, and interactions with cart transformations.

Use decimal-safe money handling and each amount's currency code; never assume every currency has two decimal places or compare formatted strings. Verify rounding and allocation across lines with unequal quantities, then inspect refunds and partial returns where allocation matters. Assert useful invariants—no negative totals, no discount on excluded lines, and stable repeated evaluation—and confirm representative cases in an actual development checkout before release.

97. How would you secure requests from a Checkout UI extension to your app backend and authorize the requested operation?

Obtain a fresh extension session token through the supported API and send it to the backend over HTTPS. The server must verify the signature and expected audience, issuer, destination, and lifetime using the appropriate Shopify authentication support. Decoding a JWT is not verification, and an extension's origin or CORS policy is not authorization.

Derive the shop from verified identity and load that installation's credentials server-side. Check that the caller may perform the operation on the requested customer, cart, or order; a valid token does not authorize arbitrary resource IDs. Validate payload fields, enforce rate limits, and make side effects idempotent.

Request network capability only where needed and supported. Avoid embedding Admin API tokens or app secrets in extension code. Test expired tokens, wrong audiences, changed resource IDs, cross-shop requests, and replayed writes, while returning errors that do not expose customer data or credentials.

98. How would you prevent a headless B2B storefront from exposing another company's catalog or negotiated prices?

Authenticate the buyer through the supported customer-account flow, determine their authorized company locations, and validate the selected location server-side. Never treat a company-location ID supplied by a URL or browser field as proof of membership.

Use the verified customer and company-location context for catalog queries and cart buyer identity. When the buyer switches location, requery products and prices, reconcile cart eligibility, and refresh the checkout destination. A price fetched for one company must not survive a context change simply because the product ID stayed the same.

Do not place negotiated prices or account responses in shared public caches. Keep responses private or partition any justified cache by all effective authorization dimensions, with short-lived membership checks. Test two companies with overlapping products but different prices, revoked memberships, multiple locations, guest transitions, and concurrent tabs. Deny uncertain access rather than falling back to another company's cached catalog.

99. How would you keep market pricing, currency, language, tax presentation, and checkout context consistent across a global storefront?

Maintain one explicit storefront context containing the shop, country or market selection, language, channel, and authenticated buyer identity where applicable. Pass supported country and language context to catalog queries, and render returned money amounts using their currency codes rather than performing an independent browser conversion.

Keep cart buyer identity synchronized when the buyer changes country or company location. Once the cart has buyer identity, its context can override conflicting query context, so changing only @inContext is insufficient. Requery cart costs and availability and use the refreshed checkout URL.

Treat tax and duty displays as context-sensitive estimates until Shopify has the required destination and checkout details. Test translated routes, market-restricted products, country changes with existing carts, and tax-inclusive versus tax-exclusive presentation. Partition public caches by effective localization and channel, and prevent buyer-specific values from entering globally cached HTML.

100. How would you design Hydrogen caching so public catalog data is fast but buyer-specific prices, carts, and account data do not leak?

Cache only data whose audience and acceptable staleness are explicit. In current Hydrogen, passing a cache store does not enable caching by itself: each query needs an opt-in strategy. Mutations are not cached. Do not apply older automatic-caching assumptions to the current client.

TypeScript example:

import {Cache} from '@shopify/hydrogen';

const catalog = await storefront.graphql(CATALOG_QUERY, {
  variables: {country: 'US', language: 'EN'},
  cache: Cache.short(),
});
import {Cache} from '@shopify/hydrogen';

const catalog = await storefront.graphql(CATALOG_QUERY, {
  variables: {country: 'US', language: 'EN'},
  cache: Cache.short(),
});
import {Cache} from '@shopify/hydrogen';

const catalog = await storefront.graphql(CATALOG_QUERY, {
  variables: {country: 'US', language: 'EN'},
  cache: Cache.short(),
});

This assumes a configured request-scoped client and a public catalog query declaring those variables. Separate cache namespaces by shop and effective channel; include country and language in contextual query variables. Never mix a buyer-specific query into this public path.

Keep personalized Storefront queries uncached on a request-scoped client; its query cache has no private mode. Treat any separately implemented customer cache as a distinct authorization design. Review full-page/CDN caches independently from query caches. Revalidate before checkout-sensitive decisions, and test account changes and logout so stale personalized HTML cannot leak between buyers.

101. How would you diagnose a slow Hydrogen page and separate critical commerce data from optional recommendations or content?

Trace the full request before changing caches: server response time, upstream calls, rendering, browser JavaScript, image discovery, and interaction delays. A fast Storefront query does not rule out a slow recommendation service or a client-side rendering waterfall. Compare cold and warm requests under representative mobile conditions.

Fetch independent critical resources concurrently. Product identity, selected variant, price, and purchase controls belong on the critical path; optional editorial content or recommendations should have bounded latency and a fallback.

TypeScript example:

const productTask = loadProduct();
const recommendationsTask = loadRecommendations()
  .catch(() => []);
const product = await productTask;
const productTask = loadProduct();
const recommendationsTask = loadRecommendations()
  .catch(() => []);
const product = await productTask;
const productTask = loadProduct();
const recommendationsTask = loadRecommendations()
  .catch(() => []);
const product = await productTask;

Here the application loaders must implement timeouts; starting a promise alone does not impose one. Render the product first and consume optional results through the chosen framework's supported streaming or deferred UI mechanism. Keep failures observable, avoid layout shifts, and verify that optional work cannot turn a healthy product response into an error page.

102. Why must server-side Storefront API calls forward trustworthy buyer context, and how would you prevent spoofed IP headers?

Shopify needs trustworthy buyer context to apply its storefront protections and distinguish individual shoppers behind a server. Private Storefront calls made on a buyer's behalf should forward the buyer IP through the supported request context or Shopify-Storefront-Buyer-IP header. Omitting it or substituting the application server's IP can misrepresent traffic.

Resolve the address using the hosting provider's documented trusted-proxy chain. Strip untrusted inbound copies at the edge, accept forwarding information only from known proxies, and prevent clients from bypassing that edge. Do not simply select the first value of arbitrary X-Forwarded-For input.

Validate address syntax, handle proxy-chain changes explicitly, and avoid retaining raw IP addresses unnecessarily in logs. Use a separate no-buyer-context client for appropriate background catalog work. Test forged headers and direct-origin requests; a syntactically valid IP is not evidence that it belongs to the shopper.

103. How would you manage customer authentication and cart association securely across login, logout, and multiple browser tabs?

Use the supported customer-account authorization flow and validate its state and redirect handling. Keep refresh credentials in protected server-side session storage, with secure cookie settings and CSRF protection for state-changing application endpoints. A cart ID or email address alone is not proof of customer identity.

After login, associate the cart using verified buyer identity and reconcile guest-cart contents through an explicit merge policy. Reprice the result and avoid silently merging carts from different accounts or company locations. On logout, revoke or end the applicable session, clear local personalized state, and detach or replace the personalized cart so the next user cannot inherit its identity.

Coordinate tabs with a session-generation signal, then revalidate on the server; browser messages are synchronization hints, not authorization. Prevent an in-flight pre-logout response from restoring stale account data. Test account switching, expired refresh tokens, back navigation, concurrent cart mutations, and shared-device use.

104. How would you implement Shopify web-pixel analytics while respecting sandbox boundaries, consent changes, and duplicate events?

Use the web-pixel extension event APIs rather than scraping checkout or assuming access to the storefront DOM. App pixels execute in a strict sandbox, so browser libraries that expect window, arbitrary DOM access, or normal synchronous storage may not work. Configure required privacy permissions and send only the event fields needed for the measurement purpose.

Honor Shopify's consent gating and supported consent-change signals. Events may be delivered after consent is granted, so event time and receipt time are different concepts. Do not bypass opt-out by sending the same data through an independent theme script.

Give the collection endpoint an idempotency strategy using the available event identity plus shop and destination. Reconcile browser and server purchase signals without counting both as separate revenue. Test consent denial, later approval, withdrawal, reloads, duplicate deliveries, and network failures. Keep analytics failure independent of cart and checkout functionality.

105. How would you preserve search visibility when moving a Shopify theme storefront to a headless implementation?

Inventory existing indexable URLs, redirects, metadata, structured data, locale routes, and major traffic landing pages before replacing the theme. Preserve valuable URLs where practical; otherwise create direct permanent redirects to equivalent destinations, not a blanket redirect to the homepage.

Render essential product and collection content server-side so crawlers and users receive useful HTML without waiting for optional JavaScript. Recreate canonical tags, localized alternates where applicable, sitemaps, robots rules, and accurate structured data. Ensure structured availability and price match the visible page and current context.

Crawl the staging storefront and compare status codes, headings, links, pagination, and metadata against the source site. Protect previews from indexing without carrying those restrictions into production. At cutover, verify redirects and canonical host behavior, then monitor crawl errors and organic landing pages. A headless frontend does not automatically inherit the theme's SEO implementation or guarantee unchanged rankings.

106. How would you design nested theme blocks and section contracts that remain reusable and behave correctly in the theme editor?

Define a contract for each reusable block: allowed children, merchant settings, data dependencies, CSS scope, and accessible behavior. Use theme blocks for reusable nested composition; local section blocks cannot be nested or mixed with theme blocks in the same section under the current architecture.

A parent theme block can render its children while retaining editor selection metadata:

Liquid example:

<div class="feature-group" {{ block.shopify_attributes }}>
  {% content_for 'blocks' %}
</div>
<div class="feature-group" {{ block.shopify_attributes }}>
  {% content_for 'blocks' %}
</div>
<div class="feature-group" {{ block.shopify_attributes }}>
  {% content_for 'blocks' %}
</div>

Its schema must separately allow the intended child block types. Avoid assuming a parent can pass arbitrary local variables into theme blocks as it can into snippets; use supported block data and context mechanisms.

Initialize JavaScript idempotently when sections load or are re-rendered, and dispose listeners and observers on removal. Test add, duplicate, reorder, select, and delete operations in the editor, including empty blocks and multiple copies. Merchant customization should not break unique IDs, heading order, keyboard navigation, or responsive layouts.

107. How would you release a theme update without overwriting merchant settings, JSON-template changes, or concurrent admin edits?

Treat merchant-managed configuration as production data, not disposable build output. Before deployment, pull the current live theme and compare its settings, section groups, and JSON templates with the last deployed snapshot. Use a three-way merge to distinguish developer changes from merchant edits.

Keep a documented ownership policy for configuration files. A broad push of stale settings_data.json or templates can erase work even when the code change is small. Coordinate a short editing freeze or detect newer remote changes immediately before the final update; a local Git merge cannot prevent a concurrent admin edit by itself.

Deploy merged changes to an unpublished theme and verify representative pages, settings migrations, app blocks, localization, and accessibility. Preserve a known-good theme for rollback, and confirm which configuration changes a rollback would restore. After publication, compare live settings and rendered pages with the approved preview rather than treating upload success as release verification.

108. How would you identify whether a storefront performance regression comes from Liquid rendering, theme JavaScript, images, or third-party apps?

Establish the regression window and compare the same page, device class, market, and consent state before and after the change. Separate field metrics from repeatable lab traces; one Lighthouse run cannot attribute a production regression.

Use server-response measurements and Liquid profiling to investigate expensive rendering or repeated work. In the browser, inspect long JavaScript tasks, duplicate listeners, bundle growth, image requests, layout shifts, and the largest-contentful element. Check whether the hero image is discovered late, oversized, or incorrectly lazy-loaded.

Isolate app embeds and third-party scripts in a safe preview, one change at a time. Consent tools and analytics can alter execution timing, so test relevant states. Theme Check can identify specific code issues but cannot establish the root cause alone. Validate the suspected fix against the original trace and representative real-user measurements, preserving a rollback if purchase interactions regress despite better synthetic scores.

109. How would you reconcile a stale cart UI when inventory, discounts, or market context changes before checkout?

Treat displayed cart totals as a view of Shopify's current calculation, not a client-owned price ledger. After mutations, consume the returned cart and its errors or warnings. Reconcile changed quantities, unavailable lines, discount applicability, currency, and selling-plan details rather than patching only the number the buyer clicked.

Serialize conflicting updates or attach request-generation markers so a slow earlier response cannot overwrite newer state. Revalidate on return to the cart and before checkout navigation when context has changed. Update buyer identity explicitly for market or company-location changes, then refresh checkout context.

In a theme, use current Ajax line keys, not just variant IDs; in headless code, use Storefront cart-line IDs. If section HTML rendering fails after a successful Ajax mutation, refresh the UI instead of repeating the write. Explain material changes accessibly and let the buyer review them; adding a line does not reserve its stock indefinitely.

110. How would you review a theme or app extension for cross-site scripting across HTML, attributes, URLs, and embedded JSON?

Review every untrusted value at its final output context. HTML text and quoted attributes need HTML escaping; URLs also need a permitted scheme and destination policy. Avoid placing untrusted values into executable JavaScript, event-handler attributes, CSS, or innerHTML. JSON serialization is not a universal defense against HTML parser boundaries.

A narrow data-transfer pattern is:

Liquid example:

<div id="product-data"
  data-title='{{ product.title | json | escape }}'></div>
<div id="product-data"
  data-title='{{ product.title | json | escape }}'></div>
<div id="product-data"
  data-title='{{ product.title | json | escape }}'></div>

JavaScript example:

const node = document.querySelector('#product-data');
const title = JSON.parse(node.dataset.title);
document.querySelector('#product-title').textContent = title;
const node = document.querySelector('#product-data');
const title = JSON.parse(node.dataset.title);
document.querySelector('#product-title').textContent = title;
const node = document.querySelector('#product-data');
const title = JSON.parse(node.dataset.title);
document.querySelector('#product-title').textContent = title;

The browser decodes the attribute before JSON parsing, and the value is rendered as text, not markup. The example assumes those unique elements exist. For multiple components, scope selectors locally.

Test quotes, angle brackets, script-closing sequences, malformed URLs, and merchant/app-provided content. Sanitize intentionally supported rich HTML with a reviewed allowlist, and treat a restrictive content-security policy as defense in depth, not a substitute for safe rendering.

111. How would you minimize, authorize, store, and log protected customer data in a Shopify app?

Start with a field-level data inventory: why the app needs each customer field, who can access it, where it travels, and when it expires. Request only necessary scopes and obtain the applicable protected-customer-data approval; scopes alone do not guarantee access to every protected field.

Authorize each request against its shop, user permissions, and resource ownership. Encrypt credentials and sensitive records at rest, use transport security, and restrict support access through audited roles. Keep production data out of ordinary development fixtures.

Log operation IDs, error classes, and timing rather than complete customer objects, tokens, addresses, or webhook bodies. Apply redaction before data reaches logs, traces, error reporting, and analytics vendors. Define retention and deletion workflows for derived copies as well as primary records. Test denied and redacted API responses as normal cases, and involve the responsible privacy team in policy decisions rather than assuming technical controls alone establish compliance.

112. How would you implement auditable customer-data requests and redaction across databases, queues, caches, and backups?

Implement the mandatory privacy webhook topics as authenticated, durable workflows: customer data requests, customer redaction, and shop redaction. Verify HTTPS signatures, record receipt without unnecessary personal data, and acknowledge only after the request is safely queued. Keep privacy processing separate from ordinary uninstall cleanup.

Maintain a data map covering databases, search indexes, caches, object storage, queued payloads, analytics exports, and subprocessors. Use a request ledger with explicit steps, retries, completion evidence, and an escalation path for failures. Customer deletion should also prevent delayed jobs from recreating the removed data.

Define backup handling with the responsible privacy and security owners: restricted retention, expiry, and reapplication of deletion records after restoration are important where immediate selective deletion is not possible. Test restoration, not just live deletion. Retain minimal audit evidence and document approved retention exceptions; do not promise that deleting one database row satisfies every data request or legal obligation.

113. How would you keep the purchase journey usable when a recommendation, loyalty, or other external service becomes slow or unavailable?

Classify dependencies by whether the purchase can safely proceed without them. Recommendations and optional content should time out quickly and disappear or show a neutral fallback. A loyalty service must not invent a points balance or claim that redemption succeeded when its authoritative response is unknown.

Use bounded request timeouts, circuit breakers, and concurrency isolation so a failing service cannot consume every backend connection. Avoid retry storms in the buyer's request path. Where appropriate, serve previously verified public content within a defined staleness window; never substitute another customer's cached result.

For checkout extensions, keep optional UI failures from blocking checkout. For validation or legally required restrictions, use an explicitly approved fail-open or fail-closed policy supported by the relevant extension or Function target. Test latency, total outages, malformed responses, and recovery. Measure cart and checkout outcomes alongside dependency errors so graceful degradation is demonstrated rather than assumed.

114. How would you make a subscription integration resilient to payment failures, contract changes, and repeated billing-related events?

Model subscription contracts, billing attempts, payment outcomes, and generated orders as separate records with explicit transitions. A billing webhook is not permission to charge again. Key each scheduled billing operation to a stable contract-and-cycle identity, and use the supported billing-attempt idempotency mechanism for retries of that operation.

If an attempt times out, reconcile its status before creating a new one. Distinguish transient payment failures, customer-action requirements, permanently invalid payment methods, and canceled or paused contracts. Apply a documented retry and notification policy rather than billing indefinitely.

Before executing scheduled work, reload the current contract and respect approved changes to lines, price, address, and next billing date. Serialize conflicting contract updates, deduplicate repeated events, and make order creation or fulfillment handling independently idempotent. Test a contract change during billing, delayed success after a timeout, and cancellation while a retry is queued. Keep payment credentials within Shopify's supported mechanisms.

115. How would you reconcile partial fulfillment, cancellation, refund, return, and restocking events without treating them as the same operation?

Maintain separate state for payment transactions, refunds, fulfillment orders, fulfilled quantities, returns, and inventory movements. A refund changes money; a return tracks merchandise coming back; restocking changes an inventory quantity. None should automatically imply the others without an explicit business rule.

Reconcile at line and quantity level, including split shipments and multiple locations. Use stable operation identifiers so duplicate events cannot refund twice, cancel already-shipped quantities, or restock the same returned unit twice. Serialize conflicting decisions or use supported concurrency checks, and requery current Shopify state after ambiguous outcomes.

For example, a partial refund without a physical return should not increase warehouse stock. A received return may require inspection before it becomes available for sale. Preserve those distinctions in the ERP mapping and audit trail. Investigate discrepancies through compensating operations rather than rewriting history, and compare financial totals and physical quantities independently.

116. How would you enforce paid-app entitlements without trusting browser parameters or confusing installation with an approved subscription?

Resolve the installed shop through verified authentication, then evaluate paid features against authoritative subscription state on the server. Installation, a successful return URL, and a browser-supplied plan name do not prove that billing was approved or remains active.

For new public apps and supported pricing models, use Shopify App Pricing; Manual Pricing through the Billing API remains relevant for existing integrations and unsupported models. Keep billing-provider status separate from your own feature-entitlement mapping, including trials, usage limits, upgrades, and cancellation policy.

Refresh entitlement state after subscription changes and reconcile periodically in case notifications are missed. If status cannot be checked, apply a documented grace or restriction policy instead of silently granting unlimited access. Enforce the same decision for background jobs and API endpoints, not only hidden buttons. Test pending approval, declined billing, expired trials, reinstallations, stale cache entries, and tampered plan parameters.

117. What automated test matrix would you use for a Shopify release spanning themes, app APIs, webhooks, and checkout extensions?

Build tests around boundaries and failure modes, with fast checks on every change and development-store flows before release.

Surface

Essential checks

Theme

Theme Check, rendered templates, keyboard use, variant selection, responsive layouts, editor lifecycle

App API

Tenant isolation, scopes, GraphQL errors, cost throttling, idempotent retries

Webhooks

Raw-body verification, duplicates, out-of-order delivery, durable enqueue failure, reconciliation

Checkout

Target eligibility, Function fixtures, discounts, extension authentication, external-service failure

Release

Version compatibility, configuration preservation, migration replay, rollback

Run contract tests against pinned schemas and sanitized payload fixtures, then test representative buyers, markets, currencies, and product structures. Include guest/customer transitions and carts with selling plans or unavailable lines where supported.

Use isolated test shops and explicit test-data cleanup so automation cannot affect real orders. Record which cases were executed and which remain manual. Passing mocks or lint does not prove live checkout behavior, accessibility, or compatibility with every installed merchant app.

118. How would you coordinate app configuration, extension versions, backend code, and database migrations so a rollback remains safe?

Create a release manifest linking backend build, database migration, app configuration, API versions, and extension versions. Shopify app deployment packages configuration and extensions; it does not deploy a separately hosted backend. Coordinate those delivery systems explicitly.

Use expand-and-contract database changes: add compatible fields first, deploy code that understands old and new shapes, backfill safely, and remove obsolete structures only after the rollback window. Extension requests and delayed webhooks must remain readable by the backend versions that may still receive them.

Release backend compatibility before extensions that require it, then enable new behavior gradually. Keep feature flags server-authorized and retain the previous app version and backend artifact. Test rollback with data created by the new release, not just an empty database. If a migration is irreversible, define a forward-repair plan instead of calling code rollback sufficient. Verify business flows after each coordinated release stage.

119. How would you investigate and mitigate a flash-sale incident involving cart errors, API throttling, and inconsistent inventory?

Stabilize the purchase path before starting broad repair work. Identify affected shops, markets, variants, and release changes; correlate cart failures with API errors, queue age, and inventory discrepancies. Preserve request IDs and sanitized traces without logging buyer secrets.

Pause nonessential imports and analytics work, reduce background concurrency, and honor throttle signals rather than increasing retries. Disable an optional failing feature or roll back a correlated release when evidence supports it. Do not hide cart validation failures behind optimistic totals or assume every stock mismatch is a Shopify outage.

Reconcile inventory through its authoritative system, using compare-and-swap and stable idempotency keys for supported writes. Requery uncertain mutation outcomes before retrying. Communicate buyer-visible limitations and track successful checkout progression, not just server recovery. After stabilization, reconcile missed events and duplicate downstream effects, then document the causal chain, capacity gaps, and preventive tests.

120. How would you validate a Shopify replatforming and plan its cutover so catalog data, customer access, inventory, and historical records remain usable?

Define acceptance criteria and ownership for each migrated domain: products and variants, media, collections, customer access, inventory by location, historical orders, redirects, and integrations. Map stable source identifiers to Shopify IDs, and distinguish records that can be recreated from history that must remain accessible in a separate archive.

Run repeatable trial migrations with counts, checksums where meaningful, sampled business records, and buyer journeys. Do not assume customer passwords or payment credentials can simply be copied; design a supported account transition and explain any customer action required. Validate open orders, returns, subscriptions, and fulfillment responsibilities separately from catalog completeness.

Plan an initial load, incremental catch-up, a controlled write boundary, and final reconciliation before routing traffic. Set go/no-go criteria and a rollback decision point that accounts for orders created after cutover. After launch, verify customer access, inventory, payments, fulfillment, and redirects until the agreed reconciliation conditions are met.

Shopify Documentation and Further Reading

This guide uses 2026-10 as its stable versioned API baseline; Liquid and the Ajax API are unversioned. Verify each feature's extension target, store plan, permissions, and app distribution model. Theme Liquid, app code, checkout extensions, and Shopify Functions have different execution environments; preview and legacy capabilities are not universal defaults. Examples are source-reviewed, not tested against a live Shopify store. Validate their stated data, configuration, and behavior in an appropriate development environment before deployment.

Use these curated Shopify references to check Liquid behavior, theme architecture, API contracts, extension capabilities, and platform limits. Select the documented version and development surface that match the application, and check availability notes before relying on a checkout or integration feature.

Team Sherlock.sh

Building fraud intelligence for live high-stake video interactions (financial discussions, hiring interviews, board meeting etc).

Catch candidate fraud before it costs you.

Sherlock AI helps you detect AI-assisted, proxy, and deepfake candidates, so every hiring decision is backed by evidence.

Ask AI about Sherlock.sh

Similar Posts