Skip to content
Tutorials Center
My learning

Topics

Lesson 60 of 61 ยท Practice and Review

Shopify Theme Developer Interview Questions

30 Shopify theme developer interview questions with concise answers: Liquid, sections, Online Store 2.0, performance, the Ajax cart API and metafields.

Interviews for Shopify theme roles tend to circle the same ground: can you read and write Liquid, do you understand how sections and templates fit together, do you know what a theme can and cannot change, and can you keep a storefront fast and accessible? This lesson collects thirty common questions with short answers that you can say aloud in under a minute each. They are grouped by topic so you can drill one area at a time.

Use the answers as a skeleton, not a script. A good answer states the rule, gives one reason, and, where it helps, names a trade-off or a mistake you have seen. Two runnable stand-ins in the middle let you check the facts that candidates most often get wrong: what Liquid treats as false, and how the cart's line numbering works. Real Liquid and the real cart exist only on Shopify, so the stand-ins mimic their rules in JavaScript.

flowchart TD
  Q["Interview areas"] --> L["Liquid<br/>(1-8)"]
  Q --> S["Sections and OS 2.0<br/>(9-16)"]
  Q --> D["Data: metafields<br/>and variants (17-21)"]
  Q --> C["Cart and Ajax<br/>(22-26)"]
  Q --> P["Performance, a11y<br/>and process (27-30)"]

Thirty questions in five areas; the numbers match the headings below.

Answers describe current Online Store 2.0 themes. Limits and defaults change over time, so when a question hinges on an exact number (for example, how many blocks a section may have), say it is a documented limit and that you would check the current docs.

Liquid

1. What is Liquid and where does it run? A template language created by Shopify and used by Shopify themes. It runs on Shopify's servers when a page is requested, and produces HTML. Browsers never see Liquid. It is deliberately limited (no arbitrary code, no file or network access), which is what makes it safe to let merchants and developers edit templates.

2. What is the difference between {{ }} and {% %}? Double curly braces output a value (with optional filters). Curly-percent tags run logic that does not print by itself: if, for, assign, render. Comments use {% comment %} or the inline {% # ... %} form.

3. What counts as false in Liquid? Only nil and false. Everything else is truthy, including 0 and the empty string. That is why {% if product.title %} is almost always true and why you often want != blank or == empty instead. This is a favorite trap question; the first stand-in below proves it.

4. What is the difference between blank and empty? empty is true for an empty string, array or hash. blank is a broader check that also treats nil, false and strings with only whitespace as blank. For a text setting the merchant might leave empty, != blank is the safer test.

5. render or include? Use render. include is deprecated. render gives the snippet an isolated scope: it sees only the variables you pass in (plus global objects such as shop), and it cannot change the caller's variables. That makes snippets predictable and cacheable. See Snippets and the render tag.

6. How do assign and capture differ? assign stores a value or the result of a filter chain. capture stores a block of rendered output (text built from tags and variables) as a string. Reach for capture only when you need the rendered string, because a chain of filters in assign is cheaper and clearer.

7. How do you debug Liquid? Print the value with {{ thing | json }}, which shows type and structure, inside a temporary comment-guarded block; run shopify theme check for syntax and best-practice errors; use shopify theme dev for hot reload; and read the error message that Shopify prints in the preview. Remove debug output before pushing. More in Liquid pitfalls and debugging.

8. Why is money output through a filter? Prices are stored as integers in the smallest currency unit (cents), so 1400 means 14.00. The money filter formats it with the store's currency settings. Never divide by 100 in a template: the number of decimals and the symbol differ by currency and market.

Stand-in: truthiness and blank checks

This JavaScript mimics Liquid's rules so you can see them side by side. isTruthy follows Liquid (only nil and false are falsy); isBlank follows the blank keyword.

JS Stand-in: Liquid truthiness and blank

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Note the surprises: 0, the empty string and an empty array are all truthy for {% if %}, yet all of them except 0 are blank. A tidy interview answer is: "Use if x != blank to test whether a merchant actually entered something."

Sections and Online Store 2.0

9. What changed with Online Store 2.0? JSON templates, so any page can be built from sections; sections on every page (not only the home page); app blocks, so apps add UI through the theme editor instead of editing code; and metafield support in the editor through dynamic sources. See JSON templates and Online Store 2.0.

10. What is in a JSON template? A sections object (each entry has a type that names a file in sections/, plus settings and blocks) and an order array that sets the sequence. The template holds merchant choices; the section file holds the markup and the schema.

11. Section versus block versus snippet? A section is a configurable, editor-visible chunk of a page with its own schema. A block is a repeatable item inside a section (or a reusable theme block in blocks/). A snippet is a code-reuse partial with no editor presence, rendered with render.

12. What does {% schema %} contain? JSON with the section name, its settings, its blocks (and limits such as max_blocks), optional presets (needed so the section can be added from the editor) and optional default content for static use. Setting id values are what you read as section.settings.id.

13. Why output {{ block.shopify_attributes }}? It adds the data attributes the theme editor needs to select and highlight that block when the merchant clicks it. Likewise section.shopify_attributes on the section wrapper. Omitting them breaks click-to-select in the editor.

14. How do global theme settings differ from section settings? config/settings_schema.json defines global settings (colors, fonts, spacing) and config/settings_data.json stores the values; read them as settings.some_id. Section settings apply to one instance of one section. A common pattern turns global settings into CSS variables in theme.liquid.

15. How does the editor reload a section after a change, and why does it matter for JavaScript? The editor re-renders the section and swaps its HTML, firing events such as shopify:section:load. Scripts that bind listeners once at page load stop working after a swap, so write behavior as custom elements (which initialize themselves when inserted) or re-initialize on those events. See JavaScript in themes.

16. What can a theme not change? Checkout. Checkout customization goes through checkout extensibility (branding and UI extensions), not theme Liquid, and discounts and shipping logic belong to Shopify settings, apps or Functions. Say it plainly, and add that the theme can still style the cart and prepare the shopper for checkout. See Cart, discounts and the path to checkout.

Data: metafields, metaobjects and variants

17. What is a metafield, and how do you read one in Liquid? Custom data attached to a resource (product, variant, collection, customer, shop and others), defined by a namespace, key and type. You read it as product.metafields.custom.care_guide, then use .value for typed output. Always handle the missing case with a fallback. See Metafields in themes.

18. When would you use a metaobject instead of a metafield? When the data is a reusable record with several fields that many resources share, such as a size chart, an FAQ entry, a designer profile or a store location. A product then holds a metafield that references the metaobject. See Metaobjects in themes.

19. How do you handle products with several options? Loop product.options_with_values to build pickers; each variant stores its option values; when the shopper changes a choice, find the variant whose options match and update the hidden id input, price, availability and URL (?variant=). Disable (do not hide) combinations that are sold out. See Variants and option pickers.

20. What does selected_or_first_available_variant return? The variant named in the ?variant= URL if there is one, otherwise the first available variant, with a sensible fallback when none are available. It is the usual way to pick the initial state of a product form.

21. How do you build a responsive image the right way? Use image_url with a width and image_tag with widths and sizes, so the browser can choose a file by layout width; set width/height (or aspect-ratio) to avoid layout shift; lazy-load images below the fold; and give the largest above-the-fold image fetchpriority="high" and no lazy loading. See Product media.

Cart and the Ajax API

22. Name the Ajax cart endpoints. /cart.js (read), /cart/add.js, /cart/change.js, /cart/update.js and /cart/clear.js. In a theme, build the URLs from the routes object so they work under language and market prefixes.

23. What is a common gotcha with /cart/change.js? It addresses a line by line (a 1-based position) or by id (the line key). Candidates often pass a zero-based index and change the wrong line. The second stand-in shows it. Setting quantity to 0 removes the line.

24. How do you add several products in one request? POST /cart/add.js with a JSON body { "items": [ { "id": 123, "quantity": 1 }, ... ] }. If any line fails (for example, not enough stock), the request returns an error and none are added. See the Ajax cart API.

25. How do you refresh a cart drawer after an update? Ask for the drawer's HTML in the same request with the sections parameter (the Section Rendering API), then replace the drawer markup, instead of rebuilding HTML in JavaScript. Handle errors by showing the server's message in an aria-live region. See Building a cart drawer.

26. Line item properties versus cart attributes versus cart note? Line item properties attach custom data to one line (an engraving text). Cart attributes attach data to the whole cart (a delivery instruction key). The note is a single free-text field. Properties starting with an underscore are hidden by convention in theme displays; all are shopper-editable, so never trust them for prices.

Stand-in: cart line numbering

JS Stand-in: change.js line numbers are 1-based

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The last call shows another trap: after a removal the remaining lines renumber, so a script that loops and removes by position must go from the end, or re-read the cart each time (or use the line key).

Performance, accessibility and process

27. What are the Core Web Vitals and what does a theme control? LCP (how fast the main content appears), CLS (layout stability) and INP (responsiveness). A theme controls image sizes and loading, render-blocking CSS and JavaScript, font loading, reserved space for media, and how much script runs on interaction. Apps add scripts you may not control, so measure with and without them. See Theme performance.

28. What makes Liquid slow, and how do you spot it? Nested loops over large arrays, repeated filtering of the same list, loops inside snippets that are rendered many times, and heavy objects accessed repeatedly. Cache results in variables, filter once, paginate, and use the theme profiler to see which sections and snippets cost time. See Liquid performance.

29. How do you make a mega menu or cart drawer accessible? Use real buttons with aria-expanded and aria-controls, support Escape and arrow keys where the pattern expects them, keep focus order logical, move focus into a dialog and return it on close, announce cart changes in an aria-live region, keep visible focus styles, and respect prefers-reduced-motion. See Accessibility in themes.

30. How do you work safely on a live store? Develop on a duplicate or development theme with shopify theme dev; keep the code in Git; lint with Theme Check; preview and QA on real devices; publish deliberately; keep the previous theme as a rollback; and handle merchant edits to JSON files with care, because they live in the same files you deploy. See Version control and Testing, publishing and going live.

Answering well

A few habits separate strong answers from fine ones.

  • Name the trade-off. "render is isolated, so I pass what I need; that costs a few arguments but prevents hidden coupling."
  • Say what you would verify. For exact limits, API versions and newer features, say you would confirm in the current documentation instead of guessing.
  • Connect to the merchant. Sections exist so non-developers can edit a page safely. Explain choices in terms of what the merchant can change without you.
  • Show a real example. One sentence about a bug you fixed (a zero-based line index, a missing shopify_attributes) is worth more than a definition.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which values are false in a Liquid {% if %}?

    Liquid treats only nil and false as falsy. 0, empty strings and empty arrays are truthy, so test with != blank when you mean 'something was entered'.
  2. 2. What does render give a snippet that include did not?

    Isolation makes snippets predictable. include is deprecated precisely because it shared and could alter the caller's scope.
  3. 3. A call to /cart/change.js uses line: 1. Which cart line is that?

    The line parameter counts from 1. Passing a zero-based index changes the wrong line or fails.
  4. 4. Why should a script that binds listeners once at page load be written as a custom element?

    After the editor re-renders a section, old listeners are gone. A custom element's connectedCallback runs for the new markup automatically.
  5. 5. Where does a theme developer customize the checkout page?

    Checkout is not rendered by theme templates. It is customized through Shopify's checkout settings and extensions.

Summary

  • Know the Liquid essentials cold: only nil and false are falsy, render isolates scope, and money is formatted from cents with a filter.
  • Explain Online Store 2.0 as JSON templates, sections everywhere and app blocks, and name what shopify_attributes and presets are for.
  • Use metafields for single values and metaobjects for reusable records, always with a fallback.
  • For the cart, remember the endpoints, the 1-based line, all-or-nothing multi-item adds and the Section Rendering API refresh.
  • Tie performance, accessibility and safe publishing to concrete practices, and say when you would check the docs instead of guessing.

Finally, keep the quick reference at hand in the Shopify Theme Cheat Sheet.