_______ is a technique used to break a deadlock by preempting resources from one or more of the deadlocked processes.
- Resource Allocation
- Resource Management
- Resource Preemption
- Resource Sharing
Resource preemption involves forcefully taking resources from processes that are deadlocked to break the deadlock situation. This is a technique used in deadlock handling in operating systems.
Describe the working principle of demand paging in virtual memory management.
- Load entire process into memory at once
- Load pages into memory based on a fixed schedule
- Load pages into memory only when needed
- Rapid access to frequently used pages
Demand paging is a virtual memory management technique where pages are loaded into memory only when they are required, thus optimizing memory utilization. When a process is initiated, only essential pages are loaded initially. As the process executes and requires more pages, they are fetched from secondary storage. This approach minimizes initial load time and allows for more efficient use of available memory.
Which SQL clause is used to filter records based on a specified condition?
- GROUP BY
- ORDER BY
- SELECT
- WHERE
The WHERE clause is used in SQL to filter records based on specified conditions. It allows for conditional retrieval of data from a table, helping in narrowing down the results to meet specific criteria. Other clauses like ORDER BY and GROUP BY are used for sorting and grouping results, respectively.
In a scenario where multiple users are concurrently accessing and updating the same database records, how would you manage transactions to maintain consistency and isolation?
- Apply snapshot isolation
- Implement serializable transactions
- Use row-level locking
- Utilize versioning with timestamps
Managing concurrent database access
Imagine you're tasked with building an e-commerce platform using Node.js. How would you handle secure payment processing and data encryption to ensure customer data privacy?
- Implement OAuth for secure authorization and PCI DSS standards for payment processing.
- Integrate a payment gateway API with HTTPS and implement data encryption.
- Use Node.js crypto module for data encryption and HTTPS for secure communication.
- Utilize HTTPS for secure communication and third-party payment processor with PCI compliance.
Secure payment processing in Node.js involves integrating a trusted payment gateway API that supports HTTPS for encrypted communication. Additionally, implementing data encryption using libraries like Node.js crypto ensures sensitive data like credit card details are securely handled. Adhering to PCI DSS standards is crucial for e-commerce platforms to protect customer data privacy.
What is the primary purpose of a firewall in network security?
- Encrypting data
- Filtering incoming and outgoing traffic
- Managing hardware resources
- Monitoring network traffic
The primary purpose of a firewall in network security is to filter incoming and outgoing traffic based on predetermined security rules. It acts as a barrier between trusted internal networks and untrusted external networks, helping to prevent unauthorized access and protect sensitive data. Firewalls can be hardware-based or software-based.
The ___________ pattern in OOP allows objects to communicate without knowing each others classes.
- Singleton
- Observer
- Mediator
- Proxy
The correct option is Mediator. The Mediator pattern facilitates communication between objects by encapsulating the interaction logic in a mediator object. This promotes loose coupling and enhances maintainability.
What is the purpose of a router in a computer network?
- Connecting devices within a network
- Directing network traffic
- Facilitating wireless connections
- Filtering data packets
A router's primary purpose is to direct network traffic between different networks. It uses routing tables to determine the best path for data packets to reach their destination. This includes directing data between devices on the same network and between different networks, such as a local network and the internet. Routers also provide network address translation (NAT) to allow multiple devices on a network to share a single public IP address.
The _________ command is used to add new records to a table in SQL.
- DELETE
- INSERT
- SELECT
- UPDATE
The INSERT command is used in SQL to add new records (rows) to a table. It allows you to specify the values for each column in the new row or provide values for a subset of columns if the table allows NULL values or has default values defined.
In First Normal Form (1NF), each attribute value should be ___________.
- Atomic
- Composite
- Identical
- Unique
First Normal Form (1NF) requires that each attribute value within a table should be atomic or indivisible. This means that an attribute should not contain multiple values or be a composite of other attributes. Ensuring atomicity helps maintain data integrity and facilitates efficient data manipulation.