Recently many students are preparing Shopify OA, the style of this company is actually quite "product-oriented" and cannot be completely covered by just using LeetCode. Here we help you organize a version of common structures + 4-5 high-frequency questions, which basically covers the core test points.

Shopify Online Assessment basic information (2026 latest)
- Platform:CoderPad
- Question volume: Usually 2-3 coding questions (mainly 3 questions, in rare cases 2 questions)
- Duration:90 minutes
- Difficulty:Easy ~ Medium-Hard, the first question is more friendly, and the subsequent questions gradually increase business logic and optimization requirements
- Pass key: At least 2 questions Full AC, clear code style, complete boundary case processing
Many candidates reported that the Shopify OA question types are relatively fixed, but the second and third questions will add e-commerce business background, and they need to quickly understand the rules.
2026 High Frequency Real Questions Sharing
Q1. Bundled shopping cart pricing (hash table + simulation)
Question description: Enter an order array in the format ["Date", "Item"]. The rules are as follows:
- Bought popcorn and soda on the same day → Bundle price $9.00
- Purchase popcorn separately → $8.00
- Buy soda separately → $2.50
Calculate and return the total price (floating point number).
Example:
Orders = [
["10212021", "popcorn"],
["10222021", "popcorn"],
["10212021", "soda"],
["10212021", "popcorn"],
["10212021", "soda"]
]
# Output: 28.5
Problem-solving ideas:
- Use HashMap to group by date and count the number of popcorn and soda per day
- Number of bundles that can be matched per day = min(popcorn_count, soda_count)
- The remaining unmatched items will be calculated based on the unit price.
- Pay attention to floating point precision (it is recommended to use integer points for calculation and finally convert back to US dollars)
Reference code:
From collections import defaultdict
def calculate_total(orders):
daily = defaultdict(lambda: {"popcorn": 0, "soda": 0})
for date, item in orders:
daily[date][item] += 1
total = 0.0
for items in daily.values():
p, s = items["popcorn"], items["soda"]
bundles = min(p, s)
total += bundles * 9.0
total += (p - bundles) * 8.0
total += (s - bundles) * 2.5
return total
Things to note: There can be multiple bundles on the same day; pay attention to floating point precision, and use integer points (cents) during the interview to avoid errors.
Q2. Longest valid bracket substring (stack/DP)
Question description: Given a string containing only ‘(‘ and ‘)’, return the length of the longest valid (well-formed) bracket substring.
Example:
- "(()" → 2
- “)()())” → 4
- "" → 0
Problem-solving ideas(recommended stack method):
- Initialize the stack and put sentinel -1
- When ‘(‘ is encountered, push it onto the stack
- Pop the top of the stack when encountering ‘)’
- If the stack is empty, the current index is pushed onto the stack as the new baseline.
- If the stack is not empty, update the maximum length = current index – top index of the stack
Reference code:
Def longestValidParentheses(s: str) -> int:
stack = [-1]
max_len = 0
for i, ch in enumerate(s):
if ch == '(':
stack.append(i)
else:
stack.pop()
if not stack:
stack.append(i)
else:
max_len = max(max_len, i - stack[-1])
return max_len
Things to note: When the stack is empty, push the current index as the new baseline; Shopify pays more attention to code readability, and the stack method is clearer than DP.
Q3. Determine palindrome string (double pointer/string)
Question description: Given a string, determine whether it is a palindrome. Require:
- Ignore punctuation and spaces
- Case insensitive
- Empty strings are treated as palindromes
Example:
- “A man, a plan, a canal: Panama” → True
- “race a car” → False
- ” ” → True
Problem-solving ideas:
- The double pointers move from both ends to the middle
- Skip non-alphanumeric characters
- Compare characters (after converting to lowercase)
Reference code:
Def isPalindrome(s: str) -> bool:
left, right = 0, len(s) - 1
while left < right:
while left < right and not s[left].isalnum():
left += 1
while left < right and not s[right].isalnum():
right -= 1
if s[left].lower() != s[right].lower():
return False
left += 1
right -= 1
return True
Things to note: Shopify attaches great importance to boundary processing (empty string, full symbol, single character, upper and lower case).
Q4. Average order revenue above average in each region (SQL)
Question description: Given the orders table and customers table, find the average order revenue of each region in 2024, and only return regions and their average revenue that are higher than the overall average of all regions.
Problem-solving ideas(CTE writing recommended):
- Step 1 CTE: Average income in 2024 by region
- Step 2: Filter the results for areas that are higher than the overall mean
Reference code:
WITH region_avg AS (
SELECT
c.region,
AVG(o.revenue) AS avg_rev
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
WHERE EXTRACT(YEAR FROM o.order_date) = 2024
GROUP BY c.region
)
SELECT region, ROUND(avg_rev, 2) AS avg_rev
FROM region_avg
WHERE avg_rev > (SELECT AVG(avg_rev) FROM region_avg)
ORDER BY avg_rev DESC;
Things to note: Year filtering cannot be forgotten; it is necessary to distinguish between "the average of the average values of each region" and "the total average of all orders".
Q5. Letter score word sum (hash table / greedy)
Question description: Given a list of words, calculate its "letter score" (a=1, b=2, ..., z=26) for each word, and return a list of scores for each word. An extended version can require that the word with the highest score be returned.
Problem-solving ideas:
- For each word, iterate through the letters and calculate the score using ord(ch) – ord(‘a’) + 1
- If you want the highest scoring word, use max() + key parameter
Reference code:
Def word_scores(words):
def score(word):
return sum(ord(ch.lower()) - ord('a') + 1 for ch in word)
return [score(w) for w in words]
def highest_score_word(words):
def score(word):
return sum(ord(ch.lower()) - ord('a') + 1 for ch in word)
return max(words, key=score) if words else ""
Things to note: Actively handle boundaries such as uppercase letters and empty strings; Shopify pays more attention to code style and readability.
Exam preparation advice
Officially recommended review direction: LeetCode Easy-Medium focuses on algorithms, with core questions including #20, #32, #56, #88, and #121; SQL focuses on reviewing aggregate functions, JOIN, CTE and subqueries; for the logical reasoning part, you can refer to GMAT Critical Reasoning or business case questions. Shopify pays special attention to code readability. Clear variable naming and handling of edge cases (such as empty shopping cart, zero inventory, floating point precision) will all affect the score. It is recommended to treat the OA as the first round of formal interviews and write down your assumptions clearly in the notes.
If you encounter specific problems when preparing for Shopify OA, or want to do system simulation exercises for Shopify’s high-frequency question types, welcome to learn more Programhelp Services. Our team has rich experience in OA coaching for major companies and can provide targeted real-time guidance and full-scale simulation to help you prepare for OA for companies such as Shopify and Amazon more efficiently.