Frontend School

Interactive Store Locator Map

Machine Coding
easy

Interactive Store Locator Map

Easy
React
TypeScript
Map
Markers
UI/UX
State Management

Overview

Amazon serves millions of customers daily, often requiring them to locate physical points of interest, whether it's an Amazon Locker, a Whole Foods Market, or an Amazon Fresh store. Building intuitive tools for customers to find these locations is crucial for a seamless experience. This problem challenges you to develop a simplified interactive store locator map, focusing on displaying multiple store locations and providing details upon selection.

What you need to do / Task

Your primary goal is to build a React application that displays a map with multiple store locations marked on it. When a user clicks on a marker, the application should display the details of that specific store.

  1. Display a Map: Render a basic world or regional map using react-simple-maps.
  2. Render Store Markers: For each store provided in the mock data, render a distinct marker on the map at its geographical coordinates.
  3. Handle Marker Selection: Implement click functionality for each marker. When a marker is clicked:
    • The clicked marker should become visually highlighted.
    • The details (name, address) of the selected store should be displayed in a dedicated panel next to the map.
  4. Update Selection: If a different marker is clicked, the previously selected marker should revert to its default state, and the new marker should be highlighted with its details displayed.

UI/UX expectations

  • The map should be prominently displayed, occupying a significant portion of the screen.
  • Store markers should be clearly visible and distinguishable. A simple circle or SVG icon is sufficient.
  • When a marker is clicked, its appearance should change (e.g., color, size, or an outline) to indicate selection.
  • Store details should appear in a dedicated, readable panel adjacent to the map (e.g., on the right or below).
  • The overall layout should be clean and responsive enough for basic desktop viewing.

Acceptance criteria

  • The application successfully renders a map.
  • All mock Store data points are represented by interactive markers on the map.
  • Clicking any marker correctly updates the displayed store details panel with the corresponding store's information.
  • The currently selected marker is visually distinct from unselected markers.
  • Clicking a different marker deselects the previous one and highlights the newly clicked marker, updating the details panel accordingly.

Constraints

Constraints & assumptions

  • You must use React with TypeScript.
  • Utilize the react-simple-maps library for map rendering. sandpackDeps will include it.
  • All store data will be provided as a static array within your application (no API calls).
  • The map should be centered roughly around a region that can contain the mock store data (e.g., North America or a specific country).
  • Focus on functional components and React Hooks for state management.
  • The problem is designed to be completed within approximately 45 minutes.

Out of scope

  • Advanced map interactions like zooming, panning, or searching.
  • Custom marker icons beyond simple SVG shapes or circles.
  • Full accessibility implementation (though basic semantic HTML is encouraged).
  • Backend integration or data persistence.

What interviewers evaluate

  • Correctness and Functionality: Does the map render correctly with markers, and do interactions behave as specified?
  • State Management: Is React state managed efficiently and correctly to handle marker selection and detail display?
  • Component Design: Is the code organized into logical components with clear responsibilities?
  • Code Quality: Is the code clean, readable, and well-structured, adhering to TypeScript best practices?

Loading editor...