Design and implement an image carousel slider component in React that supports manual controls, circular wrap-around, dot indicators, autoplay with pause-on-hover, and keyboard navigation.

Mark it off to log your completion progress, or bookmark it to review trade-offs later.
Join senior engineers who receive practical, deep-dive frontend challenges, detailed concepts, and blueprints directly in their inbox.
We value your privacy. Unsubscribe at any time.
Carousels and sliders are common layout elements for presenting landing page banners, ecommerce products, or photo galleries. Building a production-grade carousel is a common frontend interview task because it tests a developer's understanding of timer management, keyboard event handling, transition cycles, and component unmount states.
Your task is to build a responsive, interactive Image Carousel component in React. The carousel should loop through a collection of image URLs, provide interactive controls, support keyboard arrows, and auto-play slides at set intervals while pausing whenever the user hovers their mouse over the frame.
onMouseEnter), and resume it when the mouse leaves (onMouseLeave).ArrowLeft must load the previous slide, and ArrowRight must load the next slide.role="region", aria-label="Image Carousel", proper screen-reader roles for controls).useEffect in React.onMouseEnter / onMouseLeave).