What is caching in web development?

  • Compressing images in a web application
  • Defining the layout of a webpage
  • Encrypting data for security
  • Storing frequently used data temporarily
Caching in web development refers to storing frequently used data temporarily. It helps improve performance by reducing the need to fetch the same data repeatedly from the server.

TDD promotes writing _______ that fail before writing new code to pass them.

  • Comments
  • Documentation
  • Requirements
  • Tests
Test-Driven Development (TDD) promotes writing tests that fail before writing new code to pass them. This iterative approach ensures that each new piece of code is validated against predefined test cases, contributing to a more robust and reliable codebase.

Explain a real-world scenario where the use of ACID properties in a database transaction is critical to ensuring data integrity.

  • Blog Comments
  • Logging Inventory Changes
  • Online Banking Transactions
  • User Authentication
In online banking transactions, the use of ACID properties (Atomicity, Consistency, Isolation, Durability) is critical to ensure the integrity of financial data. A failed transaction could lead to inconsistencies in the user's account balance, emphasizing the need for transactional reliability.

The indexOf() method in JavaScript returns the position of the first occurrence of a specified _______ within a string.

  • Character
  • Element
  • Substring
  • Value
The indexOf() method returns the position of the first occurrence of a specified character within a string. It helps in finding the index of a particular character or substring.

What is the purpose of "git cherry-pick"?

  • Applying a specific commit to another branch
  • Creating a new branch from the latest commit
  • Merging two branches with conflicting changes
  • Reverting all changes in the working directory
The purpose of "git cherry-pick" is to apply a specific commit from one branch to another. It allows developers to select and incorporate individual commits into a different branch, facilitating the selective integration of changes.

In monitoring systems, _______ metrics provide insights into the health and performance of individual system components.

  • Component-level
  • Infrastructure
  • Performance
  • System-wide
In monitoring systems, component-level metrics provide insights into the health and performance of individual system components. These metrics help identify bottlenecks or issues at the granular level, aiding in efficient troubleshooting and optimization.

You accidentally delete a file in your Git repository. What command would you use to restore the file from a previous commit?

  • git checkout -- file-path
  • git reset --hard HEAD~1
  • git restore --source= --staged --worktree file-path
  • git revert
The correct command is git restore --source= --staged --worktree file-path where you restore the file from a specific commit using the restore command.

How does Git mark merge conflicts in the affected files?

  • Adding a "Conflict" label to conflicted lines
  • Appending "-conflict" to file names
  • Creating a separate conflicted branch
  • Using special conflict markers (<<<<<<<, =======, >>>>>>>)
Git marks merge conflicts in the affected files using special conflict markers like <<<<<<<, =======, and >>>>>>>. These markers indicate the conflicting sections that need manual resolution.

When resolving conflicts in Git, the modified files must be _______ before committing.

  • Committed
  • Merged
  • Reverted
  • Staged
When resolving conflicts in Git, the modified files must be staged (using "git add") after resolving the conflict but before committing the changes. Staging indicates that the conflicts have been addressed and are ready to be included in the next commit.

You're designing a high-traffic e-commerce website. What caching strategies would you implement to ensure optimal performance during peak times?

  • Browser caching for static assets
  • Content Delivery Network (CDN) caching
  • Database caching
  • In-memory caching with tools like Redis
In high-traffic e-commerce websites, in-memory caching with tools like Redis is crucial. It helps store frequently accessed data in memory, reducing the need to query the database repeatedly, and thus improving performance during peak times.