← DoorDash Interview Insights

DoorDash·Frontend Engineer·Online Assessment (OA)·Intermediate

Intermediate
Apr 2026Remote

Summary

Frontend coding round for DoorDash on HackerRank. The task was to consume a mock API and render a product grid that matched a provided mockup exactly, CSS mostly given. Sounds straightforward until you actually read the JSON response shape wrong and spend 20 minutes debugging undefined values.

Questions Asked (1)

Q1

Given a mock API that returns product data (name, image URL, price) for categories like fruits and vegetables, render the products in a flexbox grid layout that matches a provided mockup exactly, including correct price formatting with currency symbol, decimal places, and thousands separators.

API & IntegrationsTechnical Trade-offs
Author's notes

The CSS was mostly handed to you so I figured this would go fast.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the mockup's layout requirements (flexbox properties, responsiveness) and the API data shape. Then outline a component-based implementation: fetch data, format prices using Intl.NumberFormat, and render a flex container with product cards. Emphasize exact visual fidelity and robust error/loading states.

Pro tip: Mention that you'd use CSS `gap` for spacing and `flex-wrap` for responsiveness, and that you'd verify price formatting with `Intl.NumberFormat` to handle locale-specific separators and decimals automatically.

1. Clarify requirements and data

Ask about the mockup's exact layout (columns, spacing, responsiveness) and confirm the API response structure (e.g., array of products with name, imageUrl, price).

2. Design component structure

Plan a parent component that fetches data and renders a flex container, with child ProductCard components for each item. Consider loading and error states.

3. Implement flexbox layout

Use CSS flexbox with `display: flex`, `flex-wrap: wrap`, and `gap` to match the mockup's grid. Ensure responsiveness with media queries or flexible widths.

4. Format prices correctly

Use `Intl.NumberFormat` with appropriate locale and currency options to format prices with currency symbol, decimal places, and thousands separators.

5. Test and refine

Verify the layout against the mockup at different screen sizes and test price formatting with various values (e.g., 1000, 99.99). Handle edge cases like missing images.

Key Points to Mention

  • Use of `Intl.NumberFormat` for locale-aware currency formatting (e.g., `new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' })`).
  • Flexbox properties: `display: flex`, `flex-wrap: wrap`, `gap`, `justify-content`, and `align-items` to match the mockup.
  • Responsive design considerations: using percentages or `flex-basis` for card widths, and media queries for breakpoints.
  • Component reusability: creating a `ProductCard` component that receives props for name, image, and price.
  • Handling asynchronous data: loading states, error handling, and potential use of `useEffect` or React Query.
  • Accessibility: adding `alt` text for images and ensuring semantic HTML.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.