Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
Short answer: How do they differ? process.nextTick() queues a callback to be invoked immediately after the current operation completes, before the event loop continues. setImmediate() queues a callback to run on the next…
Short answer: Deploying means getting your app from your local machine to a live server. Explain a bit more Basic steps: Choose a hosting platform: VPS (DigitalOcean, AWS EC2), PaaS (Heroku, Vercel), or container platfor…
Short answer: You typically use the MongoDB Node.js driver or an ODM like Mongoose. Explain a bit more Basic connection example with native driver: const { MongoClient } = require('mongodb'); async function connect() { c…
Short answer: Unit tests check small, isolated pieces of your code (like functions) to make sure they work as expected. Explain a bit more Basic example using Mocha and Chai: // calculator.js function add(a, b) { return…
Short answer: process.nextTick() queues a callback to be invoked immediately after the current operation completes, before the event loop continues. Explain a bit more setImmediate() queues a callback to run on the next…
Short answer: If an error (exception) is thrown but not caught, Node.js will: Print the error stack trace to the console. Explain a bit more Immediately terminate the process to avoid unpredictable behavior. Why? Because…
Short answer: Injection attacks (SQL, NoSQL) Cross-Site Scripting (XSS) Cross-Site Request Forgery (CSRF) Broken authentication and session management Insecure handling of sensitive data (passwords, API keys) Unvalidated…
Short answer: s expected. Basic example using Mocha and Chai: // calculator.js function add(a, b) { return a + b; } module.exports = add; // test/calculator.test.js const add = require('../calculator'); const { expect }…
Short answer: Node.js uses a single-threaded event loop to handle concurrency. Explain a bit more This design: Simplifies programming by avoiding thread-related bugs like race conditions. Uses non-blocking I/O so a singl…
Short answer: Always use parameterized queries or prepared statements instead of string concatenation. Example with MySQL: connection.query('SELECT * FROM users WHERE id = ?', [userId], callback); Use ORM libraries like…
Short answer: Mocha: Flexible test runner, widely used. Jest: Full-featured, zero-config, includes mocks and coverage. Jasmine: Behavior-driven development framework. AVA: Minimalistic and fast. Tape: Simple and small fo…
Short answer: Use clustering or process managers like PM2 to utilize multiple CPU cores. Explain a bit more Implement caching (in-memory or distributed caches like Redis). Use asynchronous I/O properly (avoid blocking th…
Short answer: Node.js operates on a single-threaded, event-driven architecture. Explain a bit more It uses the event loop to handle multiple connections concurrently, which means it can perform non-blocking I/O operation…
Short answer: Physically separate datacenters within an Azure region. Ensure high availability and fault tolerance. Example: Deploy VMs across Zone 1, 2, 3 for resiliency. Real-world example (ShopNest) ShopNest on Azure…
Short answer: Configure federation using SAML, OpenID Connect, or OAuth 2.0. Example: Integrate Google Workspace or Okta for authentication. Real-world example (ShopNest) ShopNest on Azure typically uses App Service + SQ…
Short answer: Deploy ASP.NET Core apps to Azure App Service or Azure Functions. Use deployment slots for blue/green deployments. Enable auto-scaling based on CPU, memory, or request count. Monitor with Application Insigh…
Short answer: Use Application Insights to trace exceptions and request failures. Access Kudu console for logs and process inspection. Use Remote Debugging from Visual Studio. Example: Enabled detailed error messages and…
Short answer: Example: CI/CD failed due to secret misconfiguration in Key Vault. Resolved by configuring pipeline managed identity and updating Key Vault access policies. Ensured staging deployments were successful befor…
Short answer: Use deployment slots in Azure App Service. Swap staging and production after successful smoke tests. Enable traffic routing gradually using Azure Front Door. Use feature flags to hide new features until ful…
Short answer: Example: Automated invoice processing using Azure Functions triggered by Blob uploads. Reduced manual workload and scaled automatically during peak hours. Integrated with Azure Storage, Cosmos DB, and Servi…
Short answer: Use Azure Policy to enforce resource rules. Store secrets in Azure Key Vault. Implement role-based access control (RBAC) for all resources. Enable Azure Security Center for continuous monitoring. Real-world…
Short answer: PI system? Azure App Service or Azure Kubernetes Service (AKS) for hosting APIs. Azure API Management for gateway and throttling. Cosmos DB with partitioned throughput for high-speed data. Azure Cache for R…
Short answer: Azure App Service or Azure Kubernetes Service (AKS) for hosting APIs. Azure API Management for gateway and throttling. Cosmos DB with partitioned throughput for high-speed data. Azure Cache for Redis for fr…
Short answer: pps? Database latency or unoptimized queries. Blocking synchronous calls instead of async patterns. Memory or CPU constraints on App Service Plan. Excessive cold starts in serverless functions. Poor caching…
Short answer: Database latency or unoptimized queries. Blocking synchronous calls instead of async patterns. Memory or CPU constraints on App Service Plan. Excessive cold starts in serverless functions. Poor caching stra…
Node.js Node.js Tutorial · Node.js
Short answer: How do they differ? process.nextTick() queues a callback to be invoked immediately after the current operation completes, before the event loop continues. setImmediate() queues a callback to run on the next iteration of the event loop.
process.nextTick(() => console.log('nextTick')); setImmediate(() => console.log('setImmediate')); console.log('sync'); Output: sync nextTick setImmediate nextTick runs before any I/O or timers; setImmediate runs after I/O callbacks.
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: Deploying means getting your app from your local machine to a live server.
Basic steps: Choose a hosting platform: VPS (DigitalOcean, AWS EC2), PaaS (Heroku, Vercel), or container platforms (Kubernetes, Docker). Set environment variables securely (don't hardcode secrets). Install dependencies using npm install --production. Run your app with a process manager (like PM2) for stability. Set up reverse proxy (using Nginx or Apache) to handle HTTPS, load balancing, and static files. Automate deployments with scripts or CI/CD pipelines.
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: You typically use the MongoDB Node.js driver or an ODM like Mongoose.
Basic connection example with native driver: const { MongoClient } = require('mongodb'); async function connect() { const uri = 'mongodb://localhost:27017/mydatabase'; const client = new MongoClient(uri); try { await client.connect(); console.log('Connected to MongoDB'); const db = client.db('mydatabase'); // Use `db` to query collections } catch (err) { console.error(err); } finally { await client.close(); } } connect();
You typically use the MongoDB Node.js driver or an ODM like Mongoose. Basic connection example with native driver: const { MongoClient } = require('mongodb');
async function connect() {
const uri = 'mongodb://localhost:27017/mydatabase';
const client = new MongoClient(uri); try { await client.connect(); console.log('Connected to MongoDB'); const db = client.db('mydatabase'); // Use `db` to query collections } catch (err) { console.error(err); } finally { await client.close();
}
} connect();
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: Unit tests check small, isolated pieces of your code (like functions) to make sure they work as expected.
Basic example using Mocha and Chai: // calculator.js function add(a, b) { return a + b; const { expect } = require('chai'); describe('add function', () => { it('should return the sum of two numbers', () => { const result = add(2, 3); expect(result).to.equal(5); }); }); Run tests with: mocha This test suite checks if add(2,3) equals 5 — simple and effective.
}
module.exports = add; // test/calculator.test.js const add = require('../calculator');
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: process.nextTick() queues a callback to be invoked immediately after the current operation completes, before the event loop continues.
setImmediate() queues a callback to run on the next iteration of the event loop.
process.nextTick(() => console.log('nextTick')); setImmediate(() => console.log('setImmediate')); console.log('sync'); Output: sync nextTick setImmediate nextTick runs before any I/O or timers; setImmediate runs after I/O callbacks.
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: If an error (exception) is thrown but not caught, Node.js will: Print the error stack trace to the console.
Immediately terminate the process to avoid unpredictable behavior. Why? Because an uncaught exception might leave the app in an inconsistent state. Best practice: Use try/catch for synchronous code, and listen to 'uncaughtException' or 'unhandledRejection' events to log errors and gracefully shut down: process.on('uncaughtException', (err) => { console.error('Uncaught Exception:', err); process.exit(1); // Exit to avoid unstable state });
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: Injection attacks (SQL, NoSQL) Cross-Site Scripting (XSS) Cross-Site Request Forgery (CSRF) Broken authentication and session management Insecure handling of sensitive data (passwords, API keys) Unvalidated input data Exposed stack traces or error messages Security misconfigurations
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: s expected. Basic example using Mocha and Chai: // calculator.js function add(a, b) { return a + b; } module.exports = add; // test/calculator.test.js const add = require('../calculator'); const { expect } = require('chai'); describe('add function', () => { it('should return the sum of two numbers', () => { const result = add(2, 3);… Explain a… bit more s…… expected. Basic example using Mocha and Chai: //…
calculator.js function add(a, b) { return a + b; } module.exports = add; // test/calculator.test.js const add = require('../calculator'); const { expect } = require('chai'); describe('add function', () => { it('should return the sum of two numbers', () => { const result = add(2, 3); expect(result).to.equal(5); }); }); Run tests with: mocha This test suite checks if add(2,3) equals 5 — simple and effective. s expected. Basic example using Mocha and Chai: // calculator.js function add(a, b) { return a + b; } module.exports = add; // test/calculator.test.js const add = require('../calculator'); const { expect } =… s expected. Basic example… }
module.exports = add; // test/calculator.test.js const add = require('../calculator');
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: Node.js uses a single-threaded event loop to handle concurrency.
This design: Simplifies programming by avoiding thread-related bugs like race conditions. Uses non-blocking I/O so a single thread can handle many connections efficiently. Offloads heavy tasks (file I/O, network requests) to background threads in the libuv thread pool. So, Node.js can handle many tasks concurrently without spawning multiple OS threads for each.
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: Always use parameterized queries or prepared statements instead of string concatenation. Example with MySQL: connection.query('SELECT * FROM users WHERE id = ?', [userId], callback); Use ORM libraries like Sequelize which handle this automatically. Validate and sanitize inputs.
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: Mocha: Flexible test runner, widely used. Jest: Full-featured, zero-config, includes mocks and coverage. Jasmine: Behavior-driven development framework. AVA: Minimalistic and fast. Tape: Simple and small footprint.
A ShopNest BFF in Node.js aggregates catalog and price APIs for the React storefront.
Node.js Node.js Tutorial · Node.js
Short answer: Use clustering or process managers like PM2 to utilize multiple CPU cores.
Implement caching (in-memory or distributed caches like Redis). Use asynchronous I/O properly (avoid blocking the event loop). Optimize database queries and use connection pooling. Minimize heavy computations in the main thread (offload with worker threads). Use gzip compression for responses. Properly manage memory leaks. Use load balancers in production.
Node.js Node.js Tutorial · Node.js
Short answer: Node.js operates on a single-threaded, event-driven architecture.
It uses the event loop to handle multiple connections concurrently, which means it can perform non-blocking I/O operations efficiently. 📌 Real-life analogy: Think of it like a chef (Node.js) who takes multiple orders (requests) but doesn't cook each dish one at a time. Instead, they prep and send off tasks (e.g., grilling, baking) and move on to the next customer while waiting.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: Physically separate datacenters within an Azure region. Ensure high availability and fault tolerance. Example: Deploy VMs across Zone 1, 2, 3 for resiliency.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: Configure federation using SAML, OpenID Connect, or OAuth 2.0. Example: Integrate Google Workspace or Okta for authentication.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: Deploy ASP.NET Core apps to Azure App Service or Azure Functions. Use deployment slots for blue/green deployments. Enable auto-scaling based on CPU, memory, or request count. Monitor with Application Insights for performance metrics. Example: Scaled an eCommerce API to 3 instances with auto-scale on 70% CPU.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: Use Application Insights to trace exceptions and request failures. Access Kudu console for logs and process inspection. Use Remote Debugging from Visual Studio. Example: Enabled detailed error messages and traced a null reference exception in production logs.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: Example: CI/CD failed due to secret misconfiguration in Key Vault. Resolved by configuring pipeline managed identity and updating Key Vault access policies. Ensured staging deployments were successful before production swap.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: Use deployment slots in Azure App Service. Swap staging and production after successful smoke tests. Enable traffic routing gradually using Azure Front Door. Use feature flags to hide new features until fully validated.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: Example: Automated invoice processing using Azure Functions triggered by Blob uploads. Reduced manual workload and scaled automatically during peak hours. Integrated with Azure Storage, Cosmos DB, and Service Bus for processing workflow.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: Use Azure Policy to enforce resource rules. Store secrets in Azure Key Vault. Implement role-based access control (RBAC) for all resources. Enable Azure Security Center for continuous monitoring.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: PI system? Azure App Service or Azure Kubernetes Service (AKS) for hosting APIs. Azure API Management for gateway and throttling. Cosmos DB with partitioned throughput for high-speed data. Azure Cache for Redis for frequently accessed data. Use Azure Front Door / CDN for global load balancing.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: Azure App Service or Azure Kubernetes Service (AKS) for hosting APIs. Azure API Management for gateway and throttling. Cosmos DB with partitioned throughput for high-speed data. Azure Cache for Redis for frequently accessed data. Use Azure Front Door / CDN for global load balancing.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: pps? Database latency or unoptimized queries. Blocking synchronous calls instead of async patterns. Memory or CPU constraints on App Service Plan. Excessive cold starts in serverless functions. Poor caching strategy or missing CDNs.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.
Microsoft Azure Microsoft Azure Tutorial · Azure
Short answer: Database latency or unoptimized queries. Blocking synchronous calls instead of async patterns. Memory or CPU constraints on App Service Plan. Excessive cold starts in serverless functions. Poor caching strategy or missing CDNs.
ShopNest on Azure typically uses App Service + SQL Database + Blob Storage + Application Insights for monitoring.