This is Part 2 of key frontend interview questions.

These topics cover SSR/CSR, security (XSS, CSRF, HTTPS), Next.js serverless architecture, SEO, and error boundaries.


Question 1. How does Next.js enable SSR?

API Routes

export default function handler(req, res) {
  res.status(200).json({ message: "Hello Next.js API!" });
}

Serverless Functions

Serverless-Friendly Databases


Question 2. What is CSR vs SSR, and what’s the difference?