Explain the role of the Transport layer in the OSI Model.

  • Ensuring error-free delivery of data packets
  • Establishing a connection between devices
  • Providing logical addressing for devices
  • Segmenting and reassembling data packets
The Transport layer in the OSI Model is responsible for segmenting and reassembling data packets to ensure reliable and efficient communication between end systems. It also handles flow control, error checking, and data integrity to guarantee that information is delivered accurately.

Discuss the pros and cons of using server-side rendering (SSR) with React and Angular.

  • Angular SSR may have a steeper learning curve due to Angular's more extensive framework and setup requirements.
  • Angular SSR provides similar benefits, rendering pages on the server for faster initial loading and improved search engine visibility.
  • SSR with React can be complex to set up and may require additional server resources for rendering.
  • Server-side rendering (SSR) in React improves initial load times and enables better SEO by serving pre-rendered content.
Server-side rendering (SSR) offers advantages like improved performance and SEO, but it also comes with challenges such as setup complexity and resource requirements. Both React and Angular support SSR, and developers must weigh the pros and cons carefully based on project requirements and their team's expertise to decide whether to implement SSR in their applications.

What is the difference between functional dependency and transitive dependency in database normalization?

  • A functional dependency is a relationship between two attributes in which one attribute uniquely determines another.
  • A transitive dependency occurs when one non-key attribute determines another non-key attribute.
  • Functional dependency involves a direct relationship between attributes, while transitive dependency involves an indirect relationship.
  • Functional dependency involves a relationship between a key attribute and a non-key attribute.
Functional dependency and transitive dependency are fundamental concepts in database normalization. Functional dependency refers to a situation where the value of one attribute uniquely determines the value of another attribute in a database table. For example, in a table of employees, if the employee ID uniquely determines the employee's email address, we say there is a functional dependency between ID and email. Transitive dependency, on the other hand, occurs when a non-key attribute determines another non-key attribute. For instance, if in the same employee table, the department name is determined by the manager's name, which in turn is determined by the employee ID, then we have a transitive dependency. The goal of normalization is to minimize or eliminate such dependencies to ensure data integrity and reduce redundancy.

What are SQL injection attacks, and how can they be prevented in SQL queries?

  • Encrypt database connections
  • Exploits vulnerabilities in SQL queries to manipulate the database
  • Sanitize input data
  • Use stored procedures
SQL injection attacks occur when malicious code is inserted into SQL statements, exploiting vulnerabilities to manipulate the database. To prevent SQL injection, input data should be sanitized to remove any malicious code. Using stored procedures and encrypting database connections also enhance security but may not directly prevent SQL injection attacks.

Your company is planning to migrate its on-premises infrastructure to the cloud. How would you decide between using virtual machines or containers for this migration?

  • Legacy application compatibility and deployment complexity
  • Operating system dependencies and resource utilization
  • Persistent storage requirements and security concerns
  • Scalability and isolation
When deciding between virtual machines (VMs) and containers for cloud migration, factors such as operating system dependencies and resource utilization play a crucial role. Virtual machines offer strong isolation and can run multiple operating systems, making them suitable for legacy applications with diverse OS requirements. Containers, on the other hand, are lightweight and share the host OS, leading to better resource utilization but may face challenges with legacy applications and persistent storage needs. Hence, understanding the specific needs of the applications in terms of OS dependencies and resource utilization is key to making an informed decision.

Describe a real-world scenario where the use of a stack or queue is appropriate.

  • Managing a list of logged-in users in a chat application.
  • Managing a queue of requests in a web server.
  • Managing the priority of tasks in an operating system.
  • Managing undo operations in a text editor.
Stacks and queues find numerous real-world applications. For instance, in a text editor, a stack can be used to implement undo operations efficiently. Similarly, a queue can manage requests in a web server, ensuring fair handling based on arrival order.

Discuss the importance of the "D" in ACID properties and its implications in database management systems.

  • Data Consistency
  • Data Durability
  • Data Integrity
  • Data Isolation
The "D" in ACID stands for Durability, which ensures that once a transaction is committed, it will persist even in the face of system failures such as power outages or crashes. This is crucial for maintaining the reliability and resilience of a database system, as it guarantees that data modifications made by transactions are permanent and will not be lost due to unforeseen circumstances. Without durability, data could be lost or corrupted, leading to inconsistencies and potential data loss. Therefore, the importance of durability in ACID properties cannot be overstated, as it forms the backbone of data persistence and reliability in database management systems.

What is Cross-Origin Resource Sharing (CORS) and how does it enhance web security?

  • Cross-Origin Resource Sharing (CORS) allows web servers to bypass browser restrictions on cross-origin requests, which enhances web security by preventing unauthorized access to resources across different domains.
  • Cross-Origin Resource Sharing (CORS) allows web servers to specify which origins are allowed to access their resources, thus preventing malicious websites from accessing sensitive data.
  • Cross-Origin Resource Sharing (CORS) enables browsers to make requests to other domains, but only if the server provides the necessary permissions, reducing the risk of unauthorized access and protecting sensitive information.
  • Cross-Origin Resource Sharing (CORS) is a security feature that restricts web browsers from loading resources from different domains unless the server explicitly allows it, preventing malicious attacks such as cross-site scripting (XSS) and cross-site request forgery (CSRF).
Cross-Origin Resource Sharing (CORS) is a crucial security mechanism that prevents malicious websites from accessing resources across different domains. By allowing servers to specify which origins can access their resources, CORS helps mitigate risks associated with cross-domain requests, such as cross-site scripting (XSS) and cross-site request forgery (CSRF). It enhances web security by enforcing browser restrictions and ensuring that only authorized domains can interact with sensitive data.

_______ 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.