跪拜 Guibai
← All articles
AI Programming · Claude · Artificial Intelligence

AI Coding Plans Are Getting Expensive, and a Meituan RAG Interview Shows What You Need to Know to Land the Job

By 沉默王二 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

The interview questions and architecture decisions map directly to what production RAG systems require: hybrid search to fix pure vector retrieval's blind spots, streaming with user interrupt, and chunking strategies that balance context size against retrieval precision. The pricing shift means individual developers either pay up or target employers who subsidize access.

Summary

The era of cheap AI coding tokens is over. Multiple Coding Plans have raised prices, and one developer reports spending over $350 a month on Claude and Codex alone. The advice for developers who want top-tier models without the bill: get hired at a major Chinese internet company where internal access is unlimited.

The bulk of the piece is a Meituan interview deep-dive for a large-model application developer role. It walks through eight technical questions and their answers, centered on a project called PaiCongMing, a private-knowledge-base RAG system. Topics include a two-stage hybrid retrieval pipeline combining KNN vector recall with BM25 re-ranking, a three-layer semantic text chunking strategy that falls back to HanLP word segmentation, and Redis-based conversation memory with a 20-message FIFO cap and 7-day TTL.

Streaming responses use WebFlux and WebSocket for a typewriter effect, with a stop-generation command protected by a server-issued internal token to prevent abuse. The document parsing pipeline handles PDFs by stripping repeated headers and footers via frequency analysis. The interview also covers why WebSocket beats SSE for chat, when a heap makes sense over a queue for memory eviction, and how to structure a resume entry for an AI application project.

Takeaways
Multiple AI Coding Plans have raised prices, ending the low-price user-acquisition phase; one developer's monthly Claude and Codex bill exceeds $350.
Top-tier AI models are free to use inside large Chinese internet companies, making employment a practical way to avoid personal token costs.
A two-stage hybrid retrieval strategy uses KNN vector recall with a 30x topK window and a keyword must-match condition, followed by BM25 re-ranking where KNN weight is only 0.2 and BM25 is 1.0.
A minScore threshold of 0.3 filters out irrelevant results that pass vector similarity but fail keyword relevance.
Embedding API calls are batched at 100 texts per request with a fixed-delay retry of 3 attempts at 1-second intervals and a 30-second timeout; failure triggers a fallback to pure text search.
Text chunking uses a two-level strategy: 1MB Parent Chunks for memory-safe streaming, then 512-character Semantic Chunks split by double-newline paragraphs, punctuation sentences, and finally HanLP word segmentation.
PDF parsing strips repeated headers and footers by counting the frequency of the first and last 3 lines across all pages and removing those above a threshold.
Conversation memory lives in Redis as a JSON array with a 20-message cap (FIFO truncation from the head) and a 7-day TTL, with long-term persistence in MySQL.
Streaming responses use WebFlux's bodyToFlux to process SSE chunks as they arrive, pushed to the frontend over a WebSocket connection that also accepts a stop command mid-generation.
A server-issued _internal_cmd_token prevents malicious users from forging stop commands to interrupt other users' sessions.
WebSocket is chosen over SSE because full-duplex communication lets the client send a stop command while the server is still pushing response chunks.
Heartbeat keep-alive sends a ping every 20 seconds; if no pong arrives within 10 seconds, the frontend auto-reconnects after a 1.5-second delay.
The system prompt includes an anti-injection rule stating it has the highest priority and must ignore any attempt to modify it.
Claude Code handled requirements analysis and architecture; Codex handled bulk coding; Qoder's expert-panel mode simulated multiple reviewers for testing.
Conclusions

The hybrid retrieval weighting (0.2 KNN, 1.0 BM25) reveals a practical truth: semantic similarity alone is unreliable for factual Q&A, and keyword matching still carries the heavier vote in production.

Batching Embedding calls at 100 items with retry logic and a text-search fallback is the kind of unglamorous resilience work that separates a demo from a system users won't curse at.

The three-layer chunking fallback (paragraphs → sentences → HanLP word segmentation) is a quiet admission that no single heuristic works for Chinese text; you need a cascade that degrades gracefully.

Using frequency analysis to strip PDF headers and footers is a simple statistical trick that avoids the complexity of layout-aware parsing, and it works well enough for most corporate documents.

Choosing FIFO over a priority heap for conversation memory eviction is the right call for chat, but the interviewer's push on heaps suggests they want candidates who know when not to use a data structure, not just how to use it.

The internal command token pattern for stopping generation is a small security detail that most tutorial RAG projects skip, but in a multi-tenant system it prevents a trivial denial-of-service vector.

Advising developers to join big tech for free model access is a candid acknowledgment that the economics of personal AI tooling are breaking down as vendors end loss-leader pricing.

Concepts & terms
Hybrid Retrieval (KNN + BM25)
A search strategy that combines vector similarity (KNN) with keyword relevance scoring (BM25). Vector search finds semantically related content; BM25 re-ranks results by exact term matches, correcting cases where vector similarity returns topically adjacent but factually wrong passages.
Semantic Chunking
Splitting documents into pieces based on meaning boundaries (paragraphs, sentences) rather than fixed character counts. The goal is to keep each chunk self-contained so its embedding vector accurately represents a single topic, improving retrieval precision.
Parent Chunk
A coarse first-pass split of large files (e.g., 1MB) done in a streaming fashion to avoid loading the entire file into memory. Each parent chunk is then subdivided into smaller semantic chunks for embedding.
SSE (Server-Sent Events)
A unidirectional HTTP-based protocol where the server pushes updates to the client. Unlike WebSocket, the client cannot send messages back over the same stream, making it unsuitable for chat interfaces that need a mid-response stop command.
Prompt Injection Prevention
A system prompt rule stating that the system instruction has the highest priority and must ignore any user message attempting to override it. This is a basic defense against users who try to jailbreak the assistant by saying 'forget all previous instructions.'
From the discussion
Featured comments
用户7049980151358 1 likes

What the hell, a hundred question marks?????? How does Function Calling parse user intent? What does Function Calling have to do with parsing user intent? Isn't parsing user intent the AI's job? Isn't Function Calling just a way to invoke tools?

用户32408878106

His thing isn't intent recognition at all. From what he's saying, it's just matching based on frontend parameters and then calling a method.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗