Back-End Development — Questions and Answers
Question 1: What are the most popular programming languages for backend development?
- Perl, PHP, and SQL
- Java, Python, and Ruby (Correct answer)
- HTML, CSS, and JavaScript
- C++, C#, and Objective-C
Correct answer: Java, Python, and Ruby
Java, Python, and Ruby are all widely used server-side languages for backend development. HTML/CSS/JavaScript are primarily front-end technologies, and the other groupings mix in client-side, systems, or non-mainstream-backend languages, so they don't fit as the most popular backend set.
Question 2: What is session fixation and how can it be mitigated?
- Expired sessions causing logout — mitigated by extending timeout
- Storing sessions in cookies — mitigated by using local storage
- An attack where an attacker sets a known session ID before login — mitigated by regenerating session IDs after authentication (Correct answer)
- Hard-coded sessions — mitigated by using environment variables
Correct answer: An attack where an attacker sets a known session ID before login — mitigated by regenerating session IDs after authentication
Session fixation lets an attacker pre-set a session ID; regenerating a new session ID after successful login prevents the attacker from using the known ID.
Question 3: Which HTTP header helps prevent clickjacking attacks?
- Authorization
- Cache-Control
- Content-Type
- X-Frame-Options (Correct answer)
Correct answer: X-Frame-Options
The X-Frame-Options header (or Content-Security-Policy frame-ancestors directive) tells the browser whether a page can be embedded in an iframe, preventing clickjacking.
Question 4: What is a refresh token and how does it work alongside an access token?
- A token that replaces the session cookie
- A token that refreshes the UI automatically when data changes
- A long-lived token used to obtain new short-lived access tokens without re-authentication (Correct answer)
- A token that refreshes database connections
Correct answer: A long-lived token used to obtain new short-lived access tokens without re-authentication
Refresh tokens are long-lived credentials stored securely that allow clients to obtain new short-lived access tokens when they expire, without requiring the user to log in again.
Question 5: What is 'event sourcing' in back-end architecture?
- Pulling events from external third-party APIs into an internal system
- Storing all state changes as an ordered, immutable sequence of events (Correct answer)
- Generating synthetic test events for load and performance testing
- Logging only the final state of an entity after each change
Correct answer: Storing all state changes as an ordered, immutable sequence of events
Event sourcing persists every state change as an event so the current state can always be rebuilt by replaying the event log.
Question 6: What is the difference between horizontal and vertical scaling?
- Horizontal scaling is for databases; vertical scaling is for web servers
- They are the same scaling strategy with different names
- Horizontal scaling upgrades hardware; vertical scaling adds more servers
- Horizontal scaling adds more servers (scale out); vertical scaling increases resources on existing servers (scale up) (Correct answer)
Correct answer: Horizontal scaling adds more servers (scale out); vertical scaling increases resources on existing servers (scale up)
Vertical scaling (scale up) means adding more CPU/RAM to an existing server, while horizontal scaling (scale out) means adding more server instances and distributing load across them.
Question 7: The backend is what?
- REST API
- Includes everything the user experiences directly
- HTML, CSS and JS
- Responsible for strong and organizing data, communicates with the frontend (Correct answer)
Correct answer: Responsible for strong and organizing data, communicates with the frontend
Explanation: <br> Backend refers to the part of a web application that is responsible for processing and storing data, as well as for communicating with the front. It includes the server, database, and application logic. While the front end deals with the user interface and user experience, the back end focuses on the behind-the-scenes functionality that enables the frontend to operate.
Question 8: A full-stack developer is what?
- He is a superman, knows about everything in the universe
- Has familiarity in many layers, mastered few and genuine interest in software technology (Correct answer)
- Has mastered everything and knows every technology
- Has heard about few technology and not much interested in software technology
Correct answer: Has familiarity in many layers, mastered few and genuine interest in software technology
Explanation: <br> A full-stack developer is a software developer with expertise in working with an application's front-end and back-end. They are proficient in multiple programming languages and understand how different technologies work together to create a functional application. Full-stack developers can work on all layers of an application, from the user interface to the database, and can handle different stages of the software development life cycle. They are well-rounded professionals who independently or as part of a team and can take on a varietvariouso ensure the successful delivery of a project.
Question 9: What is a message queue primarily used for in back-end systems?
- Caching database query results
- Decoupling services and enabling asynchronous communication (Correct answer)
- Managing HTTP request routing
- Storing user session data
Correct answer: Decoupling services and enabling asynchronous communication
Message queues decouple producers and consumers, allowing services to communicate asynchronously without direct dependencies.
Question 10: What is input validation and why is it important on the server side?
- Formatting database query results before sending them to the client
- Validating user input only on the client side to improve UX
- Verifying that API responses conform to the expected schema
- Checking and sanitizing data on the server to ensure it meets expected formats and prevent malicious input (Correct answer)
Correct answer: Checking and sanitizing data on the server to ensure it meets expected formats and prevent malicious input
Server-side validation is essential because client-side validation can be bypassed; the server must always verify and sanitize all incoming data independently.
Question 11: What is the thundering herd problem in caching?
- A memory leak caused by indefinitely growing cache size
- A network failure caused by too many connected clients
- A situation where many requests simultaneously hit the origin/database when a popular cached item expires (Correct answer)
- Many servers crashing simultaneously under high load
Correct answer: A situation where many requests simultaneously hit the origin/database when a popular cached item expires
The thundering herd occurs when a highly-requested cached item expires simultaneously for all callers, causing a surge of requests to hit the database at once before the cache is repopulated.
Question 12: What is CQRS (Command Query Responsibility Segregation)?
- A caching strategy that separates read cache from write cache layers
- A pattern that separates the model for writing data (commands) from reading data (queries) (Correct answer)
- A database replication technique used for high availability
- An API versioning strategy for maintaining backward compatibility
Correct answer: A pattern that separates the model for writing data (commands) from reading data (queries)
CQRS splits an application into a write side (commands that change state) and a read side (queries that return data), allowing each to be optimized independently.
Question 13: Which of the following is a primary benefit of containerizing a full-stack application with Docker?
- It ensures consistent environments across development, testing, and production (Correct answer)
- It automatically scales the app based on CPU usage
- It compiles JavaScript to native machine code
- It replaces the need for a database in production
Correct answer: It ensures consistent environments across development, testing, and production
Docker containers bundle the app and its dependencies so the same image runs identically on any machine.
Question 14: What does the SQL LAG() window function do?
- Delays query execution by a specified interval
- Calculates the lag between two timestamp columns
- Returns a prior row's value based on an offset within the partition (Correct answer)
- Returns the next row's value in the partition
Correct answer: Returns a prior row's value based on an offset within the partition
LAG() accesses a value from a previous row within the same partition without requiring a self-join, commonly used for period-over-period comparisons.
Question 15: Which SQL function converts a string to uppercase?
- UPPER() (Correct answer)
- CAPITALIZE()
- TOUPPER()
- STRTOUPPER()
Correct answer: UPPER()
UPPER() is the standard SQL function that converts all characters in a string to their uppercase equivalents.
Question 16: What is the purpose of a worker process or background job in a back-end application?
- To replace the main web server process for heavy traffic
- To monitor the health of the web server process
- To handle time-consuming tasks (email sending, image processing, report generation) asynchronously outside the request-response cycle (Correct answer)
- To synchronize database replicas in real time
Correct answer: To handle time-consuming tasks (email sending, image processing, report generation) asynchronously outside the request-response cycle
Background workers process long-running tasks from a queue (like Bull, Sidekiq, or Celery) asynchronously, allowing the web server to respond to the client immediately without blocking.
Question 17: Which HTTP/2 feature most improves performance over HTTP/1.1 for back-end APIs serving multiple resources?
- Gzip compression support
- Cookie handling improvements
- Multiplexing multiple streams over a single connection (Correct answer)
- Persistent connections
Correct answer: Multiplexing multiple streams over a single connection
HTTP/2 multiplexing allows multiple concurrent requests and responses over a single TCP connection, eliminating HTTP/1.1's head-of-line blocking.
Question 18: What problem does database normalization primarily aim to solve?
- Index bloat from too many columns
- Query execution speed
- Network latency between client and server
- Data redundancy and update anomalies (Correct answer)
Correct answer: Data redundancy and update anomalies
Normalization organizes data to reduce redundancy and prevent insert, update, and delete anomalies by ensuring each fact is stored once.
Question 19: What is eventual consistency in distributed databases?
- The guarantee that all transactions are immediately consistent
- The process of periodically cleaning up stale database records
- A model where data updates propagate to all nodes over time, and replicas are temporarily out of sync (Correct answer)
- A consistency level where only the master node is ever consistent
Correct answer: A model where data updates propagate to all nodes over time, and replicas are temporarily out of sync
Eventual consistency means that given enough time without new updates, all replicas of a distributed database will converge to the same value, even though short-term inconsistencies may exist.
Question 20: In OAuth 2.0, what is the purpose of the refresh token?
- To encrypt the authorization code
- To obtain a new access token when the current one expires (Correct answer)
- To authenticate the user without a password
- To revoke all existing sessions for a user
Correct answer: To obtain a new access token when the current one expires
Refresh tokens allow clients to obtain new access tokens without requiring the user to re-authenticate, extending session longevity securely.
Question 21: What is the key difference between a point-to-point queue and a pub/sub topic?
- A queue delivers each message to one consumer; a topic delivers to all subscribers (Correct answer)
- Topics require acknowledgment but queues do not
- Queues support only string messages while topics support binary
- Queues are faster than topics
Correct answer: A queue delivers each message to one consumer; a topic delivers to all subscribers
In point-to-point queues each message is consumed by exactly one consumer, while topics broadcast messages to all active subscribers.
Question 22: What is profiling in back-end performance optimization?
- Creating user profiles in the application database
- Measuring the runtime behavior of code to identify bottlenecks in CPU usage, memory consumption, and execution time (Correct answer)
- Configuring server hardware for optimal performance
- Writing performance requirements in a specification document
Correct answer: Measuring the runtime behavior of code to identify bottlenecks in CPU usage, memory consumption, and execution time
Profiling tools instrument code to measure where time and resources are spent, revealing hot paths and bottlenecks that are the highest-value targets for optimization.
Question 23: What does the term 'throughput' mean when measuring back-end performance?
- The maximum number of concurrent database connections
- The total amount of data stored in the database
- The time taken to process a single request from end to end
- The number of requests or transactions a system can process per unit of time (Correct answer)
Correct answer: The number of requests or transactions a system can process per unit of time
Throughput measures how many operations (requests, transactions, messages) a system handles per second or minute, indicating overall system capacity.
Question 24: In RESTful API design, which HTTP method is idempotent AND safe?
- PUT
- DELETE
- POST
- GET (Correct answer)
Correct answer: GET
GET is both idempotent (multiple identical requests produce the same result) and safe (it does not modify server state).
Question 25: What is a cache eviction policy and what does LRU stand for?
- A database archiving policy — Large Record Utility
- The strategy for removing cached items when the cache is full — Least Recently Used means removing the item accessed least recently (Correct answer)
- A backup rotation policy — Least Recently Used
- A network routing algorithm — Load Redistribution Unit
Correct answer: The strategy for removing cached items when the cache is full — Least Recently Used means removing the item accessed least recently
Cache eviction policies determine which items to remove when the cache reaches capacity; LRU (Least Recently Used) evicts the item that hasn't been accessed for the longest time.
Question 26: What is memoization in the context of back-end performance?
- Loading application configuration into memory at startup
- An optimization technique that caches the results of expensive function calls and returns the cached result for the same inputs (Correct answer)
- Storing application logs in memory for faster retrieval
- A technique for reducing memory usage by compressing data structures
Correct answer: An optimization technique that caches the results of expensive function calls and returns the cached result for the same inputs
Memoization caches a function's return value keyed by its input arguments, so subsequent calls with the same inputs return the cached result instantly without re-executing the function.
Question 27: What is service discovery in a microservices architecture?
- Monitoring which services are healthy or unhealthy
- The process of registering services with a central database
- The mechanism by which services dynamically find and communicate with each other without hard-coded addresses (Correct answer)
- Automatically generating API documentation for services
Correct answer: The mechanism by which services dynamically find and communicate with each other without hard-coded addresses
Service discovery allows microservices to locate each other dynamically using a registry (like Consul or Kubernetes DNS), adapting to instances starting, stopping, or moving.
Question 28: What is Redis and what is it commonly used for in back-end applications?
- A cloud object storage service
- A relational database for storing structured data
- An in-memory data store used for caching, session management, real-time leaderboards, and message brokering (Correct answer)
- A front-end state management library
Correct answer: An in-memory data store used for caching, session management, real-time leaderboards, and message brokering
Redis is an in-memory key-value store with data structures like strings, hashes, lists, and sets, widely used to cache expensive computations, store sessions, and power real-time features.
Question 29: What is the purpose of HTTPS Strict Transport Security (HSTS)?
- To restrict server access to trusted IP addresses
- To encrypt cookies on the server side
- To force browsers to always connect to the site using HTTPS, even if HTTP is requested (Correct answer)
- To enforce strong passwords on HTTPS connections
Correct answer: To force browsers to always connect to the site using HTTPS, even if HTTP is requested
HSTS instructs browsers to always use HTTPS for a domain for a specified duration, preventing protocol downgrade attacks and cookie hijacking over HTTP.
Question 30: What is JWT and what is it commonly used for in back-end applications?
- JSON Web Token — used for stateless authentication and authorization (Correct answer)
- JavaScript Web Template — used for front-end rendering
- JavaScript Worker Thread — used for background processing
- Java Web Transfer — used for file uploads
Correct answer: JSON Web Token — used for stateless authentication and authorization
A JSON Web Token is a compact, self-contained token that encodes claims and is widely used for stateless authentication between clients and servers.
Question 31: What is the main advantage of using environment variables for configuration in a back-end application?
- They automatically encrypt API keys at rest
- They replace the need for a configuration file entirely
- They allow secrets and settings to be kept out of source code (Correct answer)
- They speed up database query execution
Correct answer: They allow secrets and settings to be kept out of source code
Environment variables externalize secrets and environment-specific settings so they are not hard-coded or committed to version control.
Question 32: What is an ETag in the context of REST APIs?
- An XML element type indicator
- A version identifier for a resource used for caching and conditional requests (Correct answer)
- An authentication token format
- An error tag for failed responses
Correct answer: A version identifier for a resource used for caching and conditional requests
An ETag is a unique identifier for a specific version of a resource, enabling cache validation and preventing lost updates via conditional requests.
Question 33: What does HATEOAS stand for in REST API design?
- Hypertext API Transfer Engine Of Async Services
- Hypertext As The Engine Of Application State (Correct answer)
- HTTP And Transfer Engine Of Application Services
- HTTP Access To External Object Application State
Correct answer: Hypertext As The Engine Of Application State
HATEOAS is a REST constraint where the API response includes hyperlinks that guide the client to available actions.
Question 34: Which caching strategy writes data to the cache and the database simultaneously on every write?
- Write-behind
- Read-through
- Write-through (Correct answer)
- Cache-aside
Correct answer: Write-through
Write-through ensures the cache and database are always in sync by writing to both on every update, at the cost of higher write latency.
Question 35: In REST API design, what is the correct URL pattern for retrieving a specific user by ID?
- /api?action=getUser&id=5
- /user/get/5
- /getUser?id=5
- /users/5 (Correct answer)
Correct answer: /users/5
RESTful conventions use nouns (plural) for resource names and embed identifiers in the path, like /users/5.
Question 36: What hashing algorithm is recommended for storing passwords and why?
- bcrypt or Argon2 — they are slow by design and include salting (Correct answer)
- SHA-256 — it is a government standard
- MD5 — it is fast and widely supported
- Base64 — it is reversible for password recovery
Correct answer: bcrypt or Argon2 — they are slow by design and include salting
bcrypt and Argon2 are specifically designed for password hashing with configurable work factors and automatic salting, making brute-force attacks impractical.
Question 37: What does 'salting' a password mean in cryptographic terms?
- Appending a unique random value to each password before hashing to prevent rainbow table attacks (Correct answer)
- Hashing the password multiple times
- Encrypting the password with a symmetric key
- Adding a fixed string to all passwords before hashing
Correct answer: Appending a unique random value to each password before hashing to prevent rainbow table attacks
A salt is a unique random value added to each password before hashing, ensuring that identical passwords produce different hashes and making precomputed rainbow table attacks useless.
Question 38: The total number of records in a table can be obtained using an integrated aggregate function (will NOT ignore null values in columns).
- Max()
- Avg()
- Min()
- Count(*) (Correct answer)
Correct answer: Count(*)
Explanation: <br> COUNT(*) is a built-in aggregate function in SQL that is used to return the total number of records in a table, including null values in the columns. The asterisk (*) is used to indicate that you want to count all the rows in the table.
Question 39: What is the difference between latency and response time in back-end performance?
- Latency is the network delay portion; response time is the total time from request sent to response received (latency + processing time) (Correct answer)
- Latency is measured in MB/s; response time is measured in milliseconds
- They are interchangeable terms with no meaningful distinction
- Latency refers to server processing time; response time refers to network delay only
Correct answer: Latency is the network delay portion; response time is the total time from request sent to response received (latency + processing time)
Latency specifically refers to the time data spends in transit over the network, while response time (or end-to-end latency) encompasses network latency plus server processing time plus any queuing delays.
Question 40: What is the 'Saga pattern' used for in event-driven microservices?
- Routing messages between services using different messaging protocols
- Caching results of complex multi-service data aggregation queries
- Managing distributed transactions across multiple services without a global lock (Correct answer)
- Generating API documentation from service event schemas automatically
Correct answer: Managing distributed transactions across multiple services without a global lock
The Saga pattern coordinates long-running distributed transactions using a chain of local transactions and compensating events to roll back on failure.
Question 41: In a REST API, which HTTP method is conventionally used to partially update an existing resource?
- PUT
- PATCH (Correct answer)
- POST
- DELETE
Correct answer: PATCH
PATCH is used for partial updates, while PUT replaces the entire resource.
Question 42: What is content compression and which algorithm is most commonly used for HTTP responses?
- Minifying JavaScript files — UglifyJS compression
- Resizing images for mobile devices — JPEG compression
- Encrypting response payloads — AES compression
- Reducing the size of HTTP response bodies — Gzip or Brotli compression (Correct answer)
Correct answer: Reducing the size of HTTP response bodies — Gzip or Brotli compression
Gzip and Brotli compress HTTP response bodies (HTML, JSON, JS, CSS) before transmission, often reducing payload size by 60-80% and significantly improving transfer speeds.
Question 43: Which SQL window function returns the rank of a row within a partition, with no gaps in ranking values for ties?
- DENSE_RANK() (Correct answer)
- RANK()
- ROW_NUMBER()
- NTILE()
Correct answer: DENSE_RANK()
DENSE_RANK() assigns consecutive ranks without gaps when ties occur, unlike RANK() which skips numbers after ties.
Question 44: Which of the following best describes middleware in the context of a web server?
- A load balancer that distributes traffic across servers
- A caching layer between the client and the API
- A function that processes requests before they reach the route handler (Correct answer)
- A database driver that connects the server to storage
Correct answer: A function that processes requests before they reach the route handler
Middleware sits in the request-response pipeline and can inspect, modify, or terminate requests before the final route handler is invoked.
Question 45: What is connection timeout and why should it be set in back-end applications?
- The maximum time to wait for a database or external service connection before giving up and returning an error (Correct answer)
- The time a user session remains active before logout
- The duration a cached database connection remains open
- The interval between health check pings
Correct answer: The maximum time to wait for a database or external service connection before giving up and returning an error
Setting connection timeouts prevents threads from blocking indefinitely on unresponsive services, allowing the application to fail fast, release resources, and return a meaningful error to the client.
Question 46: What is the purpose of database query optimization techniques like selecting only needed columns?
- To ensure queries use the correct data types
- To minimize the amount of data transferred from the database, reducing memory use and network overhead (Correct answer)
- To prevent SQL injection attacks
- To reduce the number of tables in the database
Correct answer: To minimize the amount of data transferred from the database, reducing memory use and network overhead
Using SELECT column1, column2 instead of SELECT * limits data retrieval to only needed fields, reducing memory consumption, network bandwidth, and the chance of exposing sensitive columns.
Question 47: Which tool is most commonly used to document REST APIs using the OpenAPI Specification?
- Swagger UI (Correct answer)
- GraphQL Playground
- Postman Collections
- Insomnia REST
Correct answer: Swagger UI
Swagger UI renders OpenAPI Specification files into interactive, browser-based API documentation.
Question 48: What is the role of an environment variable in cloud-deployed back-end applications?
- To set the programming language version at compile time
- To define the geographic cloud region for deployment
- To pass configuration values like secrets, database URLs, and feature flags to the application at runtime without hardcoding them (Correct answer)
- To configure network routing rules for the cloud provider
Correct answer: To pass configuration values like secrets, database URLs, and feature flags to the application at runtime without hardcoding them
Environment variables externalize configuration from code, allowing the same application image to behave differently across development, staging, and production environments.
Question 49: What does TTL (Time to Live) mean in the context of caching?
- The maximum time a database query is allowed to run
- The time limit for an API request to complete
- The total time a server has been running
- The duration after which a cached item expires and must be refreshed from the source (Correct answer)
Correct answer: The duration after which a cached item expires and must be refreshed from the source
TTL defines how long a cached value remains valid before it is considered stale and must be re-fetched or recomputed from the original data source.
Question 50: What is a Kafka consumer group?
- A collection of consumers that together consume all partitions of a topic (Correct answer)
- A cluster of Kafka brokers sharing storage
- An admin group for managing Kafka topic configurations
- A set of producers writing to the same topic
Correct answer: A collection of consumers that together consume all partitions of a topic
A consumer group distributes a topic's partitions among its members so that each partition is consumed by exactly one member, enabling parallel processing.
Question 51: What is the purpose of a schema registry in an event streaming platform like Kafka?
- Registering Kafka broker nodes with the cluster coordinator (ZooKeeper or KRaft)
- Storing consumer group offsets and partition assignment metadata
- Tracking per-message delivery acknowledgments across all consumer groups
- Centrally managing and enforcing schemas so producers and consumers share a contract (Correct answer)
Correct answer: Centrally managing and enforcing schemas so producers and consumers share a contract
A schema registry stores versioned schemas (e.g., Avro, Protobuf) and validates messages against them, ensuring producers and consumers agree on message structure.
Question 52: Which of the following best describes a microservices architecture?
- A pattern where all services share a single database
- An application built as a collection of small, independently deployable services (Correct answer)
- A single deployable unit containing all application logic
- A framework for building mobile back-ends
Correct answer: An application built as a collection of small, independently deployable services
Microservices decompose an application into small, independently deployable services that communicate over a network.
Question 53: What is a cold start in serverless back-end functions?
- The latency incurred when a serverless function is invoked after being idle, requiring the provider to initialize the execution environment (Correct answer)
- Starting a new database from scratch with no data
- Deploying a new version of a function without downtime
- The first API call after a server restarts
Correct answer: The latency incurred when a serverless function is invoked after being idle, requiring the provider to initialize the execution environment
Cold starts occur when a serverless function hasn't been invoked recently and the provider must spin up a new container instance, adding 100ms–3s of initialization latency to that first request.
Question 54: What is a Docker container and how does it differ from a virtual machine?
- They are identical in resource usage but containers are faster to download
- A container shares the host OS kernel and is lighter; a VM includes a full OS and is heavier (Correct answer)
- A container runs on bare metal; a VM runs in a cloud environment
- A VM is more secure than a container in all scenarios
Correct answer: A container shares the host OS kernel and is lighter; a VM includes a full OS and is heavier
Containers share the host OS kernel and package only the application and its dependencies, making them lightweight and fast to start, unlike VMs which include a full guest OS.
Question 55: What is the purpose of environment variables in back-end application security?
- To speed up the application by caching configuration
- To store sensitive configuration like API keys and passwords outside of source code (Correct answer)
- To define CSS variables for the UI
- To set the programming language runtime version
Correct answer: To store sensitive configuration like API keys and passwords outside of source code
Environment variables keep sensitive data like credentials and API keys out of the codebase, preventing accidental exposure in version control.
Question 56: Which of the following describes eventual consistency in a distributed database?
- Consistency is guaranteed only for single-node deployments
- All reads always return the most recent write immediately
- The database rolls back any write that cannot be confirmed by all nodes
- Replicas may temporarily return stale data but will converge to the same value given no new updates (Correct answer)
Correct answer: Replicas may temporarily return stale data but will converge to the same value given no new updates
Eventual consistency allows replicas to temporarily diverge after a write, but guarantees they will converge to the same state once updates have propagated to all nodes.
Question 57: What does SQL injection attack involve?
- Inserting malicious SQL code into input fields to manipulate database queries (Correct answer)
- Stealing SQL credentials from server configuration files
- Injecting malicious JavaScript into web pages
- Overloading the server with SQL queries
Correct answer: Inserting malicious SQL code into input fields to manipulate database queries
SQL injection occurs when an attacker inserts malicious SQL into user input that gets executed by the database, potentially exposing or corrupting data.
Question 58: What is the principle of least privilege in back-end security?
- Granting users and services only the minimum permissions needed to perform their tasks (Correct answer)
- Giving all users admin rights to improve productivity
- Encrypting all user data regardless of sensitivity
- Using a single shared database account for all services
Correct answer: Granting users and services only the minimum permissions needed to perform their tasks
The principle of least privilege limits damage from breaches or bugs by ensuring each user and service has only the access rights required for their specific function.
Question 59: Which index type is most efficient for equality lookups on low-cardinality columns in a relational database?
- B-tree index
- Bitmap index (Correct answer)
- Full-text index
- Hash index
Correct answer: Bitmap index
Bitmap indexes are highly efficient for low-cardinality columns (e.g., gender, status) because they represent values as bit arrays enabling fast bitwise operations.
Question 60: What happens when you execute a ROLLBACK statement in SQL?
- Deletes only the most recently inserted row
- Drops and recreates the affected tables
- Undoes all changes made since the last COMMIT or the start of the transaction (Correct answer)
- Saves the current transaction state as a savepoint
Correct answer: Undoes all changes made since the last COMMIT or the start of the transaction
ROLLBACK reverts the database to its state at the beginning of the current transaction, discarding all uncommitted changes made during that transaction.
Question 61: What is the best way to prevent SQL injection in a back-end application?
- Storing queries in environment variables
- Using parameterized queries or prepared statements (Correct answer)
- Encrypting all database connections
- Validating input length only
Correct answer: Using parameterized queries or prepared statements
Parameterized queries separate SQL code from user data, so the database treats user input as data, not executable code.
Question 62: Describe SQL
- A set of rules for managing databases
- A server for managing and querying databases
- A programming language for managing and querying databases (Correct answer)
- A programming language for frontend development
Correct answer: A programming language for managing and querying databases
Explanation: <br> SQL (Structured Query Language) is a programming language for managing and querying relational databases. SQL is a standard language used by many relational database management systems (RDBMS), including MySQL, Oracle, Microsoft SQL Server, and PostgreSQL.
Question 63: What is lazy loading in the context of back-end data retrieval?
- Deferring the loading of data until it is actually needed, reducing initial load time and memory usage (Correct answer)
- Caching data indefinitely to avoid repeated database queries
- Loading data in alphabetical order for efficiency
- Loading all data at startup to avoid delays later
Correct answer: Deferring the loading of data until it is actually needed, reducing initial load time and memory usage
Lazy loading delays fetching related data until it is explicitly accessed, avoiding unnecessary database queries and reducing memory consumption for data that may never be needed.
Question 64: Which format is most commonly used for REST API request and response bodies?
- YAML
- CSV
- JSON (Correct answer)
- XML
Correct answer: JSON
JSON (JavaScript Object Notation) is the de facto standard for REST API payloads due to its lightweight, human-readable, and language-agnostic nature.
Question 65: What is the role of a reverse proxy like Nginx in a full-stack deployment?
- To generate SSL certificates on demand
- To compile server-side TypeScript during deployment
- To sit in front of app servers and forward client requests to them (Correct answer)
- To run database migrations before the app starts
Correct answer: To sit in front of app servers and forward client requests to them
A reverse proxy receives client requests and forwards them to back-end application servers, handling SSL termination and load balancing.
Back-End Development
A comprehensive assessment covering core back-end development skills including APIs, databases, security, performance optimization, caching strategies, and distributed systems architecture.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds