Start by clarifying the constraints: since only HTML and CSS are allowed, the dropdown cannot be dynamically filtered or triggered by typing, so it must be a static list shown on focus. Then walk through how you would match the mockup using semantic HTML and modern CSS, and discuss the trade-offs of this limitation and how you'd extend it with JavaScript.
Pro tip: Acknowledge that a real typeahead needs JavaScript for filtering and dynamic behavior, but demonstrate that you can still achieve the visual design and basic focus/hover interactions with CSS alone. This shows you understand the boundaries of the technology and can communicate trade-offs effectively.
Confirm that only HTML and CSS are allowed, so the component will be static (no filtering). Ask about accessibility requirements, browser support, and whether the dropdown should appear on focus or click.
Use a wrapper div, an input with a placeholder, and a list (ul/li) for suggestions. Ensure proper labeling and ARIA attributes for accessibility, even if not fully functional without JS.
Match the mockup's input styles (border, padding, font, placeholder color) and dropdown layout (position, background, shadow, item spacing). Use CSS variables for maintainability.
Use :hover and :focus-within on the wrapper to show/hide the dropdown and highlight items. Ensure focus styles are visible and meet contrast guidelines.
Explain that without JavaScript, the typeahead cannot filter or update dynamically. Propose how you would add JS later to enable filtering, keyboard navigation, and dynamic data fetching.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.