What is the difference between an array and a linked list in terms of memory allocation?
- Dynamic allocation
- Heap allocation
- Stack allocation
- Static allocation
Arrays are statically allocated, meaning their size is fixed at compile time. In contrast, linked lists use dynamic allocation, allowing them to grow or shrink as needed during runtime. Static allocation is primarily used in arrays, where memory is allocated on the stack or heap, while dynamic allocation is more common in linked lists, providing flexibility in memory management.
Which memory management technique involves dividing memory into fixed-sized partitions?
- Buddy system
- Demand paging
- Paging
- Segmentation
The memory management technique that involves dividing memory into fixed-sized partitions is called segmentation. In segmentation, memory is divided into variable-sized segments based on logical divisions, such as code, data, and stack segments. This allows for more flexible memory allocation compared to fixed-sized partitions, which are characteristic of techniques like paging.
What are the advantages and disadvantages of using a hash table to store strings?
- Advantages: easy insertion and deletion, reduced search time; Disadvantages: increased memory overhead, hashing algorithm dependency
- Advantages: fast lookup, efficient storage of key-value pairs; Disadvantages: potential for collisions, higher memory usage
- Advantages: minimal collisions, constant-time lookups; Disadvantages: increased memory consumption, complexity of resizing
- Advantages: reduced search time, adaptable to varying data sizes; Disadvantages: collision handling complexity, potential performance degradation
Hash tables are efficient for storing strings due to their constant-time lookup, but handling collisions and managing memory can be challenging. Depending on the hashing algorithm used, performance can vary significantly.
How does the OSI Model assist in troubleshooting network issues?
- It facilitates communication between network devices for diagnosis.
- It offers standardized protocols for systematic diagnostics.
- It provides a structured approach to identify and isolate problems.
- The OSI Model defines clear boundaries for different network layers.
The OSI Model aids in troubleshooting by breaking down the network into distinct layers, allowing technicians to pinpoint where issues occur and enabling systematic problem-solving through standardized protocols and clear boundaries between layers.
___________ is a wireless networking standard designed for low-power, short-range communication between devices in the Internet of Things (IoT) ecosystem.
- Bluetooth Low Energy
- LoRaWAN
- Wi-Fi Direct
- Zigbee
Bluetooth Low Energy (BLE) is specifically designed for IoT applications, offering low power consumption and short-range communication capabilities suitable for connected devices.
Which Agile methodology emphasizes adaptability and customer collaboration over strict planning?
- PRINCE2
- Scrum
- Six Sigma
- Waterfall
Scrum is an Agile methodology that emphasizes adaptability and customer collaboration over strict planning. It encourages iterative development, frequent feedback, and a focus on delivering value to customers. Scrum teams are self-organizing and cross-functional, with a Scrum Master facilitating the process rather than dictating tasks. This approach promotes flexibility, continuous improvement, and customer satisfaction by responding to changing requirements throughout the development cycle.
How does Node.js handle clustering for scaling applications?
- Implements microservices architecture
- Utilizes Docker containers
- Utilizes load balancing
- Utilizes the cluster module
Node.js clustering allows applications to utilize multiple CPU cores efficiently by creating child processes (workers) using the cluster module. Each child process runs on a separate core, enabling parallel processing and improved performance. This approach is particularly effective for scaling applications across multiple cores without relying solely on the single-threaded nature of Node.js.
The _______ pattern is often used in RESTful APIs to provide access to related resources.
- Composite
- Composite Entity
- Facade
- Repository
The Repository pattern is commonly used in RESTful APIs to abstract the data access layer and provide a simplified interface for accessing related resources. It helps in organizing code and separating concerns by providing a centralized mechanism for handling database operations related to specific resources.
React's ___________ function enables developers to optimize performance by memoizing components.
- useCallback
- useEffect
- useMemo
- useState
The useMemo function in React enables developers to memoize components, which optimizes performance by caching the computed value of a function. This avoids unnecessary re-computations and enhances overall efficiency.
What is the purpose of a circular queue?
- Avoids the need for queue resizing
- Efficient use of limited memory
- Ensures elements are processed in a specific order
- Supports concurrent access to queue elements
The purpose of a circular queue is to avoid the need for resizing the queue when elements are added or removed. In a circular queue, elements are stored in a circular manner, allowing for efficient use of limited memory without the overhead of resizing operations. Additionally, a circular queue supports concurrent access to queue elements, making it suitable for scenarios where multiple processes or threads access the queue simultaneously.