<?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 Crazy Coder on Medium]]></title>
        <description><![CDATA[Stories by Crazy Coder on Medium]]></description>
        <link>https://medium.com/@crazy-coder?source=rss-1d8fc9b45b0e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*J5Xwu1hllsDqB3NgwcjYTQ.jpeg</url>
            <title>Stories by Crazy Coder on Medium</title>
            <link>https://medium.com/@crazy-coder?source=rss-1d8fc9b45b0e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:19:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@crazy-coder/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 write clean code]]></title>
            <link>https://medium.com/@crazy-coder/how-to-write-clean-code-c9a56a9ee80c?source=rss-1d8fc9b45b0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9a56a9ee80c</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[clean-coding-principles]]></category>
            <category><![CDATA[clean-coding]]></category>
            <dc:creator><![CDATA[Crazy Coder]]></dc:creator>
            <pubDate>Sun, 04 Aug 2024 15:52:46 GMT</pubDate>
            <atom:updated>2024-08-10T17:16:10.051Z</atom:updated>
            <content:encoded><![CDATA[<p>Writing cleaner code has been a topic of discussion since long time. Even people have written book on this and it is still a topic of discussion in technical conferences and meetups. It shows the importance of writing clean code. I also thought to share my experience about writing code which can be cleaner and readable and easy to modify. Before starting on how to do this, let me summarize the benefits of doing it.</p><p>Software industry is one of the most dynamic industry which is growing very fast. To align with this rapid improvement on one hand new software development is going on but on the other hand there is always requirement of maintaining as well as improving the existing software. And around 80% of the time programmers maintaining and improving existing software only. Below are some benefits of writing clean code.</p><ul><li>Writing cleaner code helps to maintain and improve the existing code.</li><li>If written code is clear then it is easy for other programmers to understand it and modify it which leads to save programmers time to fix issues, doing impact analysis and modifying the existing functionality and it also reduces cost for organization.</li><li>Following clean coding standards also help in writing optimized code.</li></ul><p>Below are few tips on writing clean code.</p><p><strong>Use static code analyzer<br></strong>Use some static code analyzer and don’t ignore its comments and warnings. Static code analyzer helps to follow predefined standards of programming language and industry. Also it helps to identify potential software quality issues and it reduces burden for code reviewers as they need not to look for the issues which static code analyzer can catch.</p><p><strong>Avoid duplication of code<br></strong>Code duplication is a technical debt which creates issues while maintaining the code. If similar code is scattered at multiple places then modifying it, is a challenging task because to identify at what all places it is being written is not an easy job and very time consuming also. Also duplicate code may lead to additional bugs during modification.</p><p><strong>Single responsibility per method<br></strong>Short and precise is always better. Don’t make your method unnecessary complex by performing so many tasks inside it. If one method is responsible for one type of task then there will be only one reason to modify it. Also if method is design for one kind of task only then it is easy to reuse it.</p><p><strong>Clear code &gt; clever code<br></strong>Clear code is easy to read in comparison of code written in clever way which is adding complexity.</p><blockquote><em>“Everyone knows that debugging is twice as hard as writing a program in the first place. So if you’re as clever as you can be when you write it, how will you ever debug it?”<br> — Brian Kernighan</em></blockquote><p>Above statement makes clear why developer should focus on writing clear code rather than clever code.</p><p><strong>Optimization vs readability<br></strong>It has been always a challenge for me whenever I have to choose between optimized code and readable code. Optimizing code sometimes adds complexity to code and make it harder to read. To handle such kind of situations, I follow two rules.<br>- Go for readability if ignoring optimization is not costing much for software performance.<br>- If optimization is more important then use proper comments to explain the complex code to make it readable.</p><p><strong>Don’t use brute force approach every time<br></strong>Using brute force approach to solve every problem is not the recommended approach until you are not working on large problem and it is simple to solve using brute force without adding performance cost. If using optimized approach is adding complexity and making harder to read then better to use comments to explain it.</p><p><strong>Regular refactoring without adding bugs<br></strong>As I mentioned in my second paragraph of this blog that most of the time programmers work on maintaining the software and improving it. When someone write code initially at that time he/she might not think that what can be the scenario in future. Code might be written by assuming scenarios of that time. But for new requirement instead of trying to fit your code in existing one, if refactoring needed then go for it. Ignoring refactoring at one stage will add complexity for next stage and every time you ignore refactoring, next time it will be more difficult to refactor. Also make sure no bug is introduced in existing behavior while doing refactoring.</p><p><strong>Reuse existing APIs<br></strong>If existing API can do your task then reuse it rather than writing your own. Major challenge is to identify if any API exists which is fit for requirement. It requires your team members’ help also to identify if any API exist for your requirement or not. If API exist then write new one only if you can write better than the existing one.</p><p><strong>First design then code<br></strong>It is recommended process to finalize design for your task before going for implementation. But whenever requirement is to add some functionality in existing one then finding approach only is not enough. Whether that approach will fit in our existing code is also need to considered. So in such scenario some time programmer have to write some code to check if new approach will fit in existing criteria or not and it shouldn’t break anything existing. In such scenario sometimes coding needs to be started before freezing design for requirement.</p><p><strong>Maintain loose coupling among components<br></strong>There are many design principles and design patterns recommended to design your software and write better code. Those need to be followed on basis of requirement. Along with that components should be loosely coupled so that whenever modifications are needed at component level then it should be easier to change.</p><p><strong>Comment why, not what<br></strong>Writing comments with code is very important. But programmers should keep in mind that adding comments about what are you doing should not be priority. Code should be self readable and shouldn’t need comments to understand what is being done. Comments about what is being done can be added for API documentation. But for fellow programmers comments should be written to explain why particular code is written like that rather than explaining what it is doing. If code is written complex to optimize it and achieve performance then it is exceptional case and explain what it is being done there.</p><p><strong>Read others code and let them read yours<br></strong>It is a good habit of programmers to read others code and try to identify what they are doing and how they achieve it. It will help you in improving your code quality not only in terms of writing cleaner code but also in writing efficient code. Also don’t hesitate to invite other to review your code.</p><p><strong>Use Descriptive Names for classes, methods and variables<br></strong>I think it is first recommendation from any book author or technical geek when they talk about code quality. I am explaining it in last because it is a very common advice programmers get from college professors, trainers, peers and seniors. So assuming that everybody is aware about its importance, writing in last only to remind about it.</p><p>With all these important points, I am going to summarize this post. Hope it will help you, don’t forget to comment your suggestions.</p><p>If you liked my writeup and want to support me, then you can do that at — <a href="https://buymeacoffee.com/codingmotives">https://buymeacoffee.com/codingmotives</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9a56a9ee80c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interview Preparation Cheat Sheet]]></title>
            <link>https://medium.com/@crazy-coder/interview-preparation-cheat-sheet-11594f5da60c?source=rss-1d8fc9b45b0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/11594f5da60c</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[dsa-courses]]></category>
            <category><![CDATA[amazon]]></category>
            <dc:creator><![CDATA[Crazy Coder]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 15:56:09 GMT</pubDate>
            <atom:updated>2024-08-10T17:16:40.703Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the 60 days preparation sheet I used to crack the Amazon interview. It would give you a day to day breakdown.</p><p><strong>Topics I prepared</strong></p><ul><li>DS and algo</li><li>Database — Postgres, Scylla and introduction of various other types of no sql DB, like — graph DB etc.</li><li>Distributed system</li><li>Kafka — for messaging communication</li><li>Low level design</li><li>High level system design</li><li>One programming language — Java</li><li>My work related project</li></ul><p><strong>Prior knowledge</strong></p><ul><li>I was not in touch of DS and algo from couple of years but I had understanding about concepts and had practice as well before that so it was not start from zero.</li><li>I was having decent knowledge of Postgres and Scylla DB but not in depth.</li><li>Kafka I was aware as I was using it but again not in depth.</li><li>Since I was working with other organizations and was tackling issues daily so was having hold on system design for at least my project and domain related problems.</li></ul><p><strong>Daily routine and time given</strong></p><p>For weekdays, I set my google calendar event one hour in the morning from 6 to 7 and 2 hours in the evening from 8 to 10. In the evening sometimes I couldn’t follow the schedule because of office meetings and work so either I compensated for that time with a different slot or I skipped the day.</p><p>On the weekend, I made up my mind to spend at least 6 hours studying out of 24 hours. I target my preparation on a weekly basis. One week was giving me 5 working days and weekend to manage the entire schedule</p><p><strong>Resources I used</strong></p><ul><li>Book I liked the most “Cracking the Coding Interview” — by Gayle McDowell. You can but it at amazon — <a href="https://amzn.to/3ywV3sR">https://amzn.to/3ywV3sR</a></li><li>To brush up java, I used — <a href="https://javarevisited.blogspot.com/#google_vignette">https://javarevisited.blogspot.com/</a></li><li>I used leet code for practice</li><li>For other tech items I searched on net randomly</li></ul><p><strong>Preparation Strategy</strong></p><ul><li>I was preparing on a notepad because most of the interviews were remote.</li><li>After writing on the notepad I used to do a dry run on my code. I used to copy and paste in leet code editor to find compilation errors and verified my code with different input data.</li><li>I always started from easy level questions, focused on different patterns to solve problems and slowly moved towards medium and difficult level problems.</li><li>I used to find multiple solutions, let it be brute force or less efficient. Later used to code optimal solution.</li><li>I wanted to shift my mindset towards problem solving and find solutions so that I can at least think of some sort of solution in an interview. Because I knew in these 2 months I can’t practice each and every question.</li><li>Whenever I came through some concept or technique in a problem that was totally out of my mind I used to keep a note of it to do a quick revision at a later stage.</li></ul><p><strong>Preparation month-1</strong></p><p>This month I only focused on DS and algo and nothing else.</p><p><strong>Month -1: Day-1 to 7</strong></p><ul><li>Brushed up my knowledge of finding complexities and understood proper complexities concepts for different kinds of algos, like — for loops, logarithmic ones etc.</li><li>I was very much comfortable about array and string creation and manipulation so move to easy level coding problems.</li><li>I understood recursion and tried to focus on recursion based solutions as well.</li><li>I used leet code to do preparation and found out easy level questions with different patterns, like — binary search based problems (sorted array related problems), two pointer problems, sliding window, hashing based solutions, recursion etc.</li><li>I understood various string internal methods in java and also practiced string manipulation, pattern matching etc.</li><li>I ensured that I practice questions based on different patterns.</li><li>While practicing I focused on optimal solutions but always used to think about multiple solutions even if these are less efficient. Think of multiple solutions but only code optimal ones.</li></ul><p><strong>Month -1: Day-8 to 14</strong></p><ul><li>For the initial 3 days of this week I focused on stack and queues. Various types of queues and questions on stack and queues. All implementations I did, assuming array as underlying data structure.</li><li>For the rest of the days I focused on the linked list. Here I did linked list implementation, insertion, deletion and search in linked list.</li><li>Focused on some tricky questions on the linked list.</li><li>Weekends were my trump cards because I was able to do lot of practice on those days.</li></ul><p><strong>Month -1:Day -15 to 21</strong></p><ul><li>Here I moved to trees. I was totally out of sync with the trees and it was like starting from zero.</li><li>I understood the concept and basic implementation of BST, BST rotations and various operations on BST.</li><li>This week I fully focused on BST only and didn’t practice anything else.</li></ul><p><strong>Month -1:Day -22 to 28</strong></p><ul><li>This week I focused on sorting algorithms and dynamic programming. My honest evaluation was that I was not comfortable on dynamic programming by the end of week as well.</li><li>But I kept practicing and keep taking notes. Did as much practice as I could do.</li></ul><p><strong>Month -1:Day -29 to 30</strong></p><p>In these two days I did relax and recap for my learning and understanding. I went through all the points I had taken note of. No practice in these two days.</p><p>Preparation month -2</p><p>Second month, I divide my time between weekdays and weekends. During weekdays I used to focus on theoretical concepts like — DBMS, system design, low level design and all. Over the weekend I used to practice DS and algo.</p><p><strong>Month-2: 8 to 14</strong></p><ul><li>During weekdays, I brush up on Postgres and Scylla DB skills. Looked at their interview questions.</li><li>Different kinds of NoSQL DBs and their usage only, nothing in depth</li><li>Kafka concepts and its interview questions.</li><li>Prepared one liner notes for important points to revise at later stage before interview.</li><li>Was manageable for me because I was already working on these technologies.</li><li>During the weekend, I searched interview questions asked in amazon (medium and high difficulty one) and practiced those questions. These were mixed questions on different data structures.</li></ul><p><strong>Month-2: Day -8 to 14</strong></p><ul><li>This week I focused on low level design questions. I searched on google various low level design questions and practiced those questions. In these 5 weekdays I practiced approx 10–12 level important low level design questions.</li><li>Also my goal was to understand the way of solving these questions to tackle any problem later.</li><li>During the weekend, I did random amazon related coding problems and solved them. This time I fully focused on tree and dynamic programming based problems. 5–6 questions from BST and 5–6 from dynamic programming.</li></ul><p><strong>Month-2: Day -15 to 21</strong></p><ul><li>This week I focused on distributed system concepts and high level design.</li><li>I studied all components to focus on high level design and practiced 8–10 most important questions, like — designing twitter, facebook, meta, youtube etc.</li><li>Over the weekend, I again searched medium and high difficulty coding questions (covering all data structures) and practiced those questions.</li></ul><p><strong>Month-2: Day -22 to 28</strong></p><ul><li>During weekdays I focused on more low level and high level designs.</li><li>I went through important Java concepts like — collections, thread. Did couple of coding problems using thread.</li><li>Searched on google Java interview questions and went through those questions.</li><li>All these questions were concept based and theoretical. I didn’t do any practice except thread related 2–3 programs.</li><li>I practiced more DS and algo questions over the weekend.</li></ul><p><strong>Month-2: Day -29 to 31</strong></p><ul><li>Revise all my learning concepts and notes I had taken during preparation.</li><li>Look back at important DS and algo questions, I noted during preparation and checked how these were solved.</li><li>Thought about end to end architecture of my current project and its design.</li></ul><p><strong>After 2 months</strong></p><ul><li>I kept practicing coding problems and revising my concepts, low level designs and system design.</li><li>After one week I was having an interview scheduled with amazon so went through their process and behavioural questions.</li></ul><p>So important takeaways are that you can’t practice each and every question in such small time frame so practice different set of questions and make sure you are able to think different solutions to tackle unfamiliar questions in interview. Also knowledge you acquire from daily office work is also a brownie point.</p><p>That’s all, if you liked the writeup then please like this article and turn on notification.</p><p>If you liked my writeup and want to support me, then you can do that at — <a href="https://buymeacoffee.com/codingmotives">https://buymeacoffee.com/codingmotives</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11594f5da60c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Tier3 College to FAANG: A Tech Journey]]></title>
            <link>https://medium.com/@crazy-coder/from-tier3-college-to-faang-a-tech-journey-24e4a3a92c78?source=rss-1d8fc9b45b0e------2</link>
            <guid isPermaLink="false">https://medium.com/p/24e4a3a92c78</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[faang]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Crazy Coder]]></dc:creator>
            <pubDate>Tue, 16 Jul 2024 14:38:57 GMT</pubDate>
            <atom:updated>2024-08-10T17:17:06.727Z</atom:updated>
            <content:encoded><![CDATA[<p>Often I hear about the struggle of tech guys to get a good job and settle in their career especially if they couldn’t start from a premium college. I also have been part of a similar journey so thought to share the insights about my journey from tier3 college to FAANG company. This story contains -</p><ul><li>Struggle of an average IT guy to get good job</li><li>Strategies to get into top IT company</li><li>Journey from 3.2LPA to 80LPA</li><li>Keeping myself motivated in this journey</li></ul><p><strong>Background</strong></p><p>I started my graduation with a tier3 college. I was new to coding and was not able to understand anything at first. Balancing lectures, assignments, and exams becomes a daily battle.</p><p>Somehow I learnt C and Java languages but like an average student only. I built one ordinary project — online library management in college and I was not even aware that companies hire for paid internships as well. In my circle getting a job in TCS, Infosys, Accenture type of companies was a major achievement so I started practicing for the same. Luckily cracked off campus interview of similar company and grabbed 3.2LPA package</p><p>From there I switch 2 more companies and end up getting hired by Amazon. It was not so easy to achieve with a full time job. Managing office work and personal studies was a nightmare. But somehow I sailed through all of that.</p><p><strong>Upskilling myself</strong></p><p>It was not a big deal to do office work especially in a service based company but the major concern was how can I keep myself up to date. It was difficult to find time for myself after having a full time IT job and with no work life balance. After wasting two years just doing office work, I laid down my strategy to grow in my career.</p><ul><li>I targeted the tech stack that is used in my work and in demand outside as well</li><li>REST web services, Postgres DB, Hibernate were few such tech stacks</li><li>I started learning about these tech stacks and also started analyzing my project codebase. It helped me to excel my tech knowledge and apply it to my job as well</li><li>There were other tech stacks as well that were required to learn outside of the job, so I started looking for different resources for them</li><li>I decided to use 5 hours minimum every weekend for self study. Although it was not consistent, I didn’t quit</li><li>I started attending workshops and tech conferences to meet like minded people and get an idea of the outside world.</li><li>I started building my side projects and applying my learnings there. Whenever I learn anything new, I apply that knowledge into practice with my dummy projects</li></ul><p><strong>Strategy to get into FAANG</strong></p><p>DSA is a must have skill to get into any top IT company but the surprising fact is that I didn’t practice DSA much. I always practiced DSA for 2–3 months whenever I had to switch my job. So how did I do that? Let’s decode</p><ul><li>Whenever I implement something for office work or personal, if I can manage some time then I review my own work and always think how can I do it better. Different ways to optimise the code, different ways to make it cleaner, how code blocks can be generalised.</li><li>Doing this activity keeps my brain active and I always keep thinking about different approaches and solutions.</li><li>Whenever I write code, I always think about boundary conditions and failure scenarios. By doing this, I built a habit to always think about boundary and corner cases that are must to handle in an interview. Also it helped me to reduce bugs in my code at work.</li><li>Sometimes I review my office project architecture and think about bottlenecks and how we can solve these problems, like — scalability, latency etc. Doing this helps me to test my designing and architectural skills in a real world project and also if I am able to make some significant improvement then it also gets appreciation and spotlights from manager and other leadership members.</li><li>Still there are tech stacks that are not used in my project and need for interview preparation, so I learn about it, go through various interview questions and if I have time then use it in my personal project.</li><li>For DS and algo, I practiced for a couple of months for different interviews. I would share a two months preparation strategy separately.</li></ul><p><strong>How I increased salary to 80 LPA</strong></p><p>Having skill is one thing but getting compensation according to that is different. There are many talented techies who are not paid as per their potential. So how do I increase my salary, there are two different scenarios — getting hikes during your job and getting hike during switch</p><ul><li>To get a hike from a current employer, the most important factor is to do extraordinary work. But only doing office work may freeze your personal learning and growth. So I always find a way where I can learn as well and solve challenges for employer as well.</li><li>It is a win-win situation and I mentioned my strategies in above section for this.</li><li>During your year end review highlight measurable achievements, like — changed the DB schema that reduced latency of read queries by 20%.</li><li>To get a hike while switching job, ensure that you are highlighting your work achievements. If you have multiple offers then it is easy to negotiate. And if you get into one of the top IT companies then it is easy to get a good salary.</li></ul><p><strong>Handle failures and stay motivated</strong></p><p>Handling failures gracefully is crucial for personal and professional growth. Everyone gets rejected from one or another company. Everyone has a bad year at work that attracts average or below average appraisal. So few suggestions -</p><ul><li>Never hesitate to start again and with a different strategy.</li><li>Always do a retrospective at regular intervals and it is good to be worried that one has lost 3–4 months without learning anything new. Realisation is the first step of the journey.</li><li>Continuous learning is key, don’t wait for the last moment.</li><li>You can use JIRA or trello to plan and track your personal projects and learning as well.</li><li>Keep taking recharge times for yourself to avoid burnout, stay calm and maintain a healthy lifestyle.</li><li>Don’t stress too much about failures, everyone makes mistakes. Just do a retrospective of failures.</li></ul><p>That’s all, I tried to write down my personal experience and strategies that worked for me. I hope this article would be helpful for you as well. If you like it please like this article to appreciate and turn on notifications for future write-ups.</p><p>If you liked my writeup and want to support me, then you can do that at — <a href="https://buymeacoffee.com/codingmotives">https://buymeacoffee.com/codingmotives</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24e4a3a92c78" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>