All fields

“Clustering” in Information Technology

54 questions across 2 technologies.

Information Technology

54 questions in 2 technologies

#QuestionTechnologyTopicLevel
1What is the os.cpus() function used for when setting up clustering in a Node.js application? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsBeginner
2What is Redis Cluster, and what problem does it solve compared to running a single Redis instance? Redis › ClusteringRedisClusteringBeginner
3What is the difference between a master node and a replica node within a Redis Cluster? Redis › ClusteringRedisClusteringBeginner
4How does Redis Cluster automatically handle failover when a master node becomes unavailable? Redis › ClusteringRedisClusteringIntermediate
5What are the key limitations of Redis Cluster that developers should be aware of compared to a single instance Redis setup? Redis › ClusteringRedisClusteringIntermediate
6How do you monitor the overall health and status of a Redis Cluster to catch problems before they affect your application? Redis › ClusteringRedisClusteringIntermediate
7How would you design a Redis Cluster deployment to properly balance high availability, performance, and cost for a large scale production application? Redis › ClusteringRedisClusteringAdvanced
8What is a split brain scenario in the context of Redis Cluster, and how does the cluster protect against it? Redis › ClusteringRedisClusteringAdvanced
9Why does Node.js provide a cluster module, given that a single Node.js process is single-threaded? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
10How does PM2's cluster mode compare to manually using Node's built-in cluster module directly in application code? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
11How do you pass data between the main thread and a worker thread using postMessage(), and what are the limits on what can be sent? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
12What is the difference between the 'sticky' and default load-balancing strategies when using Node's cluster module, and when does it matter? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
13What is the difference between the number of CPU cores and the optimal number of cluster workers for a given Node.js application? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
14What is the difference between spawning a Worker Thread and spawning a Child Process for running a CPU-intensive JavaScript function? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
15How do you gracefully terminate a worker thread, and what's the difference between worker.terminate() and letting it exit naturally? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsIntermediate
16What happens to in-memory state (like an in-memory cache) when using the Node.js cluster module, and how do you handle this correctly? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
17How do you use SharedArrayBuffer to share memory directly between Node.js worker threads, and what are the safety considerations? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
18What is a worker thread pool, and why would you build one rather than creating a new Worker for every task? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
19How does zero-downtime restart work with Node's cluster module or PM2, and why is it important for production deployments? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
20How do you handle an uncaught exception inside a specific cluster worker without taking down the entire application? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
21What is the WorkerData option when creating a Worker, and how does it differ from communicating via postMessage() after creation? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
22What is the difference in behavior between the 'primary' and 'worker' role in Node's cluster module regarding which code paths execute? Node.js › Clustering & Worker ThreadsNode.jsClustering & Worker ThreadsAdvanced
23What is the difference between concurrency and parallelism, and which one does Node.js's event loop actually provide by default? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOBeginner
24What problem does PM2 solve for running a Node.js application in production, beyond just executing 'node server.js'? Node.js › Deployment & Process Managers (PM2)Node.jsDeployment & Process Managers (PM2)Beginner
25What is sharding in a Redis Cluster, and why is it necessary for very large datasets? Redis › Cluster Sharding & Hash SlotsRedisCluster Sharding & Hash SlotsBeginner
26What are hash slots in Redis Cluster, and how many are there in total? Redis › Cluster Sharding & Hash SlotsRedisCluster Sharding & Hash SlotsBeginner
27What is Redis Sentinel, and what role does it play in providing high availability for a non clustered Redis setup? Redis › Redis Sentinel & High AvailabilityRedisRedis Sentinel & High AvailabilityBeginner
28What is a cron job, and how would you schedule recurring background tasks in a Node.js application using node-cron or BullMQ's repeatable jobs? Node.js › Background Jobs & QueuesNode.jsBackground Jobs & QueuesIntermediate
29What is a 'stalled' job in BullMQ, and what causes it? Node.js › Background Jobs & QueuesNode.jsBackground Jobs & QueuesIntermediate
30How does the event loop handle a large synchronous loop (like processing a huge array with a for loop), and what problem does this cause? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
31What is Redis Pub/Sub, and how would a Node.js application use it to broadcast real-time events across multiple server instances? Node.js › Caching with RedisNode.jsCaching with RedisIntermediate
32How does Redis Cluster determine which hash slot a specific key belongs to? Redis › Cluster Sharding & Hash SlotsRedisCluster Sharding & Hash SlotsIntermediate
33What is a hash tag in Redis Cluster, and why would you use one to control which slot certain keys are assigned to? Redis › Cluster Sharding & Hash SlotsRedisCluster Sharding & Hash SlotsIntermediate
34How do you check the current distribution of hash slots and keys across the nodes in a Redis Cluster to identify potential imbalances? Redis › Cluster Sharding & Hash SlotsRedisCluster Sharding & Hash SlotsIntermediate
35What is the difference between a cluster aware client and a regular client when connecting to a Redis Cluster? Redis › Connection Pooling & Client LibrariesRedisConnection Pooling & Client LibrariesIntermediate
36How do you deploy Redis on Kubernetes using a StatefulSet rather than a regular Deployment, and why is this distinction important? Redis › Redis with Docker & KubernetesRedisRedis with Docker & KubernetesIntermediate
37How does Node.js implement the Worker Threads module differently from Child Processes, and when should each be used? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
38How do you detect and prevent event loop blocking in a long-running Node.js service? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
39What is horizontal scaling for a Node.js application, and what specific architectural requirement does it impose? Node.js › Cloud & DevOpsNode.jsCloud & DevOpsAdvanced
40What is the difference between how Node.js handles I/O-bound concurrency versus CPU-bound work, and why does this distinction shape Node.js's ideal use cases? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOAdvanced
41How would you generate a video thumbnail in Node.js using ffmpeg via a library like fluent-ffmpeg? Node.js › File Uploads & Media ProcessingNode.jsFile Uploads & Media ProcessingAdvanced
42How does Node.js achieve high concurrency for I/O-bound workloads despite running JavaScript on a single main thread? Node.js › Node.js Fundamentals & Runtime ArchitectureNode.jsNode.js Fundamentals & Runtime ArchitectureAdvanced
43How would you plan and execute resharding a Redis Cluster to add a new node and redistribute existing hash slots? Redis › Cluster Sharding & Hash SlotsRedisCluster Sharding & Hash SlotsAdvanced
44What happens to client requests during a hash slot migration, and how does Redis Cluster handle keys that are in the middle of being moved? Redis › Cluster Sharding & Hash SlotsRedisCluster Sharding & Hash SlotsAdvanced
45How does Redis Pub/Sub behave differently in a Redis Cluster environment compared to a single instance setup? Redis › Pub/SubRedisPub/SubAdvanced
46How would you plan the hardware and infrastructure requirements for a new Redis deployment expected to handle a large, growing dataset? Redis › Redis Architecture & InstallationRedisRedis Architecture & InstallationAdvanced
47How do Redis modules interact with Redis Cluster, and what considerations apply when using modules in a sharded, distributed environment? Redis › Redis Modules OverviewRedisRedis Modules OverviewAdvanced
48How would you design a read scaling strategy using multiple Redis replicas for an application with a very read heavy workload? Redis › Redis ReplicationRedisRedis ReplicationAdvanced
49What happens to a Redis Cluster's replicas during a failover event, and how does the cluster decide which replica gets promoted? Redis › Redis ReplicationRedisRedis ReplicationAdvanced
50What is the difference between using Redis Sentinel and using Redis Cluster for achieving high availability, and how would you decide between them? Redis › Redis Sentinel & High AvailabilityRedisRedis Sentinel & High AvailabilityAdvanced
51How would you deploy a highly available Redis Sentinel setup on Kubernetes to provide automatic failover for a primary and replica configuration? Redis › Redis with Docker & KubernetesRedisRedis with Docker & KubernetesAdvanced
52What are the tradeoffs between self managing Redis on Kubernetes versus using a Kubernetes Operator specifically built for Redis? Redis › Redis with Docker & KubernetesRedisRedis with Docker & KubernetesAdvanced
53How do you enable TLS encryption for internal replication and cluster bus traffic between Redis nodes, not just for client connections? Redis › TLS & Encryption in RedisRedisTLS & Encryption in RedisAdvanced
54How do Redis transactions interact with Redis Cluster when the queued commands involve keys located on different shards? Redis › TransactionsRedisTransactionsAdvanced