As of 2023, there are approximately 30 million cars in India.

As of 2023, there are approximately 30 million cars in India.
Approximately 5,000 to 10,000 liters of petrol.
Red
Weigh 3 apples against 3 apples. If they balance, the lighter apple is among the remaining 3. If they don't balance, take the lighter group of 3 and weigh 1 apple against 1 apple. If they balance, the lighter apple is the one not weighed. If they don't balance, the lighter side has the lighter apple.
Approximately 250,000 hair salons.
A remote repository is a version of your project that is hosted on a server, allowing multiple users to collaborate. You connect to a remote repository using Git commands like `git clone` to copy it to your local machine, or `git remote add <name> <url>` to link your local repository to the remote one.
To revert a pushed commit, use the command:
“`
git revert <commit-hash>
“`
This creates a new commit that undoes the changes made by the specified commit. After that, push the changes with:
“`
git push
“`
A commit in Git is a snapshot of changes made to the files in a repository. It contains the modified files, a unique identifier (hash), the author's information, a timestamp, and a commit message describing the changes.
To create and switch to a new branch in Git, use the command:
“`
git checkout -b <branch-name>
“`
Merge combines two branches by creating a new commit that includes changes from both, preserving the history of both branches. Rebase, on the other hand, moves or combines a sequence of commits to a new base commit, creating a linear history without a merge commit.
To monitor and alert on deployed applications, I would use tools like Prometheus for collecting metrics, Grafana for visualizing those metrics, and set up alerts based on specific thresholds. Additionally, I might use the ELK Stack for logging and searching logs, or Datadog/New Relic for comprehensive monitoring and alerting capabilities. Built-in cloud monitoring services can also be utilized for real-time insights and alerts.
Canary deployment is a strategy where a new version of software is released to a small group of users first, allowing for monitoring and testing before it is rolled out to the entire user base.
Declarative pipelines in Jenkins use a simplified syntax and are designed for ease of use, focusing on the overall structure of the pipeline. Scripted pipelines, on the other hand, use a more complex Groovy-based syntax, allowing for greater flexibility and control over the pipeline's behavior.
Rollback is the process of reverting to a previous stable version of software. In CI/CD, you handle it by using versioned artifacts, infrastructure as code, and automation to enable quick and reliable rollbacks when needed.
Infrastructure as Code (IaC) is a practice that allows you to define and manage your infrastructure using code. This means you can version, test, and deploy your infrastructure just like application code. In CI/CD, IaC fits in by enabling automated provisioning and management of infrastructure within the continuous integration and continuous deployment pipelines, ensuring consistency and reducing manual errors. Tools like Terraform and CloudFormation are commonly used for this purpose.
Jenkins is an open-source automation server used to automate the building, testing, and deployment of software. It helps developers integrate changes to their projects more easily and enables continuous delivery and continuous integration (CI/CD) practices.
Key features of Jenkins include:
1. **Continuous Integration/Continuous Deployment (CI/CD)**: Automates the integration and deployment of code changes.
2. **Plugins**: Supports a wide range of plugins to extend functionality.
3. **Pipeline as Code**: Allows defining build pipelines using code (Jenkinsfile).
4. **Distributed Builds**: Supports running builds on multiple machines for scalability.
5. **Easy Installation and Configuration**: Simple setup process and user-friendly interface.
6. **Extensive Community Support**: Large community and extensive documentation.
7. **Integration with Version Control Systems**: Works with Git, SVN, and other VCS.
8. **Monitoring and Reporting**: Provides real-time feedback and build status notifications.
To integrate Jenkins with Git, you need to:
1. Install the Git plugin in Jenkins.
2. Create a new Jenkins job or configure an existing one.
3. In the job configuration, select "Git" as the source code management option.
4. Enter the repository URL and credentials if required.
5. Set up the branch to build and any additional options.
6. Configure build triggers, such as polling the repository or using webhooks.
7. Save the configuration and run the job to test the integration.
In Jenkins, you can handle parameters in builds by using "Parameterized Builds." You can define parameters in the job configuration under the "This project is parameterized" option. You can use different types of parameters like String, Boolean, Choice, etc. Then, you can access these parameters in your build scripts using the syntax `${PARAMETER_NAME}`.
I faced an issue where Jenkins builds were failing due to a lack of available disk space on the server. To resolve it, I implemented a cleanup strategy by configuring the "Discard Old Builds" option in the job settings to automatically delete older builds after a certain number of days. Additionally, I set up a periodic job to clean up workspace directories and unused artifacts. This freed up space and stabilized the build process.