Which command is used to create a new branch in Git?
- git add
- git branch
- git checkout -b
- git commit -m
The command git checkout -b is used to create a new branch in Git. This command creates a new branch with the specified name and switches to it, allowing developers to start working on a new feature or bug fix.
Which SDLC model is known for its linear sequential flow of phases?
- Agile Model
- Spiral Model
- V-Model
- Waterfall Model
The Waterfall Model is known for its linear sequential flow of phases. In this model, each phase must be completed before the next one begins, making it a straightforward and easy-to-understand approach. However, it may lack flexibility compared to other models.
Which caching strategy is suitable for reducing database load and improving response times for frequently accessed data?
- Browser Caching
- Content Delivery Network (CDN) Caching
- Database Caching
- Object Caching
Database Caching is a caching strategy suitable for reducing database load and improving response times for frequently accessed data. It involves storing query results or data in memory to avoid repeated database queries for the same data.
In RESTful APIs, _______ is a mechanism used to control access to resources.
- Authentication
- Authorization
- Decryption
- Encryption
In RESTful APIs, Authorization is a mechanism used to control access to resources. It determines whether the authenticated user has the necessary permissions to perform a particular action on a resource.
A stored procedure is _______ in a relational database, which can be executed by invoking its name.
- a precompiled collection of one or more SQL statements
- a temporary table
- a trigger
- an index
A stored procedure in a relational database is a precompiled collection of one or more SQL statements. It is stored as a database object and can be executed by invoking its name.
Imagine a scenario where two users are trying to update the same record in a database concurrently. Describe the potential issues that may arise and propose a concurrency control strategy to address them.
- Issues: Deadlocks, Race Conditions
- Issues: Lost Updates, Inconsistent Data
- Strategy: Apply Pessimistic Locking
- Strategy: Use Timestamps for Versioning
Concurrent updates on the same database record may lead to issues such as lost updates and inconsistent data. Using timestamps for versioning is a strategy to address this, allowing the system to track and compare versions to ensure updates occur in a controlled and consistent manner, reducing conflicts.
In SQL, the ALTER TABLE command is used to _______ an existing database table.
- Add
- Delete
- Modify
- Update
The ALTER TABLE command in SQL is used to modify an existing database table. It allows you to add, delete, or modify columns and constraints of a table.
The "Application" tab in Browser Developer Tools is used for managing _______.
- Application-related resources
- Code syntax
- Memory and storage
- Network requests
The "Application" tab in Browser Developer Tools is used for managing application-related resources. It includes features for working with local storage, session storage, cookies, and other application-specific data.
Materialized views are often employed in query optimization to store _______.
- Aggregated data
- Intermediary results
- Precomputed results
- Temporary data
Materialized views in query optimization are used to store precomputed results. This involves storing the output of a query in a physical table, which can significantly improve the performance of complex queries by reducing the need for repeated computations.
You're designing a software system where you need to model different types of vehicles. Explain how you would utilize OOP concepts such as inheritance and polymorphism in this scenario.
- Abstraction for code reuse and Inheritance for encapsulation
- Encapsulation for security and Abstraction for complexity
- Inheritance for code reuse and Polymorphism for flexibility
- Polymorphism for security and Inheritance for flexibility
In this scenario, Inheritance can be used to model the common attributes of vehicles in a base class, and Polymorphism allows you to use a single interface for various types of vehicles, enabling flexibility and maintainability.