All fields

“RESTful API Design with Express” in Information Technology

25 questions across 1 technology.

Information Technology

25 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is Express.js, and what problem does it solve compared to using Node.js's raw http module directly? Node.js › Express & MiddlewareNode.jsExpress & MiddlewareBeginner
2What is the difference between application-level, router-level, and route-specific middleware in Express? Node.js › Express & MiddlewareNode.jsExpress & MiddlewareIntermediate
3What does the express.json() and express.urlencoded() built-in middleware do, and why must it be registered before routes that need to read req.body? Node.js › Express & MiddlewareNode.jsExpress & MiddlewareIntermediate
4What is the difference between res.send(), res.json(), and res.end() in Express, and when should each be used? Node.js › Express & MiddlewareNode.jsExpress & MiddlewareIntermediate
5How would you set up a basic GraphQL server in Node.js using Apollo Server, and what are schema and resolvers? Node.js › GraphQL with Node.jsNode.jsGraphQL with Node.jsBeginner
6What does the URL/URLSearchParams API provide, and why is it generally preferred over the older querystring module today? Node.js › Core Node.js ModulesNode.jsCore Node.js ModulesBeginner
7What is GraphQL, and how does it differ from a traditional REST API in terms of how clients request data? Node.js › GraphQLNode.jsGraphQLBeginner
8How would you create a basic HTTP server in Node.js using only the built-in node:http module, without any framework? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersBeginner
9How would you implement a global 'not found' (404) handler in Express for any route that doesn't match a defined endpoint? Node.js › Error HandlingNode.jsError HandlingIntermediate
10What is content negotiation in HTTP, and how would a Node.js API implement it to return either JSON or XML based on a client's Accept header? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersIntermediate
11What is a centralized error-handling middleware pattern in Express, and what advantages does it provide over handling errors in each individual route? Node.js › Error HandlingNode.jsError HandlingAdvanced
12What is the difference between a 4xx and 5xx HTTP status code from an error-handling perspective, and how should a Node.js API decide which to return? Node.js › Error HandlingNode.jsError HandlingAdvanced
13How would you implement error handling for a GraphQL API in Node.js, given GraphQL's different error-response format compared to REST? Node.js › Error HandlingNode.jsError HandlingAdvanced
14What is the difference between a GraphQL query variable and hardcoding a value directly inside the query string? Node.js › GraphQLNode.jsGraphQLBeginner
15What is the difference between an HTTP request header and a query parameter, and when should each be used to pass information to a Node.js server? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersBeginner
16How would you create and use custom Error subclasses in a Node.js application to represent different categories of application-specific errors? Node.js › Error HandlingNode.jsError HandlingIntermediate
17What is the difference between a validation error and a business-logic error, and how might a Node.js application handle each differently? Node.js › Error HandlingNode.jsError HandlingIntermediate
18How would you set up a basic GraphQL server in Node.js using Apollo Server, defining a schema and resolvers? Node.js › GraphQLNode.jsGraphQLIntermediate
19What is the difference between a GraphQL Query, Mutation, and Subscription operation type? Node.js › GraphQLNode.jsGraphQLIntermediate
20What is GraphQL introspection, and why might you want to disable it in a production environment? Node.js › GraphQLNode.jsGraphQLIntermediate
21What is the purpose of GraphQL fragments, and how do they help avoid duplicating field selections across multiple queries? Node.js › GraphQLNode.jsGraphQLIntermediate
22What is the purpose of GraphQL's non-null (!) type modifier, and what happens if a resolver for a non-null field returns null unexpectedly? Node.js › GraphQLNode.jsGraphQLIntermediate
23What is the difference between a GraphQL scalar type and an object type, and how would you define a custom scalar (like DateTime) in a Node.js GraphQL server? Node.js › GraphQLNode.jsGraphQLIntermediate
24What is the difference between HTTP methods GET, POST, PUT, PATCH, and DELETE, and what does 'idempotent' mean in this context? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersIntermediate
25What is the difference between a 301 and a 302 HTTP redirect, and when should a Node.js application use each? Node.js › HTTP & Web ServersNode.jsHTTP & Web ServersIntermediate