___________ is a memory management scheme where physical memory is divided into fixed-sized blocks, and each process is assigned contiguous blocks.
- Fragmentation
- Paging
- Segmentation
- Swapping
Paging is a memory management scheme where physical memory is divided into fixed-sized blocks called frames, and logical memory is divided into fixed-sized blocks called pages. Each process is then assigned contiguous blocks of frames for its pages. Paging helps in efficient memory utilization and reduces external fragmentation.
What is the purpose of the GROUP BY clause in SQL queries?
- Aggregating data
- Filtering data
- Joining tables
- Sorting data
The purpose of the GROUP BY clause in SQL queries is to aggregate data based on specified columns. It is used in conjunction with aggregate functions such as COUNT, SUM, AVG, etc., to group rows that have the same values in specified columns. This allows for summarizing data and performing calculations on grouped data sets.
In a file system, the ___________ keeps track of free and allocated disk blocks.
- Allocation Table
- Directory Entry
- File Allocation Table
- File Descriptor
The File Allocation Table (FAT) is a crucial component in a file system that maintains a record of which disk blocks are free and which are allocated to files. It's commonly used in older file systems like FAT32.
What is the main difference between TCP and UDP in the TCP/IP protocol suite?
- Connection-oriented
- Datagram-based
- Error checking
- Reliable
The main difference between TCP and UDP in the TCP/IP protocol suite is that TCP is connection-oriented and ensures reliable data delivery with error checking, while UDP is datagram-based and lacks built-in error checking and reliability mechanisms.
Which HTTP methods are commonly used in RESTful APIs for CRUD operations?
- CREATE, READ, UPDATE, DELETE
- FETCH, INSERT, MODIFY, REMOVE
- GET, POST, PUT, DELETE
- RECEIVE, ADD, CHANGE, DELETE
CRUD operations in RESTful APIs correspond to HTTP methods: GET for READ, POST for CREATE, PUT for UPDATE, and DELETE for DELETE. These methods provide a standardized way to interact with resources over the web.
What is a race condition, and how does it relate to synchronization?
- Concurrency
- Data inconsistency
- Parallelism
- Thread safety
A race condition occurs in concurrent systems when the outcome of operations depends on the timing or interleaving of multiple threads. It leads to data inconsistency and unpredictable results. Synchronization mechanisms like mutexes and semaphores are used to prevent race conditions by ensuring that only one thread can access a shared resource at a time, thereby maintaining data integrity and thread safety.
What is a segmentation fault, and what can cause it in memory management?
- Accessing an invalid memory address
- Buffer overflow
- Incorrectly configured hardware
- Insufficient memory space
A segmentation fault occurs when a program attempts to access a memory address that is not within its allocated memory space. This can happen due to bugs in the program's code, such as accessing an uninitialized pointer or trying to write to read-only memory. Insufficient memory space or buffer overflows can indirectly lead to segmentation faults by causing memory corruption.
How does the Shortest Job First (SJF) scheduling algorithm minimize average waiting time?
- SJF executes processes based on their arrival time, ensuring timely completion and minimizing waiting times.
- SJF minimizes average waiting time by executing longer jobs before shorter ones, ensuring fair allocation of CPU time.
- SJF prioritizes shorter jobs over longer ones, allowing quick tasks to complete first, thus reducing the average waiting time for all processes.
- SJF selects processes randomly, leading to a balanced distribution of CPU time and reducing waiting times.
Shortest Job First (SJF) scheduling minimizes average waiting time by prioritizing shorter jobs, which reduces the overall waiting time for processes in the ready queue. This approach is effective in scenarios where smaller tasks can be completed quickly, leading to better system responsiveness and improved resource utilization. However, SJF may face challenges in predicting job lengths accurately, especially in dynamic workloads, requiring adaptations like Shortest Remaining Time First (SRTF) to handle varying job durations effectively.
The _________ layer of the OSI Model handles logical addressing and routing of data packets.
- Application
- Presentation
- Network
- Transport
The correct option is Network. The Network layer of the OSI Model is responsible for logical addressing and routing of data packets. It establishes paths for data to travel through the network based on logical addresses (like IP addresses) and determines the best route for data transmission. This layer also manages congestion control and error handling. The Application layer deals with user interfaces and application-level protocols, Presentation layer handles data formatting and encryption, and Transport layer ensures reliable data delivery.
The _________ time is the time taken for the scheduler to switch from one process to another.
- Context
- Execution
- Response
- Turnaround
Context Switch time is crucial in multitasking environments as it directly impacts system efficiency. It includes saving the state of the current process, loading the state of the next process, and updating necessary data structures.