When is dynamic programming preferable over greedy algorithms?

  • Problems with constant time complexity
  • Problems with large input sizes
  • Problems with no overlapping subproblems
  • Problems with optimal substructure
Dynamic programming is preferable over greedy algorithms when the problem exhibits optimal substructure, meaning the solution to the overall problem can be constructed from solutions to its subproblems. Greedy algorithms, on the other hand, make locally optimal choices at each step, which may not always lead to a globally optimal solution.

Which layer of the OSI Model is responsible for establishing, maintaining, and terminating connections between devices?

  • Session Layer
  • Transport Layer
  • Application Layer
  • Data Link Layer
The Transport Layer (Layer 4) of the OSI Model is responsible for establishing, maintaining, and terminating connections between devices. It ensures reliable data delivery, error detection and correction, flow control, and end-to-end communication. This layer manages the segmentation and reassembly of data, providing mechanisms for both connection-oriented (TCP) and connectionless (UDP) communication. Option 2 is correct because the Transport Layer handles connection-related tasks in the OSI Model.

In a large enterprise application, there's a need to integrate legacy code with modern systems. How could the Adapter design pattern be applied to facilitate this integration?

  • Observer
  • Singleton
  • Strategy
  • The Adapter pattern could be used to create a wrapper around the legacy code, allowing it to work with the interfaces expected by the modern systems. This way, the legacy code can seamlessly integrate into the larger application without needing extensive modifications or rewrites.
The Adapter pattern is well-suited for integrating legacy code with modern systems by providing a bridge between incompatible interfaces. It allows the legacy code to be used as-is while adapting its interface to match the requirements of the new system, thus promoting interoperability and system extensibility.

You're developing a system where user input needs to be validated against a predefined list of acceptable values. How would you use arrays or strings to handle this validation effectively?

  • Apply binary search on a sorted list
  • Implement a lookup table
  • Use a switch-case statement
  • Utilize regular expressions
A lookup table provides efficient validation against predefined values, improving system robustness.

What is the main advantage of a singly linked list over an array?

  • Contiguous Memory
  • Dynamic Size
  • Faster Access
  • Random Access
The main advantage of a singly linked list over an array is dynamic size. Unlike arrays, where the size is fixed once allocated, singly linked lists can grow or shrink dynamically by adding or removing nodes.

Layer of the OSI model.

  • Application Layer
  • Data Link Layer
  • Network Layer
  • Transport Layer
HTTP (Hypertext Transfer Protocol) operates at the Application Layer of the OSI model, facilitating communication between a web server and a client. This layer deals with user interfaces and data transfer protocols.

Agile teams often use _________ charts to visualize progress and identify potential bottlenecks.

  • Burnup
  • Gantt
  • Pie
  • Scatter
Agile teams commonly use Burnup charts to visualize progress and identify potential bottlenecks. Burnup charts display the total work (usually represented in story points) planned for a sprint or release over time, alongside the actual work completed. This visual representation helps teams track their progress, assess whether they are on track to meet their goals, and identify any scope changes or bottlenecks that may arise during development. Pie charts are typically used to represent data in parts of a whole, such as percentages of completion, but they are not commonly used for tracking Agile project progress. Scatter charts are used to show relationships between different variables but are not specific to Agile progress tracking. Gantt charts, while useful for project planning and scheduling, may not be as effective for Agile teams in visualizing progress and identifying bottlenecks compared to Burnup charts. Therefore, Burnup charts are the preferred choice for Agile progress visualization.

In a team project, there's a debate between using React and Angular for the frontend. How would you evaluate the project requirements to determine the most suitable framework?

  • Assess factors such as project complexity, team expertise, community support, and scalability requirements
  • Choose React for faster development and Angular for better performance
  • Opt for Angular due to its popularity among enterprises
  • Select React for smaller codebase and Angular for easier debugging
Evaluating project requirements involves considering factors like complexity, team skills, community support, and scalability needs. React may be favored for quicker development, while Angular could be chosen for its robust performance.

What are the key features of a Secure Sockets Layer (SSL) certificate?

  • Authentication
  • Authorization
  • Encryption
  • Secure data transmission
SSL certificates provide authentication, ensuring the identity of the website or server to users. They also enable encryption, securing data transmission between the user's browser and the server. Additionally, SSL certificates validate the integrity of data, preventing unauthorized tampering.

The B+ tree is commonly used for _______ indexing.

  • Hierarchical
  • Hash
  • Relational
  • Multilevel
B+ trees are primarily utilized in relational databases for indexing. They are efficient for range queries and allow for faster retrieval of data due to their balanced structure. This makes option 3, "Relational," the correct choice.