<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vasanth Kumar on Medium]]></title>
        <description><![CDATA[Stories by Vasanth Kumar on Medium]]></description>
        <link>https://medium.com/@vasanthgk02?source=rss-bb02bc9037a6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*07cYCih_1w7HqWmmlj1uwg.jpeg</url>
            <title>Stories by Vasanth Kumar on Medium</title>
            <link>https://medium.com/@vasanthgk02?source=rss-bb02bc9037a6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:21:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vasanthgk02/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Download EKS Cluster YAML Files Across All Clusters | AWS]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">Use the below script to download eks cluster yaml files across all the clusters.
NOTE: Make sure profile name matches your AWS IAM role&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@vasanthgk02/download-eks-cluster-yaml-files-across-all-clusters-aws-25cd428ca274?source=rss-bb02bc9037a6------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@vasanthgk02/download-eks-cluster-yaml-files-across-all-clusters-aws-25cd428ca274?source=rss-bb02bc9037a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/25cd428ca274</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws-eks]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Vasanth Kumar]]></dc:creator>
            <pubDate>Fri, 01 Aug 2025 06:17:30 GMT</pubDate>
            <atom:updated>2025-08-01T06:17:30.162Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Merge Commits in a Pull Request (PR) Into a Single Commit in BitBucket/Git version control?]]></title>
            <link>https://medium.com/@vasanthgk02/how-to-merge-commits-in-a-pull-request-pr-into-a-single-commit-in-bitbucket-git-version-control-63b2e61805e0?source=rss-bb02bc9037a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/63b2e61805e0</guid>
            <category><![CDATA[merge]]></category>
            <category><![CDATA[commit]]></category>
            <category><![CDATA[bitbucket]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Vasanth Kumar]]></dc:creator>
            <pubDate>Fri, 20 Sep 2024 06:11:54 GMT</pubDate>
            <atom:updated>2024-09-20T06:11:54.405Z</atom:updated>
            <content:encoded><![CDATA[<p>When you’re working on a feature or bug fix, it’s common to have multiple commits in a pull request (PR) that track incremental changes. However, before merging your PR, you may want to clean up the commit history and combine all those commits into a single, tidy commit.</p><p>This can make your Git history much more readable and easier to maintain, particularly in large collaborative projects where every commit is closely scrutinized. In this article, we’ll walk through how you can merge multiple commits in a PR into one single commit using Git.</p><h4>Why Merge Commits?</h4><p>Having a clean Git history is important for several reasons:</p><ul><li><strong>Simplicity</strong>: It prevents unnecessary clutter in the commit history.</li><li><strong>Atomic Commits</strong>: A single commit encapsulating an entire feature or bug fix is easier to understand.</li><li><strong>Clean PR Merges</strong>: If you squash your commits before merging a PR, the project’s main branch remains free of small, incremental changes.</li></ul><p>Now, let’s see how you can merge your commits into one.</p><h3>Step-by-Step Guide to Merging Commits in a PR</h3><p>Imagine you have a PR with several commits, and now you want to combine them into one. The following steps will show you how to do this using Git’s reset and commit commands.</p><h4>1. Move the HEAD Back Without Losing Changes</h4><p>The first step is to move HEAD back by the number of commits you want to merge. This will undo the commits but keep the changes in place.</p><pre>git reset --soft HEAD~3</pre><p>In this example:</p><ul><li>HEAD~3 means you want to go back 3 commits from the current HEAD. In your case go back to the base branch or how many commits you want to go back.</li><li>The --soft flag ensures that all the changes from the last 3 commits are kept in the staging area (index). It doesn’t touch your working directory, so the file changes from those commits remain intact.</li></ul><h4>2. Create a New Commit With a Unified Message</h4><p>Now that your last 3 commits have been undone but your changes remain staged, you can create a new commit that consolidates those changes:</p><pre>git commit -m &quot;Your new commit message&quot;</pre><p>This command creates a new single commit that represents the changes from all the previous commits.</p><h4>3. Push the New Commit to the Remote Branch</h4><p>After creating the single new commit, the next step is to push it to the remote branch where your PR is located.</p><p>However, since this changes the commit history (removing and adding a new commit), you’ll need to force-push it to overwrite the branch on the remote:</p><pre>git push --force origin &lt;remote-branch-name&gt;</pre><p>The --force flag ensures that the remote branch is updated with the new commit history, effectively replacing the original series of commits with the new, single commit.</p><h3>Effect on the Pull Request</h3><p>Once you force-push your changes to the remote branch, the pull request associated with that branch will reflect the new, squashed commit. The multiple commits that were originally part of the PR will now appear as a single, unified commit.</p><p>This method allows you to clean up your PR and present a cohesive set of changes to reviewers.</p><h4>Important Considerations</h4><ul><li><strong>Rewriting history</strong>: The git reset --soft and git push --force commands rewrite the commit history. Be cautious when using this, especially if your branch is shared with others.</li><li><strong>Communication</strong>: If you’re working on a team, make sure everyone knows about your intent to force-push to avoid disrupting their work.</li></ul><h3>Conclusion</h3><p>Merging multiple commits into a single commit is an excellent way to keep your Git history clean and organized, especially when preparing to merge a PR. The combination of git reset --soft, git commit, and git push --force gives you the flexibility to craft a single, meaningful commit that represents the entire work of your pull request.</p><p>By keeping your Git history clean, you help maintainers and collaborators understand the development process more easily, making the project easier to maintain in the long run.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63b2e61805e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Zoho Off-campus Interview Experience — March 2024]]></title>
            <link>https://medium.com/@vasanthgk02/my-zoho-off-campus-interview-experience-march-2024-cb104235dd40?source=rss-bb02bc9037a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb104235dd40</guid>
            <category><![CDATA[zoho]]></category>
            <category><![CDATA[interview-experience]]></category>
            <category><![CDATA[vasanthgk02]]></category>
            <dc:creator><![CDATA[Vasanth Kumar]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 09:18:23 GMT</pubDate>
            <atom:updated>2025-06-04T16:02:07.955Z</atom:updated>
            <content:encoded><![CDATA[<h3>My Zoho Off-campus Interview Experience — March 2024</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*uPv2pr6Mk8h2L4H2AEyAGw.png" /></figure><p>Hi everyone, I’m Vasanth, and I recently had the opportunity to participate in Zoho’s off-campus drive in March 2024. I’d like to share my experience and provide insights into the interview process and the questions asked.</p><p>Understanding the Zoho Interview Process:</p><p>The Zoho interview process consists of four rounds:</p><ol><li>Aptitude Round: This round comprises 20 questions, including 10 “Guess the output” programming questions and 10 quantitative aptitude questions.</li><li>Short Coding Round: Candidates are given five coding questions to solve. The minimum cutoff may vary but in my case, it was to solve a minimum of four questions. This round is conducted in batches and monitored by Zoho employees.</li><li>Long Coding Round: Here, candidates may be asked to design an application and write the code, or solve algorithm and data structure (DSA) questions. I encountered DSA questions tagged as the hardest of medium problems.</li><li>HR Round: The final round involves discussions on educational background, family background, expectations from Zoho, and alternative plans if not selected.</li></ol><p>My Experience:</p><ul><li>Aptitude Round: I managed to solve 9 out of 10 programming questions and 6 out of 10 quantitative questions, which helped me proceed to the next round.</li><li>Short Coding Round: I successfully solved 4 out of 5 problems, meeting the cutoff criteria for this round.</li><li>Long Coding Round: In this one-on-one round, I faced three DSA problems. Additionally, I was asked about my projects and requested to show code from GitHub.</li><li>HR Round: The HR round covered general questions about my background, educational journey, family, reasons for choosing Zoho, and alternative career plans.</li></ul><p>DSA Problems Asked in Zoho:</p><p><em>Short Coding:</em></p><ol><li>Program to generate all possible valid IP addresses from a given string.</li><li>Reverse a specific range in a linked list with dynamic memory allocation.</li><li>Program to check whether a string is a palindrome.</li><li>Text justification.</li><li>Reading and writing data to a file with mathematical calculations.</li></ol><p><em>Long Coding:</em></p><ol><li>Remove consecutive same characters from a string.</li><li>Find the maximum value you can obtain from an array without selecting consecutive elements.</li><li>Analyzing the Fibonacci sequence space and time complexity. They expected to go from brute force to optimal dp solution.</li></ol><p>Conclusion:</p><p>I am thrilled to share that I got selected in Zoho for Member of Technical Staff. Overall, the interview process was smooth yet challenging, allowing me to showcase my skills and problem-solving abilities.</p><p>If you’re preparing for interviews, I hope my experience provides some valuable insights. Good luck on your journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb104235dd40" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Handy Commands]]></title>
            <link>https://medium.com/@vasanthgk02/kubernetes-handy-commands-f8500903d1e3?source=rss-bb02bc9037a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8500903d1e3</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[vasanthgk02]]></category>
            <category><![CDATA[commands]]></category>
            <dc:creator><![CDATA[Vasanth Kumar]]></dc:creator>
            <pubDate>Wed, 31 Jan 2024 06:57:49 GMT</pubDate>
            <atom:updated>2024-01-31T06:57:49.056Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5GMlbO0fKuuFzo66jqujQ.png" /></figure><p>In this article, I have listed beginner friendly kuberneted commands which will be handy.</p><p><strong>Run pod</strong></p><blockquote>kubectl run &lt;pod_name&gt;=&lt;image_name&gt;</blockquote><p>The image name should be same as docker image name.</p><p><strong>Get configuration of pod</strong></p><blockquote>kubectl run &lt;pod_name&gt;=&lt;image_name&gt; — dry-run=client -o yaml &gt; pod_name.yml</blockquote><p><strong>List pods</strong></p><blockquote>kubectl get pods</blockquote><blockquote>kubectl get pods -o</blockquote><p><strong>Describe pod</strong></p><blockquote>kubectl describe pod &lt;pod_name&gt;</blockquote><p><strong>Create pod from yaml file</strong></p><blockquote>kubectl create -f pod pod_name.yml</blockquote><p><strong>Apply changes through yaml file</strong></p><blockquote>kubectl apply -f pod pod_name.yml</blockquote><p><strong>Delete pod</strong></p><blockquote>kubectl delete pod &lt;pod-name&gt;</blockquote><p><strong>Get list of replicasets</strong></p><blockquote>kubectl get replicasets</blockquote><p><strong>Describe replicaset</strong></p><blockquote>kubectl describe replicaset &lt;replicaset-name&gt;</blockquote><p><strong>Edit replicaset</strong></p><blockquote>kubectl edit replicaset &lt;replicaset-name&gt;</blockquote><p><strong>Get pods, deployment and replicasets</strong></p><blockquote>Kubectl get all</blockquote><p><strong>Rollout Commands</strong></p><blockquote>Kubectl rollout status deployment/&lt;deployment-name&gt; — record</blockquote><blockquote>Kubectl rollout history deployment/&lt;deployment-name&gt;</blockquote><blockquote>Kubectl rollout undo deployment/&lt;deployment-name&gt;</blockquote><blockquote>If you find this article helpful, follow me for more useful things!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8500903d1e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Handy Commands]]></title>
            <link>https://medium.com/@vasanthgk02/docker-handy-commands-70fd98c509c7?source=rss-bb02bc9037a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/70fd98c509c7</guid>
            <category><![CDATA[commands]]></category>
            <category><![CDATA[vasanthgk02]]></category>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Vasanth Kumar]]></dc:creator>
            <pubDate>Wed, 31 Jan 2024 06:19:15 GMT</pubDate>
            <atom:updated>2024-01-31T06:20:57.260Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*sWmr1Qzj8BJVzkinCU1fHQ.png" /><figcaption>Docker Image</figcaption></figure><p><strong>In this article, I have listed the docker commands which will be handy for beginners.</strong></p><p><strong>Docker Download Link: </strong><a href="https://docs.docker.com/get-docker/"><strong>https://docs.docker.com/get-docker/</strong></a></p><p>In every command I have used [] i.e means optional argument and &lt;&gt; i.e mandatory arguments.</p><p>Before trying out the commands, make sure whether docker daemon is running using below command.</p><blockquote>docker info</blockquote><p>Note: The image in running state is called container. Lots of people don’t know how to differentiate it.</p><p><strong>Pull image</strong></p><blockquote>docker pull &lt;image_name&gt;</blockquote><p>-&gt; only pulls the container and not starts</p><p><strong>Start container</strong></p><blockquote>docker run &lt;container_name&gt; [-d]</blockquote><p>-d → means run the container in detach mode</p><p><strong>Currently running containers</strong></p><blockquote>docker ps [-a]</blockquote><p>-a → used to list currently running and previously stopped container</p><p><strong>Stop container</strong></p><blockquote>docker stop &lt;container_name&gt;</blockquote><p><strong>Remove container</strong></p><blockquote>docker rm &lt;container_id&gt;</blockquote><p><strong>Execute command in container</strong></p><blockquote>Docker exec &lt;container_id&gt; &lt;cmd&gt;</blockquote><p><strong>Expose container port</strong></p><blockquote>Docker run -p host_port:container_port &lt;container_name&gt;</blockquote><p><strong>Container Backup</strong></p><blockquote>Docker run -v host_dir:container_dir &lt;container_name&gt;</blockquote><p>→ used for taking the backup of the directory even if the image is removed</p><p><strong>Inspect container</strong></p><blockquote>Docker inspect &lt;container_name&gt;</blockquote><p><strong>Container logs</strong></p><blockquote>Docker logs &lt;container_name&gt;</blockquote><p><strong>Attach to the container</strong></p><blockquote>Docker attach &lt;container_id&gt;</blockquote><p><strong>Set environment variable for container</strong></p><blockquote>docker run -e APP_COLOR=RED &lt;container_name&gt;</blockquote><p><strong>List all images</strong></p><blockquote>docker images</blockquote><p><strong>Remove image</strong></p><blockquote>Docker rmi &lt;image_name&gt;</blockquote><p><strong>Image history</strong></p><blockquote>Docker history &lt;image_name&gt;</blockquote><blockquote>Build docker image</blockquote><blockquote>Docker build . -t &lt;tag-name&gt;</blockquote><h3>Docker Hacks</h3><p><strong>Stop all currently running container</strong></p><blockquote>docker stop $(docker ps -aq)</blockquote><p><strong>Remove all container (including previously stopped container)</strong></p><blockquote>docker rm $(docker ps -aq)</blockquote><p><strong>Remove all images</strong></p><blockquote>docker rmi $(docker images -q)</blockquote><blockquote>If you find this article helpful, follow me for more interesting article!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70fd98c509c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[All-In-One Apache Kafka Beginner Friendly Commands]]></title>
            <link>https://medium.com/@vasanthgk02/all-in-one-apache-kafka-beginner-friendly-commands-a8a8d51bc0f?source=rss-bb02bc9037a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8a8d51bc0f</guid>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[commands]]></category>
            <category><![CDATA[cheatsheet]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[Vasanth Kumar]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 17:22:29 GMT</pubDate>
            <atom:updated>2023-08-24T17:22:29.598Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*Gk1aK1Jdesyq6RhKSg3JPg.jpeg" /></figure><p>Hey 👋, in this tutorial, I will walk you through Apache Kafka commands and make your hands dirty.</p><p><strong>NOTE:</strong> In this tutorial, I won’t be showing how to install kafka and Kafka theory. I will leave the link to install kafka on your machine.</p><p><a href="https://www.javatpoint.com/installation-of-apache-kafka">Kafka Installation</a> <a href="https://www.javatpoint.com/apache-kafka">Kafka Theory</a></p><p>Its a very beginner friendly tutorial where you learn how to start with basic kafka commands and progress towards little advanced commands in kafka.</p><p>NOTE: I didn’t setup path variable. I will be executing commands from Kafka installation folder. I assume that what ever commands you execute from this tutorial, you are inside the kafka installation folder which I mentioned below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VBBG8aik7kVqRshKZ6oZbA.png" /><figcaption>Present Kafka Working Directory</figcaption></figure><p>Lets get into the actual commands!</p><h3><strong>KAFKA BASIC COMMANDS</strong></h3><p><strong>NOTE : By default zookeeper runs on port 2181 broker ( kafka-server) runs on 9092 port. Make sure you don’t run any other applications on these ports.</strong></p><ol><li>Start the zookeeper</li></ol><pre>bin/zookeeper-server-start.sh config/zookeeper.properties</pre><p>This terminal should not be terminated through the tutorial. So make sure you open another new terminal and execute the upcoming commands.</p><p>Here zookeeper-server-start.sh inside bin folder will start the zookeeper and zookeeper.properties inside config folder will display all the properties of the zookeeper.</p><p>2) Start the broker</p><pre>bin/kafka-server-start.sh config/server.properties</pre><p>This terminal also should not be terminated through the tutorial. So make sure you open another new terminal and execute the upcoming commands.</p><p>Similarly here kafka-server-start.sh file inside bin folder will start the kafka server (kafka-broker) and server.properties inside config folder will display all the properties of the Kafka server (aka kafka-broker)</p><p>3) Create the topic</p><pre>bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic &lt;topic-name&gt;</pre><p>Here localhost:9092 specifies the kafka server is currently running in the local machine on port 9092. Replace &lt;topic-name&gt; with your topic name.</p><p>4) Create a Topic with a Specific Number of Partitions</p><pre>bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic &lt;topic-name&gt;  --partitions 4 --replication-factor 1</pre><p>Replace &lt;topic-name&gt; with the topic name given in the above command. Here you can specify required partition and replication factor for the particular topic. Both are optional.</p><p>So you can also execute,</p><pre>bin/kafka-topics.sh --bootstrap-server localhost:9092 --create --topic &lt;topic-name&gt;</pre><p>5) Alter the Number of Partitions for an Existing Topic</p><pre>bin/kafka-topics.sh --bootstrap-server localhost:2181 --alter --topic &lt;topic_name&gt;  --partitions 8</pre><p>6) List topics of a specific broker</p><pre>bin/kafka-topics.sh --list --bootstrap-server localhost:9092</pre><p>This command is used to see all the topics in the particular broker. Note that metadata about the topic is shared between all the broker to make the process faster.</p><p>7) Start the Producer</p><pre>bin/kafka-console-producer.sh --broker-list localhost:9092 --topic &lt;topic-name&gt;</pre><p>Now you can publish the message to the topic in the producer console. Don’t exit the terminal otherwise you can’t publish the message.</p><p>The — broker-list is used to specify which broker we need to talk to publis the message and &lt;topic-name&gt; specifies which topic we need to publish.</p><p>8) Start the Consumer</p><p>This command should be executed in a new terminal.</p><pre>bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic &lt;topic-name&gt; --from-beginning</pre><p>Here we subscribe to the specific topic from the kafka broker. We can see all the messages published by the producer in the consumer terminal.</p><p>Here — bootstrap-server localhost:9092 and &lt;topic-name&gt; specifies which broker and to which topic we need to subscribe.</p><p>9) Stop the Broker</p><pre>bin/kafka-server-stop.sh</pre><p>10) Stop the zookeeper</p><pre>bin/zookeeper-server-stop.sh</pre><p>Click <a href="https://sagarkudu.medium.com/set-up-a-kafka-cluster-in-local-with-multiple-kafka-brokers-98d4e4e7a343">here</a> to learn how to configure multiple brokers in kafka.</p><p>POST Credits: The above given article link credits goes to the author</p><p>If you have any doubts on how to execute the commands or if facing any issues, do leave in the comments section. I will resolve your issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8a8d51bc0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Importance of C++ STL in Competitive Programming]]></title>
            <link>https://medium.com/theleanprogrammer/importance-of-c-stl-in-competitive-programming-9f9763b62900?source=rss-bb02bc9037a6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f9763b62900</guid>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[standard-template-library]]></category>
            <category><![CDATA[complexity-analysis]]></category>
            <category><![CDATA[cpp17]]></category>
            <dc:creator><![CDATA[Vasanth Kumar]]></dc:creator>
            <pubDate>Thu, 29 Apr 2021 14:25:34 GMT</pubDate>
            <atom:updated>2022-01-04T14:25:43.922Z</atom:updated>
            <content:encoded><![CDATA[<h3>C++ Standard Template Library ( STL )</h3><h4>A quick intro about C++ Standard Template Library!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oUNvQS8WYJxXWIQRr2LTJg.png" /></figure><h3>What is STL in C++?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tH9-i1Fi7Hl8KDA_OEY3ug.png" /><figcaption>C++ Standard Template Library. <strong>Source:</strong> Taken from google.</figcaption></figure><p>Generally, Competitive coding has time limitations. Within that given timeframe you have to solve the given problems for which you will be rewarded some points.</p><p>Let&#39;s take an example. Let’s say there’s a question that can be easily solved using stacks. But implementing this data structure itself takes some time, right? But in C++ you can easily code a problem using stack by just including some header files and that&#39;s it, you are done!</p><p>STL in C++ stands for Standard Template Library. It has lots of inbuilt functions like <em>sort(), rotate(), </em>algorithms like<em> binary search(), </em>and pre-defined data structures like <em>stacks, queue, linked list, forward list… </em>Because of these time-saving pre-defined codes, programmers prefer this library.</p><p><strong>Here’s an overview of the C++ STL.</strong></p><p>There are 5 types of iterators namely —</p><ul><li><em>Input Iterator,</em></li><li><em>Output Iterator,</em></li><li><em>Forward Iterator,</em></li><li><em>Bi-directional Iterator, and</em></li><li><em>Random Access Iterator</em></li></ul><p>Each data structure has its own iterator. For example, a vector (similar to an array where the size of the array need not be constant in C++) has a random access iterator which means we can iterate elements in any direction whereas a forward list in CPP STL has a forward iterator which means we can iterate elements only in the forward direction.</p><p>There are 4 types of containers namely —</p><ul><li><em>Sequence Container</em> (<em>Vector</em>, Dequeue, <em>List</em> (Doubly LinkedList), and <em>Forward List</em> (Singly LinkedList) comes under this container),</li><li><em>Adaptive Container</em> (<em>Stack, Queue, Priority Queue</em> comes under this container),</li><li><em>Associative Container </em>(set, multiset, map, and multimap are under this container),</li><li><em>Unordered Associative Container</em> ( <em>unordered set, unordered multiset, unordered map, </em>and<em> unordered multiset</em> comes under this container ).</li></ul><p>There are plenty of algorithms in the STL library and many functions for each container. So it&#39;s always good to learn STL in C++ before starting CP as it saves a lot of time during a contest.</p><p>Also, don’t forget to implement these data structures by yourself and learn how these data structures work.</p><h3><strong>What is Competitive Programming ( a.k.a CP )?</strong></h3><p>The name “Competitive Programming” is self-explanatory. As the name suggests it’s nothing but programming but in a competitive environment. Programmers from various backgrounds participate in a contest to solve problems.</p><p>Nowadays people are taking CP as a career and teaching it to others. There are various platforms for CP such as<em> hackerrank, HackerEarth, CodeChef, code forces </em>( top programmers practice here), etc. Many people got their dream job only because of CP.</p><p>Here’s the link to my GitHub repository where I made notes on C++ STL with their respective time complexity for better code optimization — <a href="https://github.com/vasanthgk02/CPP-STL-Notes">https://github.com/vasanthgk02/CPP-STL-Notes</a></p><p>Thanks for reading this article!</p><p>Don’t forget to follow <a href="https://medium.com/theleanprogrammer">The Lean Programmer Publication</a> for more such articles, and subscribe to our newsletter <a href="https://tinyletter.com/TheLeanProgrammer">tinyletter.com/TheLeanProgrammer</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f9763b62900" width="1" height="1" alt=""><hr><p><a href="https://medium.com/theleanprogrammer/importance-of-c-stl-in-competitive-programming-9f9763b62900">Importance of C++ STL in Competitive Programming</a> was originally published in <a href="https://medium.com/theleanprogrammer">TheLeanProgrammer</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>