CEC Website Development & User Experience 2 — Questions and Answers
Question 1: Which HTTP status code should an ecommerce site return when a product URL is permanently moved to a new URL?
- 301 Moved Permanently (Correct answer)
- 302 Found
- 404 Not Found
- 410 Gone
Correct answer: 301 Moved Permanently
A 301 redirect tells browsers and search engines the resource has permanently moved, preserving link equity.
Question 2: What is the primary purpose of lazy loading images on an ecommerce product listing page?
- Improve initial page load speed by deferring off-screen images (Correct answer)
- Compress image file sizes automatically
- Enable image zoom functionality
- Cache images in the browser permanently
Correct answer: Improve initial page load speed by deferring off-screen images
Lazy loading defers loading of images outside the viewport, reducing initial page weight and improving Time to Interactive.
Question 3: A customer adds an item to their cart but is forced to create an account before checking out. What UX problem does this represent?
- Forced account registration friction (Correct answer)
- Insufficient product information
- Missing cart persistence
- Inadequate payment options
Correct answer: Forced account registration friction
Forced account creation is one of the top reasons for cart abandonment; guest checkout options significantly reduce this friction.
Question 4: Which CSS technique allows ecommerce product grids to automatically adjust column count based on screen width without media queries?
- CSS Grid with auto-fill and minmax() (Correct answer)
- CSS Flexbox with flex-wrap
- CSS float with percentage widths
- CSS position absolute with calc()
Correct answer: CSS Grid with auto-fill and minmax()
CSS Grid's auto-fill combined with minmax() creates responsive grids that adapt column count based on available space.
Question 5: What is the recommended maximum number of steps in an ecommerce checkout flow to minimize abandonment?
- 3 to 5 steps (Correct answer)
- 7 to 10 steps
- 1 to 2 steps only
- No limit if progress indicators are shown
Correct answer: 3 to 5 steps
Research shows 3–5 steps balances necessary data collection with user patience, while one-page checkouts can feel overwhelming.
Question 6: Which accessibility attribute is essential for ecommerce product images to comply with WCAG 2.1 guidelines?
- alt attribute with descriptive text (Correct answer)
- title attribute with product name
- aria-hidden='true'
- role='img' on the img element
Correct answer: alt attribute with descriptive text
The alt attribute provides text alternatives for screen readers, which is required for WCAG 2.1 Level AA compliance.
Question 7: An ecommerce site uses browser localStorage to persist cart data. What is the main limitation of this approach?
- Cart data is lost when the user switches devices or browsers (Correct answer)
- localStorage cannot store more than 10 items
- localStorage requires HTTPS to function
- Cart data expires after 24 hours automatically
Correct answer: Cart data is lost when the user switches devices or browsers
localStorage is device and browser-specific, so cart contents won't sync across a user's phone, tablet, or other browsers.
Which HTTP status code should an ecommerce site return when a product URL is permanently moved to a new URL?