In database management, what is cardinality, and how does it impact query optimization?

  • The number of rows in a table
  • The relationship between tables
  • The size of the database
  • The uniqueness of values in a column
Cardinality in database management refers to the relationship between tables. It impacts query optimization by influencing the choice of join algorithms and the order in which tables are accessed, crucial for performance.

You encounter a bug in your codebase. How would you use TDD principles to fix it and prevent similar issues in the future?

  • Fix the bug directly without writing tests
  • Ignore the bug and focus on adding new features
  • Write a failing test that reproduces the bug, fix the bug, and ensure the test passes
  • Write tests for unrelated features to cover more code paths
Using TDD to fix a bug involves writing a failing test that reproduces the issue, then fixing the bug to make the test pass. This ensures that the bug is addressed and helps prevent regressions by having a test in place.

In a project, you have a table with millions of records, and your queries are taking too long to execute. What strategies would you employ to optimize the performance of the database?

  • Indexing and Query Optimization
  • Denormalization and Partitioning
  • Caching and Replication
  • Sharding and Vertical Scaling
To optimize the performance of a database with millions of records, strategies such as indexing, query optimization, denormalization, partitioning, caching, and replication can be employed. The correct option focuses on indexing and query optimization.

Which HTTP method is typically used for creating a new resource in a RESTful API?

  • DELETE
  • GET
  • POST
  • PUT
The HTTP method used for creating a new resource in a RESTful API is POST. It submits data to be processed to a specified resource.

Which front-end framework is known for its extensive ecosystem and strong community support?

  • Angular
  • React
  • Svelte
  • Vue.js
React is a front-end framework known for its extensive ecosystem and strong community support. It is widely used for building user interfaces and offers a declarative approach to programming.

What is the role of a session cookie in web authentication?

  • A session cookie stores user-specific information on the server to maintain stateful communication between the client and the server during a user's session.
  • Session cookies are not related to web authentication.
  • Session cookies are used for long-term storage of user credentials on the client side.
  • Session cookies provide authentication by storing user credentials in a public directory.
Session cookies play a crucial role in web authentication by maintaining user state on the server. They store information for a session, allowing seamless communication between the client and server.

What does SQL stand for?

  • Sequential Query Language
  • Simple Query Language
  • Standard Query Language
  • Structured Query Language
SQL stands for Structured Query Language. It is a domain-specific language used for managing and manipulating relational databases.

Infrastructure as Code allows infrastructure to be managed using _______.

  • Automation
  • Code
  • Configuration
  • Scripts
Infrastructure as Code (IaC) allows infrastructure to be managed using scripts. These scripts define the desired state of the infrastructure, enabling automated provisioning and configuration.

Python's extensive standard library and simplicity make it an ideal choice for _______ development.

  • Data Science
  • Game
  • Mobile
  • Web
Python's extensive standard library and simplicity make it an ideal choice for Data Science development. Python has rich libraries for data manipulation and analysis.

How does Git handle conflicts when merging two branches with changes to the same line of code?

  • Automatic Merge
  • Branch Deactivation
  • Manual Resolution
  • Priority Given to Latest Commit
Git handles conflicts by marking them, and it's the developer's responsibility to resolve them manually. This ensures that the developer reviews and approves the changes, preventing unintended modifications.