AI / LangGraph LangChain Interview questions
How does LangChain differ from traditional LLM integration?
Traditional LLM integration means calling an LLM's HTTP API directly: you construct a prompt string by hand, send a requests.post(), parse the JSON response, and manage conversation history as a list you track yourself. Each provider has a different SDK, different error codes, and different retry behaviour. When you need RAG, you wire vector store calls separately; when you need tools, you parse the model's text output to decide what to call next.
| Concern | Traditional API Integration | LangChain |
|---|---|---|
| Provider switching | Rewrite code per provider SDK | Swap model class, keep same chain |
| Prompt management | Manual string concatenation | PromptTemplate with typed variables |
| Conversation history | Manual list tracking | Memory classes handle automatically |
| Tool/function calling | Custom parsing logic per use case | Agents + Tools framework |
| RAG pipeline | Separate vector DB code + manual retrieval | Retriever + LCEL pipe |
| Retry & fallback | Custom retry logic | Built-in .with_retry() / .with_fallbacks() |
| Observability | Custom logging | LangSmith tracing built-in |
The key difference is composability. LangChain treats every component — model, prompt, retriever, parser — as a Runnable with a consistent interface. You can swap, chain, parallelize, or add fallbacks without touching unrelated code.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
