Назад к подготовке

Дизайн сервиса суммаризации URL и текста

Дизайн сервиса суммаризации URL и текста

Ответить самому

Сначала сформулируйте ответ как на собеседовании, затем откройте разбор и оцените себя.

Загрузка

Короткий ответ

Route URL versus raw text first, fetch/extract URLs, validate content, choose a summarization path by length and language, chunk long inputs, and monitor cost, latency and quality.

Полный разбор

Start with input routing. Detect whether the input is a URL or raw text, validate that it has meaningful content, and reject or ask for clarification on empty, spammy or unsupported inputs. For URLs, fetch the page and extract text before summarization.

Use different paths by input size and constraints. Short text may not need summarization or can use a cheap model. Medium text can go through a standard LLM prompt. Long documents need chunking, map-reduce summarization, hierarchical summaries or retrieval of salient sections. Multilingual content may need a model with strong language coverage or translation as a fallback.

Cost and latency controls matter: batching, caching fetched pages, caching summaries for repeated URLs, token limits, model routing, timeouts and fallback summaries. The product should define output length, style, citation/source behavior and hallucination constraints.

Теория

LLM system design is often routing and control-flow design around the model, not just choosing the largest model.

Типичные ошибки

  • Send every input to the same expensive model.
  • Forget to fetch and clean URL content before summarizing.
  • Chunk long documents without preserving global context.
  • Ignore empty or adversarial inputs.

Как отвечать на собеседовании

  • Draw the router before the model.
  • Mention caching and model selection as cost controls.