Backend Development Fundamentals MCQs for NSCT

By the NSCT Exam Editorial Team · Updated 2026-11-24 · Facts checked against official sources on 2026-11-24

Backend development is the server side of a web application: the code that receives HTTP requests, routes them to the right handler, applies business rules, talks to the database and sends back a response. It is topic 9 of the Web Development area, which carries 10% of the NSCT according to HEC's Areas of Competencies. In 2026 candidates averaged 54.1% accuracy in Web Development, per the HEC NSCT report and APP.

The examples use Node.js and Express because they are short and common in FYPs, but the ideas carry over to Django, Laravel and Spring. Revise Web Architecture & Protocols first for HTTP methods and status codes.

Servers

A server is a program that listens on a port, accepts requests and returns responses. Two roles are worth separating:

Web server Application server
Main job Handle HTTP, serve static files Run application code for dynamic responses
Examples Nginx, Apache httpd Node.js process, Gunicorn with Django, Tomcat
Typical extras Reverse proxy, TLS, load balancing, caching Business logic, database access

A reverse proxy such as Nginx sits in front of the app servers and forwards requests to them. HTTP is stateless: each request stands alone, so apps remember users with sessions (server-side data plus a session-ID cookie) or tokens such as JWTs.

Exam angle: Node.js runs JavaScript on one main thread. Its I/O is non-blocking, but a long synchronous loop in one route delays every other request.

Routing

Routing maps a method and URL path to a handler. REST-style routes use nouns for resources and HTTP methods as verbs.

app.get('/courses/:code', showCourse);       // req.params.code
app.get('/courses', listCourses);            // ?page=2 -> req.query.page
app.post('/courses', createCourse);          // 201 Created
app.patch('/courses/:code', updateCourse);   // partial update
app.delete('/courses/:code', deleteCourse);

Route parameters (/courses/CS101) identify a resource and arrive as strings in req.params. Query strings (?page=2&limit=20) carry options such as paging and filtering. GET, PUT and DELETE are idempotent; POST is not. PUT replaces a whole resource, while PATCH changes part of it.

Exam angle: routes are matched in registration order, so /users/:id declared before /users/new catches /users/new with id = 'new'.

Middleware

Middleware is a function (req, res, next) that runs during the request-response cycle. It can read or change the request, end the cycle by sending a response, or call next() to pass control on. Logging, body parsing (express.json()), authentication and CORS headers are typical jobs.

app.use(express.json());              // fills req.body
app.use('/admin', requireAdmin);      // /admin and /admin/*, any method
app.get('/admin/stats', showStats);
app.use((err, req, res, next) => {    // four params = error handler
  res.status(500).json({ error: err.message });
});

Order matters: middleware runs top to bottom, and error handlers must come after the routes. Express 4 does not catch a rejected promise from an async handler, so you call next(err) yourself. Express 5 forwards it automatically.

Exam angle: a middleware that neither responds nor calls next() leaves the request hanging.

MVC

Model-View-Controller (MVC) separates an application into three roles: - Model: data and business rules, usually backed by the database. - View: presentation, such as an HTML template or a JSON shape. - Controller: receives the request, calls the model and picks the view.

Django calls the same idea Model-Template-View, where its "view" plays the controller role. Whatever the names, keep controllers thin and put rules such as discounts or validation in the model or a service layer.

Exam angle: a "fat controller" that runs SQL, calculates prices and builds HTML is the usual refactoring question.

Common traps

Worked examples

1. Understanding. In MVC, which part should validate that a student's CGPA is between 0 and 4 before saving? Answer: the model. Validation is a data rule, so it belongs with the data. A check only in the controller or view can be bypassed by another route or an API client.

2. Application. An Express app registers app.use(logger), then app.get('/health', (req, res) => res.send('ok')), then app.use(notFound). A client requests GET /health. Which functions run? Answer: logger, then the /health handler. The logger calls next(), the handler sends a response without calling next(), so notFound never runs.

3. Analysis. A Node API that resizes images synchronously inside its route becomes slow for all users whenever someone uploads a photo, even users who only call GET /status. What is the cause, and what is the right fix? Answer: the resize holds Node's single JavaScript thread, so the event loop cannot answer other requests. Move the work to a worker thread or a background job queue. Adding more routes or raising the request timeout changes nothing, because the thread is still blocked.

Practise

The quiz below has 100 Backend Development Fundamentals questions, filterable by tier and difficulty. The Express and Node.js behaviour questions were run against real servers (Express 4 and 5) to confirm the answers.

Practise: 100 questions

Interactive quiz loading. The first 10 questions are shown below.

  1. Which task is the main job of the backend in a web application?

    1. Laying out the page with CSS in the user's browser
    2. Receiving requests, applying business rules, reading or writing data, and sending back responses
    3. Updating the DOM when the user clicks a button
    4. Turning HTML into pixels on the screen
    Show answer

    Answer: B. Receiving requests, applying business rules, reading or writing data, and sending back responses

    The backend runs on a server. It handles HTTP requests, validates input, applies business logic, talks to databases and other services, and returns HTML or JSON. Layout, DOM updates and painting all happen in the browser, on the frontend.

  2. In the Model-View-Controller (MVC) pattern, which part holds the application's data and business rules?

    1. Model
    2. View
    3. Controller
    4. Router
    Show answer

    Answer: A. Model

    The model represents the data and the rules that apply to it, such as validation and calculations, and usually talks to the database. The view presents data, and the controller handles input and coordinates the two. A router is not one of the three MVC roles.

  3. In a server-side MVC framework, what does the controller do?

    1. Stores data permanently in tables
    2. Contains the HTML template the user sees
    3. Styles the page for different screen sizes
    4. Receives the request, calls the model, and chooses the view or response to send back
    Show answer

    Answer: D. Receives the request, calls the model, and chooses the view or response to send back

    A controller action is the entry point for a request: it reads the input, asks the model for data or to make changes, and passes the result to a view or returns JSON. Data storage belongs to the model and database, and templates belong to the view.

  4. What is middleware in an Express.js application?

    1. A database that sits between the server and the client
    2. A browser plug-in that edits requests before they are sent
    3. A separate server that compiles JavaScript
    4. A function with access to req, res and next that runs during the request-response cycle
    Show answer

    Answer: D. A function with access to req, res and next that runs during the request-response cycle

    Express middleware has the signature (req, res, next). It can read or change the request and response, end the cycle by sending a response, or call next() to pass control on. Logging, body parsing and authentication are typical examples.

  5. How does Express recognise a middleware function as an error handler?

    1. Its name starts with error
    2. It is registered with app.error()
    3. It is declared with four parameters: (err, req, res, next)
    4. It returns a status code of 500
    Show answer

    Answer: C. It is declared with four parameters: (err, req, res, next)

    Express checks the function's arity. A function with exactly four parameters is treated as error-handling middleware, and it runs only when an error is passed with next(err) or thrown. Normal requests skip it. There is no app.error() method.

  6. For the Express route app.get('/users/:id', handler), where does handler find the value 42 when GET /users/42 is requested?

    1. req.params.id
    2. req.query.id
    3. req.body.id
    4. req.headers.id
    Show answer

    Answer: A. req.params.id

    Named segments in the route path, such as :id, are route parameters and appear in req.params, always as strings. req.query holds query-string values after the ?, req.body holds the parsed request body, and headers are separate metadata.

  7. What does it mean that HTTP is a stateless protocol?

    1. Servers cannot store any data in a database
    2. The connection is closed after every byte sent
    3. Each request is handled on its own; the protocol keeps no memory of earlier requests, so apps add cookies, sessions or tokens
    4. Responses can never be cached
    Show answer

    Answer: C. Each request is handled on its own; the protocol keeps no memory of earlier requests, so apps add cookies, sessions or tokens

    HTTP itself does not link one request to the next. To remember a logged-in user, applications add state on top: a session ID in a cookie, or a token sent with each request. Databases and caching are unaffected, and HTTP/1.1 keeps connections open by default.

  8. Which HTTP method is NOT idempotent according to the HTTP specification?

    1. POST
    2. PUT
    3. DELETE
    4. GET
    Show answer

    Answer: A. POST

    A method is idempotent if repeating the same request leaves the server in the same state as sending it once. GET, PUT and DELETE are idempotent by definition (RFC 9110). POST is not; two identical POSTs to /orders usually create two orders.

  9. A company puts Nginx in front of three Node.js app servers. Which job does Nginx do in this setup?

    1. It acts as a forward proxy that hides the users' IP addresses from the websites they visit
    2. It replaces the database for the app servers
    3. It compiles the Node.js code to machine code
    4. It acts as a reverse proxy: it receives client requests and forwards them to the app servers, often handling TLS and load balancing
    Show answer

    Answer: D. It acts as a reverse proxy: it receives client requests and forwards them to the app servers, often handling TLS and load balancing

    A reverse proxy sits on the server side and faces clients for one or more back-end servers. It can terminate HTTPS, spread load, cache responses and serve static files. A forward proxy sits on the client side and acts for users.

  10. What is the usual distinction between a web server and an application server?

    1. A web server runs only in the browser, and an application server runs only on the cloud
    2. A web server stores data, and an application server displays it
    3. There is no difference; the names are always interchangeable
    4. A web server mainly handles HTTP and serves static files; an application server runs application code to build dynamic responses
    Show answer

    Answer: D. A web server mainly handles HTTP and serves static files; an application server runs application code to build dynamic responses

    Nginx and Apache httpd are classic web servers: they handle connections and serve files. Application servers such as Gunicorn running Django, or a Node.js process, execute business logic. In practice the line blurs, since Node can do both, but the roles are distinct.

FAQs

What is the difference between frontend and backend development?

Frontend code runs in the browser and builds what the user sees and clicks, using HTML, CSS and JavaScript. Backend code runs on a server and handles requests, business rules, authentication and data storage. They communicate over HTTP, usually with JSON. Full-stack developers work on both sides.

Which backend language should I learn for the NSCT?

The questions test concepts such as routing, middleware, MVC, HTTP methods and status codes, which work the same way in every stack. Pick one framework you already use, such as Express, Django or Laravel, and learn its request cycle well. Then compare how other server-side languages do the same job.

Should I use sessions or JWTs for login?

Sessions keep state on the server and send only an ID in a cookie, so logging out or banning a user takes effect at once. JWTs carry signed claims, so any server can verify them without a lookup, which suits APIs and multiple services. The cost is revocation: a JWT stays valid until it expires unless you add a denylist or keep lifetimes short.

What does next() do in Express?

next() hands the request to the next matching middleware or route in the stack. Calling next(err) skips ordinary middleware and jumps to the next error handler. If a function neither calls next() nor sends a response, the request hangs until the client gives up.

Next step

Continue with Server-Side Programming MCQs, check codes in HTTP status codes, go back to the Web Development MCQ hub, or test yourself across every area in an NSCT mock test.