Git Foundations: Easy Interview Quiz Quiz

  1. Understanding Version Control

    Which of the following best describes Git?

    1. A free and open-source distributed version control system designed for tracking code changes.
    2. A cloud storage service for saving files online.
    3. A word processing software for drafting documents.
    4. A programming language for developing web applications.
    5. A database management system for organizing data.
  2. Git's Core Language

    Git is primarily written in which programming language, enabling its speed and efficiency?

    1. Python
    2. Java
    3. C
    4. Ruby
    5. CSS
  3. Understanding Repositories

    In Git, what is a repository (repo)?

    1. A location for storing code versions and their history.
    2. A folder that only contains backups of documents.
    3. A cloud server running test scripts.
    4. A collection of unrelated project files.
    5. A command used to search code.
  4. Bare Repository Concept

    What is true about a bare repository in Git?

    1. It contains only Git metadata and no working directory.
    2. It is a type of repository with extra features for beginners.
    3. It has only the files currently being worked on.
    4. It automatically merges new code from the internet.
    5. It is a temporary storage for secret files.
  5. Purpose of 'git stash'

    If a developer runs 'git stash', what happens to their uncommitted changes?

    1. The changes are deleted permanently.
    2. The changes are committed to the repository.
    3. The changes are saved temporarily without committing.
    4. The changes are merged with another branch.
    5. The changes are ignored by Git forever.
  6. Managing Stashes

    What does the command 'git stash drop' accomplish?

    1. It permanently adds a new stash entry.
    2. It removes the most recent stash entry from the list.
    3. It restores all stashed changes to the working directory.
    4. It commits all stashed files immediately.
    5. It changes the current branch to the stash branch.
  7. Git Collaboration Basics

    What is the main function of the 'git push' command?

    1. To pull new changes from a remote repository.
    2. To delete a file from the repository.
    3. To upload committed changes to a remote repository.
    4. To stash changes without committing.
    5. To merge two branches into one.
  8. Branching Advantage

    Why is branching considered important when using Git? For example, a team wants to build a new feature without changing the main code.

    1. It allows developers to work independently on different features.
    2. It only lets one developer work at a time.
    3. It copies the repository to another developer’s machine.
    4. It deletes unfinished work automatically.
    5. It saves backups to the cloud every hour.
  9. Configuring User Information

    Which command allows users to set their name and email for every commit made with Git?

    1. git commit
    2. git add
    3. git config
    4. git merge
    5. git rename
  10. Staging Area Role

    What is the function of the staging area (Index) in Git?

    1. A place to review and format changes before committing them.
    2. A backup server for deleted files.
    3. A folder that holds only images and documents.
    4. A temporary area for running programs.
    5. A tool for searching code for errors.