TGViewer
Coding Interview Preparation Coding Interview Preparation @coding_interview_preparation · 5.9K subscribers
Post #1197 524
✅ Backend Basics Interview Questions – Part 4 (REST API) 🚀💻 

📍 1. What is a REST API?
A: REST (Representational State Transfer) APIs allow clients to interact with server resources using HTTP methods like GET, POST, PUT, DELETE.

📍 2. Difference Between REST & SOAP
- REST uses HTTP, is lightweight, and supports JSON/XML. 
- SOAP is protocol-based, heavier, uses XML, and has strict standards.

📍 3. HTTP Methods
- GET → Read data 
- POST → Create data 
- PUT → Update data 
- DELETE → Delete data 
- PATCH → Partial update 

📍 4. Example – Creating a GET Route
app.get('/users', (req, res) => {
  res.send(users); // Return all users
});

📍 5. Example – POST Route 
app.post('/users', (req, res) => {
  const newUser = req.body;
  users.push(newUser);
  res.status(201).send(newUser);
});

📍 6. Route Parameters & Query Parameters 
app.get('/users/:id', (req, res) => {
  res.send(users.find(u => u.id == req.params.id));
});
app.get('/search', (req, res) => {
  res.send(users.filter(u => u.name.includes(req.query.name)));
});

📍 7. Status Codes
- 200 → OK 
- 201 → Created 
- 400 → Bad Request 
- 404 → Not Found 
- 500 → Server Error 

📍 8. Best Practices
- Validate request data
- Handle errors properly 
- Use consistent endpoint naming 
- Keep routes modular using express.Router() 

💬 Double Tap ❤️ for more!
More from @coding_interview_preparation
  1. Oct 10, 2026100 SQL interview questions
  2. Oct 8, 2026If you're prepping for system design interviews, this repo is gold It contains a curated,…
  3. Oct 6, 2026document post
  4. Oct 4, 2026💼 Why Your Resume Gets Rejected Before a Human Reads It You may have good skills and proj…
  5. Oct 2, 2026🧠 Coding Myths You Should Stop Believing There's a lot of advice online about learning to…
  6. Oct 1, 2026Most Asked Topics in AI Engineer Interviews Based on 2026 candidate reports
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →