<?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 Atri Chaturvedi on Medium]]></title>
        <description><![CDATA[Stories by Atri Chaturvedi on Medium]]></description>
        <link>https://medium.com/@atrichaturvedi?source=rss-62e6a085a201------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4B7qbvA9HDtBS-aDADGTLg.jpeg</url>
            <title>Stories by Atri Chaturvedi on Medium</title>
            <link>https://medium.com/@atrichaturvedi?source=rss-62e6a085a201------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 22:15:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@atrichaturvedi/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[How to start with Placements Interview Preparation and my Interview Experience with American…]]></title>
            <link>https://medium.com/@atrichaturvedi/how-to-start-with-placements-interview-preparation-and-my-interview-experience-with-american-ce072c981c5e?source=rss-62e6a085a201------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce072c981c5e</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[placement]]></category>
            <category><![CDATA[american-express]]></category>
            <dc:creator><![CDATA[Atri Chaturvedi]]></dc:creator>
            <pubDate>Sun, 06 Sep 2020 06:28:42 GMT</pubDate>
            <atom:updated>2020-09-08T15:24:13.409Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to start with Placements Interview Preparation and my Interview Experience with American Express.</h3><h4>A small helping hand to help you with detailed step by step process to ace the placements interviews.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/0*1lHoPzWvpK-HHZQf.png" /></figure><p>Hey Amigos. So in this article I will be telling you all about my competitive coding journey and how did I prepare for my interviews which ultimately handed me a 6 months internship at American Express.</p><p>It can become a bit long so bear with me XD</p><p>Having a proper road-map is very important as one can have thousands of ways to achieve a target but which way to follow and when, is what makes the difference. You can practice coding questions from many different sites but its better that you take 1–2 sites and practice from them properly and in depth.</p><p>Start by taking a DSA course on <a href="https://www.geeksforgeeks.org/"><strong>GeeksForGeeks</strong></a> and solve all the questions in each and every track . Yes <strong>all !! </strong>. Simultaneously you <strong>have to</strong> solve the questions on <a href="https://leetcode.com/"><strong>LeetCode</strong></a> . Between Java or C++ you can chose any as the languages matter only sometimes but logic matters the most.</p><p>So at the end of your placement season your LeetCode profile and GfG profile should look somewhat like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*G5IJmjrS6BacTTsWHeJLHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*iTOXWXSxGkvHCUYLTYaREA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GGLnw0tjfV1sCrLQQ1GPSw.png" /></figure><p>Now as you start solving the questions do maintain a repository on Github or anywhere you are comfortable at. Keep pushing the codes you write to Github.</p><p>GitHub link for my repository of all the codes I had written until now:</p><blockquote><em>Want to read this story later? Save it in </em><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=blog&amp;utm_campaign=noteworthy&amp;utm_content=eid7"><em>Journal</em></a><em>.</em></blockquote><p><a href="https://github.com/ATRI2107/JAVA-CODES">ATRI2107/JAVA-CODES</a></p><p>Do star the repository if you like it and I am open for pull requests as well :-). Having a well maintained repository helped me a lot in revising my codes over the period of time. Sharing my commits over this period of time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*iZb6EIYQOzT7UEN2cwVI7A.png" /><figcaption>A Snapshot of my contributions while preparation.</figcaption></figure><p>The above stated things will be needful for DSA preparation.</p><p>The important topics to cover here are</p><ol><li>Arrays</li><li>Linked List</li><li>Trees</li><li>Graphs</li><li>Dynamic Programming</li></ol><p>Coming on to the CSE Core Subjects part which includes Operating Systems, Database Management Systems and Computer Networks. For them doing from your university curriculum would be sufficient.</p><ol><li>Operating Systems- You can do it from <a href="https://www.youtube.com/playlist?list=PLxCzCOWd7aiGz9donHRrE9I3Mwn6XdP8p"><strong>Gate Smashers Youtube Channel</strong></a>.</li><li>DBMS- Follow Knowledge gate <a href="https://www.youtube.com/playlist?list=PLmXKhU9FNesR1rSES7oLdJaNFgmuj0SYV"><strong>Sanchit Jain’s channel</strong></a>.</li><li>SQl- W3Schools.</li><li>Computer Networks- <a href="https://www.youtube.com/playlist?list=PLxCzCOWd7aiGFBD2-2joCpWOLUrDLvVV_"><strong>Gate Smashers Youtube Channel</strong></a></li></ol><p>You can even refer to GeeksForGeeks for more questions and theory on the above given topics.</p><p>Now comes the System Design Part. Here one must remember that knowing about things and applying the same in a real life interview are two different things. One must have understanding of how things work.</p><p>For System Design part you can follow <a href="https://www.youtube.com/playlist?list=PLMCXHnjXnTnvo6alSjVkgxV-VH6EPyvoX"><strong>Gaurav Sen’s Youtube Channel</strong></a>.</p><p>After having read the preparation procedure I’ll start with my American Express Interview Experience.</p><p><strong>First Round: </strong>It was an online round consisting of 2 sections. One was a coding section having 2 questions which needs to be solved in 30 minutes. The questions were very small and easy and can be solved without much effort. The another section consisted of 60 MCQs which needed to be solved in 45 minutes. The MCQs were easy but there was a negative marking of -0.25 and also the time and speed factor were also there. Nearly 1200 students sat for the test and 32 were shortlisted for the next round and I was one amongst them.</p><p><strong>Second Round: </strong>It was a Technical + HR Round where the technical part went for about 45 minutes and the last 15 minutes was the HR part.</p><p>The Technical part consisted of 2 coding questions which were fairly easy :</p><ol><li>Code the Armstrong Number the logic.</li><li>Code the logic for 2 equal Arrays- In this he asked me that what do I understand by equal Arrays. I told him certain scenarios, and he asked me code one of them.</li></ol><p>Then he asked me 3 SQL Questions which included 2 questions on Joins. I would suggest everyone to know the types of joins . Then there were 2 puzzle questions which tested your IQ.</p><p>In the HR part of this round he asked me what do you know about AMEX and the role you have applied for. Then he asked me about working of credit cards since AMEX is a credit card company.</p><p>After this I was called for the next round.</p><p><strong>Third Round: </strong>This round was more of an HR Round. In the technical part I was asked to explain one project in which I had most fun doing it. Then he asked me how will I go about a project launch at the company and what will be my work flow. Then I was asked why only AMEX and did I have any questions for him. To this I asked him what all is there in tech stack of AMEX.</p><p>Then the HR head told us that they will be declaring the results at the end of the day.</p><p><strong>RESULT- </strong>Selected :)</p><p>At the end I would suggest everyone to be calm and confident and have a positive attitude while giving the interview. Asking questions about the company is always good because it shows your interests towards the company.</p><p>You can direct message me on <a href="https://www.linkedin.com/in/atri-chaturvedi/">LinkedIn</a> for any queries or can mail me at atrichaturvedi@gmail.com .</p><p>📝 Save this story in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce072c981c5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Programming Interviews in Java- Part 1 , Introduction to Inheritance.]]></title>
            <link>https://medium.com/@atrichaturvedi/programming-interviews-in-java-part-1-introduction-to-inheritance-a6c4a3075209?source=rss-62e6a085a201------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6c4a3075209</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java-programming]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <dc:creator><![CDATA[Atri Chaturvedi]]></dc:creator>
            <pubDate>Mon, 25 May 2020 08:47:59 GMT</pubDate>
            <atom:updated>2020-05-25T09:33:57.035Z</atom:updated>
            <content:encoded><![CDATA[<h3>Programming Interviews in Java- Part 1 , Introduction to Inheritance.</h3><p><em>Reasons why Java is considered to be one of the most popular languages in the field of competitive programming for interviews and how to start about with this language.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OioxkjiOfbCq5c0D" /></figure><p>Welcome to the first part of the series about Programming Interviews in Java and its massive use and advantages in competitive programming. Here we’ll know how the language can help us a great deal in acing our coding interviews. Starting with a brief introduction, we’ll quickly dive deep into the details in the upcoming articles. This article discusses about Inheritance.</p><p>Before starting with the article, it would be good that you know at least some basics about the language and if not then I would try my best to generate some interest about Java in you. So let’s get started !</p><p>I can firmly state on the basis of my 8 years of experience in programming in Java that it is one of those languages that truly gives justice to the concept of Object Oriented Programming especially when it comes to implementing certain Data Structures. This fact here makes the concept of encapsulation quite rigid i.e. wrapping of data and methods as a single unit. This provides security to your variables (or data) from getting manipulated.</p><p>The unit written above is termed <strong>class </strong>. A class in Java is actually what defines everything that is going on in the code. It defines its properties through variables and methods. If you aren’t able to follow it there’s nothing to worry about. Let’s talk in simple layman terms. Take a example of car for instance, and think how you tell about it’s features or characteristics to your friends. You simply talk about the colour, mileage, type of tyres used, steering, quality of brakes etc. So these features define that car (or class in terms of Java) . Now once you have defined the class you can inherit its properties in another separate code or class thus it gives rise to the concept of <strong>inheritance</strong>.</p><p><strong>Inheritance </strong>as the term defines allows one to inherit or get access to the properties of an already existing class. Thus the features and properties of one class can be inherited from one class to another but <strong>not from one to multiple classes. </strong>The class whose properties or code is being used is termed as <strong>parent class or base class</strong> and the class accessing those features is termed as <strong>child class or derived class. </strong>The biggest advantage of inheritance lies in the fact that it allows the <strong>re-usability of code</strong> that is the code once written in parent class can be used again and again. The subclass inherits the features using the <strong>extends </strong>keyword.<strong> </strong>Now I think you may have started to realise how this re-usability feature may help you in saving lots of time while writing the code in an online test. Here’s an example for you guys to understand this concept well.</p><pre>class Base</pre><pre>{</pre><pre>int ctr;</pre><pre>void factorial()</pre><pre>{</pre><pre>int fact=1;</pre><pre>for(int i=ctr;i&gt;0;i--)</pre><pre>{</pre><pre>fact*=i;</pre><pre>}</pre><pre>System.out.println(&quot;Factorial= &quot;+fact);</pre><pre>}</pre><pre>}</pre><pre>class Derived extends Base</pre><pre>{</pre><pre>void setCtr(int n)</pre><pre>{</pre><pre>ctr=n;</pre><pre>}</pre><pre>}</pre><pre>class abc <em>// main class for execution</em></pre><pre>{</pre><pre>public static void main(String[] args) {</pre><pre>Derived obj=new Derived();</pre><pre>obj.setCtr(5); <em>// assigns 5 to ctr</em></pre><pre>obj.factorial();</pre><pre>}</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*EPRyyDqky8WGG4_3Rt4yrQ.png" /><figcaption>The output for the above code</figcaption></figure><p>The question may be arising to you all, the setCtr function in Derived class is able to access the ctr variable in the Base class. Yes, there are certain visibility rules that define whether the base class members are inherited by the derived class or not. The accessibility of base class members inside the derived class depends on the fact that whether the:</p><ol><li>subclass belongs to the same base class’s package.</li><li>subclass belongs to the some other package.</li></ol><h3>Visibility of Class Members</h3><ol><li>A subclass inherits all the private and public members of its parent , no matter what package the sub class is in.</li><li>The <strong>protected</strong> visibility provides the best encapsulation while still providing inheritance.</li><li>The private members are neither accessible nor inheritable outside the class. However inherited public or protected methods of parent class can be used for accessing the private fields by the subclass.</li><li><strong>The subclass does not inherit the constructors from its base class.</strong></li></ol><p>The keywords- <strong>public, protected and private </strong>are access specifiers which determine the accessibility of class members.</p><p>Let’s check out this example. (Don’t forget to check the comments in the code)</p><pre>class Rectangle</pre><pre>{</pre><pre>private int width;</pre><pre>protected int depth;</pre><pre>int getWidth() <em>// a default method of the class accessing the private memeber width of class</em></pre><pre>{</pre><pre>return width;</pre><pre>}</pre><pre>protected void setWidth(int w) <em>// a protected method of the class accessing the private memeber width of class</em></pre><pre>{</pre><pre>width=w;</pre><pre>}</pre><pre>}</pre><pre>class Box extends Rectangle{</pre><pre>private int height;</pre><pre>public void setHeight(int h) <em>// using public method to access the private height member</em></pre><pre>{</pre><pre>height=h;</pre><pre>}</pre><pre>int boxArea()</pre><pre>{</pre><pre>int ar,w;</pre><pre><em>// ar= width * height Error: width has private access</em></pre><pre>w=getWidth(); <em>//inherited the default method to access the private field width</em></pre><pre>ar=w*depth; <em>// depth is protected member of the Rectangle class hence accessible</em></pre><pre>return ar;</pre><pre>}</pre><pre>int boxVol()</pre><pre>{</pre><pre>int v=boxArea()*height;</pre><pre>return v;</pre><pre>}</pre><pre>}</pre><pre>class abc <em>// main class</em></pre><pre>{</pre><pre>public static void main(String[] args) {</pre><pre>Box obj=new Box(); <em>// Object of sub class</em></pre><pre>obj.setWidth(15); <em>//invoking protected inherited method to access the private field</em></pre><pre>obj.depth=10;     <em>// accessing inherited protected field</em></pre><pre>obj.setHeight(12);</pre><pre>System.out.println(&quot;Area= &quot;+obj.boxArea());</pre><pre>System.out.println(&quot;Volume= &quot;+obj.boxVol());</pre><pre>}</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*8YohglaOL3lntERHskN7Dw.png" /><figcaption>Output for the above code</figcaption></figure><h3>Sub Class Constructors</h3><p>A sub class constructor is used to initialise the instance variables of both the subclass and super class. The sub class constructor invokes the super class constructor either <strong>implicitly or </strong>by using the keyword <strong>super.</strong></p><ol><li>super() — invoking the non-parameterized constructor of super class.</li><li>super(parameters_list) — invoking the parametrized constructor of super class.</li></ol><p><strong>Note:</strong></p><ol><li>If the super class definition contains a parametrized constructor then the sub class constructor must have a parametrized constructor explicitly invoking a super(…).</li><li>Explicit invocation of a <strong>super class</strong> constructor must be the <strong>first line</strong> of sub class constructor.</li></ol><pre>class B<br>{<br>  int a;<br>  B(int a)<br>  {<br>    this.a=a;<br>  }<br>}<br>class D<br>{<br>   int x;<br>   D(int x,int y)<br>   {<br>     super(y);<br>     this.x=x;<br>   }<br>}</pre><p><strong>Instance Variable Hiding</strong></p><p>If a sub class declares a variable with the same name as one in the super class , then the sub class variable hides the inherited super class variable. The hidden variable/field can be accessed using the keyword super as:</p><blockquote>super.variable_name;</blockquote><pre>class B<br>{<br>  int i;<br>}<br>class D<br>{<br>   int i;<br>   D(int x,int y)<br>   {<br>     super.i=y;<br>     this.i=x;<br>   }<br>}</pre><p><strong>Method Overriding</strong></p><p>A concept which occurs when an instance method in a sub class hides method of the super class due to similar declarations. An over-ridden super class method can be invoked using the super keyword.</p><blockquote>super.overridenMethod()</blockquote><pre>class Base</pre><pre>{</pre><pre>int x;</pre><pre>Base(int x)</pre><pre>{</pre><pre><em>this</em>.x=x;</pre><pre>}</pre><pre>void display()</pre><pre>{</pre><pre>System.out.println(&quot;Super variable x= &quot;+x);</pre><pre>}</pre><pre>}</pre><pre>class Derived extends Base</pre><pre>{</pre><pre>int y;</pre><pre>Derived(int x,int y)</pre><pre>{</pre><pre><em>super</em>(x);</pre><pre><em>this</em>.y=y;</pre><pre>}</pre><pre>void display()</pre><pre>{</pre><pre><em>super</em>.display();</pre><pre>System.out.println(&quot;Sub variable y= &quot;+y);</pre><pre>}</pre><pre>}</pre><pre>class abc</pre><pre>{</pre><pre>public static void main(String[] args) {</pre><pre>Derived obj=new Derived(10,20);</pre><pre>obj.display();</pre><pre>}</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TbrHqPiuMc0dwgj38lNtGg.png" /><figcaption>Output for the above code</figcaption></figure><h3>Abstract Classes</h3><ol><li>An abstract class defines a structure of given abstraction without any implementation.</li><li>It’s a super class or base class defined by using the keyword <strong>abstract.</strong></li><li>These classes cannot be instantiated(creating the object of the class )they are defined solely for the purpose of extension(inheritance) by other classes.</li></ol><p><strong>Abstract Methods</strong></p><p>It is an over-riden method which is declared with an abstract modifier in the abstract super class. These methods don’t contain any implementation of the function but just the function signature i.e. they are just defined without any body of code.</p><p>Declaration Syntax:</p><p>abstract type function_name(&lt;parameters_list&gt;)</p><p>Now abstract classes give rise to a concept that is called <strong>Run Time or Dynamic Polymorphism. </strong>Polymorphism simply means the capability of a method to do different things based on the object it’s acting upon.</p><p>Now let’s see what does the term dynamic means here.</p><ol><li>Dynamic polymorphism is achieved by using method over-riding.</li><li>It is a mechanism by which the call to an over-ridden method is resolved by JVM at the run time hence the term Run Time.</li></ol><p>Well this much of theory may be quite confusing but there’s nothing to worry as I’ll be providing code examples with it :-)</p><p>The following code example not only explains Dynamic Polymorphism but also the concept of abstract classes and methods.</p><pre>abstract class Shape <em>// abstract super class</em></pre><pre>{</pre><pre>double ar;</pre><pre>abstract void area();</pre><pre>}</pre><pre>class Circle extends Shape</pre><pre>{</pre><pre>double radius;</pre><pre>Circle(double r)</pre><pre>{</pre><pre>radius=r;</pre><pre>}</pre><pre>public void area() <em>// abstract method definition version 1</em></pre><pre>{</pre><pre>ar=3.14*radius*radius;</pre><pre>System.out.println(&quot;Circle area= &quot;+ar);</pre><pre>}</pre><pre>}</pre><pre>class Triangle extends Shape</pre><pre>{</pre><pre>double base, height;</pre><pre>Triangle(double b,double h)</pre><pre>{</pre><pre>base=b;</pre><pre>height=h;</pre><pre>}</pre><pre>public void area() <em>// abstract method version 2</em></pre><pre>{</pre><pre>ar=0.5*base*height;</pre><pre>System.out.println(&quot;Triangle area= &quot;+ar);</pre><pre>}</pre><pre>}</pre><pre>class abc</pre><pre>{</pre><pre>public static void main(String[] args) {</pre><pre>Shape s;</pre><pre>s=new Circle(2.0); <em>// s refers to Circle object</em></pre><pre>s.area(); <em>// invokes area of Circle class</em></pre><pre>s=new Triangle(2.0, 5.0); <em>// s refers to Triangle object</em></pre><pre>s.area(); <em>// invokes area of Triangle class</em></pre><pre>}</pre><pre>}</pre><p>So the second point of dynamic polymorphism which says the JVM decides the execution of over-ridden method area() at run time is explained when the Shape class in the above code is instantiated by reference of the sub class object.</p><blockquote>Putting it in other words the type of sub class object referred to by the super class reference variable at run time dynamically determines the execution of the correct version of the abstract method, thus implementing Java’s approach to the <strong>sub class polymorphism</strong> .</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qw8OGBYhNjD-USirFXw-7w.png" /><figcaption>Output for the above code.</figcaption></figure><h3>Interface</h3><ol><li>A interface in Java is a <strong>collection of final constants and abstract methods.</strong></li><li>They are syntactically similar to abstract classes but they lack instance variables and their methods specify only their signatures and not the code implementation(lack the body of function). Whereas abstract classes can contain both abstract and non-abstract methods.</li><li>Putting it in other words interfaces are stricter version of abstract classes.</li><li>They are implemented using the <strong>implements</strong> keyword.</li><li>Just like abstract classes they <strong>can’t</strong> be instantiated as they are abstract in nature.</li><li>Java doesn’t support multiple inheritance of a class but through interfaces this can be done indirectly because interface can be implemented by multiple classes.</li><li>All the variables in interface are <strong>implicitly</strong> declared as public, static and final and all the methods are <strong>implicitly</strong> declared as public and abstract.</li></ol><p>Let’s have a look at the example below.</p><pre>interface Area</pre><pre>{</pre><pre>double pi=3.14;</pre><pre>double calArea(double r);</pre><pre>}</pre><pre>class Circle implements Area</pre><pre>{</pre><pre>public double calArea(double r) <em>//implementation of abstract method in the interface</em></pre><pre>{</pre><pre>return pi*r*r;</pre><pre>}</pre><pre>}</pre><pre>class abc</pre><pre>{</pre><pre>public static void main(String[] args) {</pre><pre>Circle obj=new Circle();</pre><pre>System.out.println(&quot;Circle Area= &quot;+obj.calArea(2.0));</pre><pre>}</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*PIKxiyjpnZ4RLFZmz7F4Dg.png" /><figcaption>Output for the above code</figcaption></figure><p>That’s all folks! You have just finished inheritance in Java for programming interviews.</p><p>In the upcoming blogs I’ll cover the collections in Java. Till then stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6c4a3075209" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>