In a weighted graph, a ___________ is a subset of the edges that connects all vertices together, without any cycles.
- Dijkstra's Algorithm
- Kruskal's Algorithm
- Minimum Spanning Tree
- Spanning Tree
A spanning tree is a subset of the edges of a graph that connects all vertices without any cycles. A minimum spanning tree is specifically the smallest such spanning tree, where the sum of the weights of its edges is minimized. Dijkstra's and Kruskal's algorithms are not specific to defining such subsets in a graph.
Code ___________ tools analyze code for potential issues and violations of coding standards.
- Coverage
- Profiling
- Review
- Static analysis
Static analysis tools analyze code without executing it, focusing on identifying potential issues, bugs, or violations of coding standards based on code structure, syntax, and patterns. These tools can flag issues such as unused variables, potential memory leaks, or violations of coding conventions like indentation, naming conventions, or code complexity thresholds. They are valuable in ensuring code quality, improving maintainability, and reducing the risk of introducing bugs or vulnerabilities during development. Profiling tools, on the other hand, focus on runtime behavior and performance metrics, coverage tools assess test coverage, and code review involves manual or automated inspection of code by peers or tools.
Which type of testing focuses on finding defects by executing the software?
- Dynamic testing
- Non-functional testing
- Static testing
- Structural testing
Dynamic testing involves executing the software to find defects or bugs. It includes techniques like unit testing, integration testing, system testing, and acceptance testing, where the software is actively run to check its behavior and functionality. This type of testing is essential for identifying issues that may arise during actual usage of the software.
In a real-time chat application, you need to implement a feature that notifies users when someone is typing a message. How would you accomplish this using JavaScript?
- Use AJAX polling to check typing status
- Use WebSocket to send typing status
- Use oninput event listener
- Use setTimeout and clearTimeout for delay
Using WebSocket allows real-time communication between clients and the server, making it ideal for notifying users when someone is typing. setTimeout and clearTimeout are more suitable for handling delays and timeouts, not real-time updates. AJAX polling introduces unnecessary overhead and delays. The oninput event listener is used for detecting input changes, not real-time status updates.
___________ is a divide and conquer sorting algorithm.
- Bubble Sort
- Insertion Sort
- Merge Sort
- Selection Sort
Merge sort is a classic example of a divide and conquer algorithm, where the sorting process involves dividing the array into smaller subarrays, sorting them individually, and then merging them back together in sorted order.
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.
The ___________ header is used to specify the format of the response accepted by the client.
- Accept-Encoding
- Content-Type
- User-Agent
- Authorization
The correct option is Content-Type. The Content-Type header in HTTP requests and responses specifies the media type of the data being sent or received. For example, it can indicate whether the data is in JSON, XML, HTML, or another format. This header helps the client and server understand how to handle the data appropriately.