Shopify Developer Test 2 — Questions and Answers
Question 1: A SKU is what?
- Stock Keeping Unit (Correct answer)
- Sold Karat Unit
- Safe Kiosk Unit
- All of the above
Correct answer: Stock Keeping Unit
SKU stands for Stock Keeping Unit. It is a unique alphanumeric code assigned to products by retailers to identify and track inventory levels. This allows for efficient management of stock, sales, and returns.
Question 2: How are shipping costs calculated by Shopify?
- Prices are determined by the weight class you specify. (Correct answer)
- On Shopify, shipping is always free.
- The USPS provides the pricing directly.
- Rates rapidly change in response to current transportation costs.
Correct answer: Prices are determined by the weight class you specify.
Shopify allows merchants to calculate shipping costs using various methods, including flat rates, price-based rates, and weight-based rates. Option A highlights one of the primary and most common ways Shopify determines shipping costs: by allowing merchants to define different 'weight classes' or ranges and assign specific prices to each. This provides flexibility in setting shipping fees based on the physical characteristics of the products.
Question 3: Which of the following datatypes can liquid objects be? Mark each box that applies.
- Asset
- Tag
- EmptyDrop (Correct answer)
- Nil (Correct answer)
- API
- Boolean (Correct answer)
- String (Correct answer)
Correct answer: EmptyDrop
Liquid objects can represent various fundamental data types such as strings, numbers, booleans, arrays, and nil. An `EmptyDrop` is a specific internal Liquid object that behaves like `nil` or `false` in conditional contexts, representing an an empty or non-existent value. While other options like `Boolean`, `String`, and `Nil` are also valid Liquid data types, `EmptyDrop` is indeed a recognized type of object that Liquid can handle.
Question 4: What is the name of the feature that retrieves information from a remote source and shows it on a Shopify shop page?
- API Fetcher
- Data Streaming
- Application Proxy (Correct answer)
- Shopify forbids the display of external data on a shop page.
Correct answer: Application Proxy
The Application Proxy feature in Shopify allows an app to serve content from an external server directly on a Shopify store's domain. This means that information retrieved from a remote source can be seamlessly integrated and displayed on a shop page, making it appear as if it's part of the Shopify store itself. It enables dynamic content from external services to be presented to customers without redirecting them away from the store's URL.
Question 5: Blocks of Liquid code are continuously executed via iteration tags. Of the following, which one is NOT an iteration tag?
- cycle
- while (Correct answer)
- tablerow
- tag
Correct answer: while
Liquid, Shopify's templating language, includes iteration tags like `for`, `cycle`, and `tablerow` to loop through collections or perform repetitive tasks. However, `while` loops are not a native construct in Liquid. Liquid is designed for simpler, safer templating logic, and `while` loops, which can potentially lead to infinite loops, are generally excluded from such templating languages.
Question 6: The ____ tag in Liquid only runs a block of code if a specific condition is not true (that is, if condition is false).
- If (Correct answer)
- Ifnot
- unless
- case/when
Correct answer: If
The `if` tag is the fundamental conditional control flow tag in Liquid. While the `unless` tag is specifically designed to run a block of code when a condition is false, the `if` tag can achieve the same outcome by using the `not` operator (e.g., `{% if not condition %}`). This makes `if` the versatile tag capable of handling both true and false conditions, including the scenario described.
Question 7: What is the name of Shopify's simple internal programming language?
- API
- Liquid (Correct answer)
- Codify
- C#
Correct answer: Liquid
Liquid is an open-source template language created by Shopify and written in Ruby. It serves as the backbone of Shopify themes, enabling developers to build dynamic content by connecting HTML with data from the store. Its simple syntax and secure design make it ideal for displaying store information without allowing direct database access.
Question 8: What will be displayed in the code below in Liquid?
- error
- Be Happy! (Correct answer)
- Be Happy end
- ==Be Happy==
Correct answer: Be Happy!
The `assign` tag in Liquid is used to create a new variable and assign a value to it. In the given code, `my_variable` is assigned the string 'Be Happy!'. The subsequent `{{ my_variable }}` is an output tag that prints the value of the variable to the page, resulting in 'Be Happy!' being displayed.
Question 9: All of Shopify's customers have free access to a top-notch _______ operated by Fastly.
- UI
- SKU
- CDN (Correct answer)
- API
Correct answer: CDN
Shopify provides all its customers with free access to a top-notch Content Delivery Network (CDN) operated by Fastly. A CDN is a geographically distributed network of servers that delivers web content and static assets (like images, CSS, and JavaScript files) to users based on their location. This significantly speeds up page load times and improves the overall performance and reliability of Shopify stores worldwide.
Question 10: Which of the following objects can be used with the img_tag filter? (Select each that applies.)
- endif
- product (Correct answer)
- variant (Correct answer)
- line_item (Correct answer)
- collection (Correct answer)
- else
- asset
Correct answer: product
The `img_tag` filter in Liquid is used to generate an HTML `<img>` tag for an image associated with various Shopify objects. It is commonly applied to the `product` object to display its featured image, for example, `{{ product.featured_image | img_tag }}`. This filter automatically handles image sizing and responsive attributes, making it easy to integrate product images into a Shopify theme.
Question 11: Does a Shopify website by default include a blog?
- Yes (Correct answer)
- No
- Sometimes
Correct answer: Yes
By default, every new Shopify store comes with a pre-installed blog named 'News.' This allows merchants to immediately start publishing content, updates, or articles without any additional setup. While it can be renamed or additional blogs can be created, a basic blog functionality is always present from the start of a Shopify store.
A SKU is what?