AI in frontend interviews in 2027: AI-assisted coding rounds and AI feature questions

AI in frontend interviews for 2027: which companies allow AI tools, how to work with an assistant in a live round, and how to answer AI feature questions.

Intermediate 11 min readBy , updated 23 November 2026

"AI in frontend interviews" means two different things, and you should prepare for both. The first is the interview format: some companies now let you use an AI coding assistant in a round, some test how well you use one, and others forbid it and have added in-person rounds to check. The second is the content: questions about building AI features in the browser, such as streaming a model's reply, cancelling it, rendering its markdown safely and defending the UI against prompt injection. This guide covers what companies have said publicly, how to work with an assistant in a live round, and the frontend questions AI products raise.

Part 1: interviews that allow, test or ban AI tools

What companies have said publicly

Policies differ by company, by round and sometimes by role, and they change. The list below includes only what a company or a major outlet has published, with the date. It is not a survey of the industry.

Company When What was said Source
Canva June 2025 A pilot "AI-Assisted Coding" interview replaced the computer science fundamentals screen for backend and frontend roles. Candidates are expected to use tools such as Copilot, Cursor or Claude, and are told in advance Canva engineering blog
Meta July 2025 Meta is developing a coding interview in which candidates have access to an AI assistant, and was trying it with employees as mock candidates. Reported by 404 Media and confirmed by Meta to Business Insider 404 Media, Business Insider via AOL
Google June 2025 Sundar Pichai said Google will "introduce at least one round of in-person interviews", and that using AI tools to generate better code is "an asset" Lex Fridman Podcast #471 transcript
Amazon Reported March 2025 Internal guidelines seen by Business Insider say candidates should not use generative AI tools during interviews unless explicitly permitted, and may be disqualified if they do ITPro
Anthropic Updated July 2025 AI may be used to refine application materials and to prepare, but not in live interviews or take-home assessments unless the company says it is allowed for that assessment Anthropic candidate AI guidance

Two lessons follow. First, the same candidate can meet both formats in one search, sometimes in one loop. Second, a pilot is not a policy. Ask your recruiter, in writing, which rounds allow AI tools and which tools, and follow the answer exactly. Using an assistant where it is not allowed is treated as cheating. The company guides help with the shape of each loop, but only the recruiter can confirm the current rule.

What an AI-assisted round actually tests

When a round allows AI, the problem usually gets bigger and vaguer, not easier. Canva's post describes realistic, ambiguous product challenges, and lists what it assesses: knowing when and how to use AI effectively, breaking down unclear requirements, making sound technical decisions, finding and fixing issues in AI-generated code, and making sure the result meets production standards. It says engineers must take full ownership of the code they produce, whether they wrote it or an assistant did.

Put plainly, the interviewer is no longer grading whether you can type a debounce from memory. They are grading whether you can direct a tool, spot when it is wrong, and explain every line you keep. That rewards the same fundamentals as a normal round, because you cannot review code you do not understand.

How to work with an assistant in a live round

A workflow that holds up under observation:

  1. Clarify before you prompt. Restate the problem, ask about edge cases and agree the scope, exactly as in a machine coding round. A vague prompt produces a confident, wrong answer.
  2. Plan the structure yourself. Sketch the components, state and data flow, then ask for one piece at a time. Small requests give code you can review in seconds.
  3. Read every line before you run it. Say what it does out loud. If you cannot explain a line, do not keep it.
  4. Verify by running and testing. Try the empty case, the error case, fast repeated input and keyboard use. Ask the assistant to write tests, then check that the tests assert something real.
  5. Fix, do not regenerate blindly. When something breaks, find the cause yourself and then decide whether to edit by hand or ask for a targeted change. Regenerating until it passes looks like guessing.
  6. Keep talking. Narrate why you accept or reject a suggestion. The interviewer scores your judgement, and they can only see it if you say it.

Frontend code from assistants tends to fail in recognisable ways, and naming them is a strong signal:

Practise for both formats

Because some companies ban AI tools while others test them, prepare without the assistant first. Timed builds from the JavaScript machine coding questions and React machine coding questions train the fundamentals every format still checks. Then repeat a few with an assistant, out loud, and notice where you accepted code you had not read. A mock interview is a good place to rehearse the narration.

Part 2: questions about building AI features

AI features are mostly frontend problems. The model runs elsewhere; the browser has to stream its output, let the user stop it, render it safely and keep the interface responsive while text arrives. These questions appear as coding tasks and as parts of design prompts. The AI roadmap for frontend developers covers the background, from how models work to tool calling and retrieval.

Streaming responses

A model can take many seconds to finish a reply, so products stream it: tokens appear as they are generated, and the user starts reading almost at once. Hosted model APIs commonly stream over server-sent events. In the browser you usually call your own server with fetch and read the body as a stream, because EventSource only makes GET requests and cannot send a JSON body or custom headers.

async function streamReply(prompt: string, onText: (text: string) => void, signal: AbortSignal) {
  const res = await fetch("/api/chat", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ prompt }),
    signal,
  });
  if (!res.ok || !res.body) throw new Error(`Request failed: ${res.status}`);

  const reader = res.body.pipeThrough(new TextDecoderStream()).getReader();
  let buffer = "";
  for (;;) {
    const { value, done } = await reader.read();
    if (done) break;
    buffer += value;
    // A chunk can end mid-event: keep the unfinished tail for the next read.
    const events = buffer.split("\n\n");
    buffer = events.pop() ?? "";
    for (const event of events) {
      for (const line of event.split("\n")) {
        if (line.startsWith("data: ")) onText(JSON.parse(line.slice(6)).text);
      }
    }
  }
}

This is simplified: a full parser also handles \r\n line endings, multi-line data fields and event names. The interview point is the buffer, because network chunks do not line up with events. TextDecoderStream also handles a multi-byte character split across two chunks, which naive TextDecoder use without { stream: true } gets wrong. Practise with streaming an AI-generated description over server-sent events, parsing an LLM streaming response, parsing a server-sent events stream with resume and streaming NDJSON from fetch. WebSockets vs polling vs server-sent events covers the transport choice.

Streamed tool calls add a twist: their arguments arrive as fragments of JSON that are not valid until the end. Parsing partial JSON from a streamed tool call is the coding version.

Cancelling

Every chat UI needs a stop button, and interviewers check that stopping really stops. Pass an AbortSignal to fetch; aborting it rejects the pending read with an AbortError, and closes the connection. Your server should watch for that disconnect and stop generating, which also stops paying for tokens nobody will read.

const controller = new AbortController();
stopButton.onclick = () => controller.abort();

try {
  await streamReply(prompt, appendToMessage, controller.signal);
} catch (err) {
  if ((err as Error).name !== "AbortError") showError(err);
}

Then cover the cases around it: abort the previous request when the user sends a new message or leaves the conversation, keep the partial reply and mark it as stopped rather than deleting it, and offer regenerate. Practise cancellation itself with a fetch wrapper with timeout and AbortController and search-as-you-type with AbortController.

Rendering markdown safely

Models reply in markdown, so the UI renders headings, lists, links and code blocks. Treat that output as untrusted input, exactly like user-generated content, because a prompt or a document the model read can steer what it writes. Do not convert it to HTML and pass the result to innerHTML or dangerouslySetInnerHTML unsanitised.

Two safe approaches: render markdown straight to React elements with a library that does not interpret raw HTML, or convert to HTML and run an allowlist sanitiser such as DOMPurify before inserting it. Either way, restrict link protocols so javascript: URLs cannot run, and decide deliberately whether model output may load images (see the prompt injection section). A Content Security Policy is the second layer.

import Markdown from "react-markdown";

// Raw HTML in the reply is not rendered as HTML.
// Images are dropped so a reply cannot make the browser fetch an arbitrary URL.
<Markdown disallowedElements={["img"]}>{reply}</Markdown>;

Streaming adds a rendering problem: the markdown is incomplete on every update, so an unclosed code fence or bold marker makes the whole message flicker as it re-parses. Practise rendering streamed markdown without flicker, rendering a markdown subset to safe HTML and writing an allowlist HTML sanitiser. Background reading: how to safely render user-generated HTML and what XSS is and how to prevent it.

Token and latency UX

Latency in AI features has two parts worth naming: the wait before the first token, and the rate at which the rest arrives. Interviewers like candidates who design for each.

  • Before the first token: show that the request was received at once, with the user's message added optimistically and a typing indicator, so the wait does not look like a freeze.
  • While streaming: batch incoming text and render at most once per animation frame, so a fast stream does not trigger a React render per token and hurt INP. Keep the input usable.
  • Scrolling: follow new text only while the user is at the bottom; if they scroll up to read, stop following and show a "jump to latest" button. A chat window that sticks to the bottom is this behaviour.
  • Limits and cost: models accept a limited context, so long conversations must be trimmed or summarised. Say what you keep: system instructions, recent whole turns and tool calls with their results. Trimming a chat history to fit a context window practises the rules. Rate limits and quotas need clear messages, not a generic error.
  • Tool calls: show each call's state (pending, running, done, failed) so the user knows what the assistant is doing. Practise with rendering an AI chat transcript with tool calls.

Prompt injection basics for UIs

Prompt injection is the first entry in the OWASP Top 10 for LLM Applications (2025 edition): text the model reads, whether typed by a user or hidden in a web page, email or document it was given, can override its instructions. The frontend cannot prevent the model from being misled, but it decides what a misled model can do. The same list names improper output handling and excessive agency, and both are UI concerns.

What to say in an interview:

  • Keep secrets off the client. API keys for model providers never ship to the browser. The browser calls your server, which holds the key, checks the user and enforces limits.
  • Treat output as untrusted. Sanitise rendered markdown, restrict link protocols, and never eval or execute code from a reply.
  • Block silent data leaks. An injected instruction can ask the model to write a markdown image whose URL contains private data from the conversation. If the UI renders it, the browser sends that data to the attacker's server without a click. Drop images from model output, or allow only trusted hosts through an allowlist and a CSP img-src rule.
  • Confirm consequential actions. If the assistant can send email, delete files or spend money, show the exact action and its arguments and require the user's approval. Building an approval step for agent tool calls is the coding version.
  • Show provenance. Make clear which text came from the model and which from retrieved sources, so users can judge it.

The frontend security design guide covers the wider trust-boundary thinking.

AI features in design rounds

In a system design round, these pieces combine. A chat UI prompt expects streaming, cancellation, safe rendering, history and branching; a coding assistant prompt adds debounce and cancel on every keystroke, ghost text and latency budgets; an agent prompt adds approvals, progress and resuming after a reload. Practise a ChatGPT-style chat UI, Copilot-style inline code completions, an AI code-review assistant, the UI of an AI agent that runs long tasks and an AI image generator like Midjourney. Frontend system design interviews in 2027 explains how these fit into a full answer, and real-time updates covers the transports.

Where to practise next

Practise it

Each question opens in an editor with tests, so you can check your understanding by writing the code.

  1. Design a ChatGPT-style chat UI: streaming responses, markdown and code rendering, stop and regenerate, history and branchingHard60 min
  2. Stream an AI-generated project description with Server-Sent Events: stop, retry and unexpected outputMedium40 min
  3. Parse an LLM streaming response: text deltas, tool-call arguments and content blocks by indexMedium45 min
  4. Render streamed Markdown in React without flicker using incremental parsing, stable keys and safe partial syntaxHard60 min
  5. Render an AI chat transcript with tool calls: pending, running, done and error cards, collapsible arguments and retryMedium40 min
  6. Build an approval step for AI agent tool calls: approve, deny or edit arguments, auto-deny after a timeout and show what ranMedium40 min
  7. Parse partial JSON from a streamed LLM tool call: the best-effort value from incomplete textMedium45 min
  8. Design the UI of an AI agent that runs long tasks: plans, tool calls that need approval, progress, resuming after a reload, and audit historyHard55 min