<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Viswaprasath</title>
    <description>The latest articles on DEV Community by Viswaprasath (@iamvp7).</description>
    <link>https://dev.to/iamvp7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F26335%2F6498f674-07bc-4d73-aad7-8cf8a377f981.jpeg</url>
      <title>DEV Community: Viswaprasath</title>
      <link>https://dev.to/iamvp7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iamvp7"/>
    <language>en</language>
    <item>
      <title>Designing Cache Architecture</title>
      <dc:creator>Viswaprasath</dc:creator>
      <pubDate>Sat, 15 Jan 2022 10:33:47 +0000</pubDate>
      <link>https://dev.to/iamvp7/designing-cache-architecture-1n0f</link>
      <guid>https://dev.to/iamvp7/designing-cache-architecture-1n0f</guid>
      <description>&lt;p&gt;Many software developers might have read about various architecture, among them for some Clean Architecture if favorite.  The idea behind this architecture is as we move to the inner layers, it should not have any dependency from the external layer.&lt;/p&gt;

&lt;p&gt;Recently in our team, we were planning to having casual interaction to introduce caching system; to reduce the text-based look-up from our SQL Database.  Our main goal was &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Have good Developer Experience to new Developers to use system&lt;/li&gt;
&lt;li&gt;Should be easier to introduce newer cache at any point in future&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D4ZgKiWk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1642180916032/RoBf8nK-p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D4ZgKiWk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1642180916032/RoBf8nK-p.png" alt="Cache Implementation Diagration" width="880" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before moving to the details our hypothesis is as follows, at any point of time we will be having only one Distributed cache (Redis or DynamoDB or something else). Even when we are having two different caches at the same time it is not going to be difficult to do the implementation.&lt;/p&gt;

&lt;p&gt;We have 4 layers in our architecture&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cache Manager&lt;/li&gt;
&lt;li&gt;Cache Connector&lt;/li&gt;
&lt;li&gt;Cache System Connector&lt;/li&gt;
&lt;li&gt;Physical Cache System&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Cache Manager
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X_gRF562--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1642232711899/2xBweHEti.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X_gRF562--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1642232711899/2xBweHEti.png" alt="business-cache.png" width="741" height="563"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cache Manager is the first layer of our Cache Architecture. Via this layer, other parts of the system will interact. And the methods which connect with the Cache API Connector are available here.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cache connector and Cache methods
&lt;/h3&gt;

&lt;p&gt;Here we have used the Abstract factory method to decide which Cache Layer (Redis, DynamoDB, or anything else) to connect on. We have also implemented the methods Cache API connecting methods in this layer with validations (checking NotNull for Key &amp;amp; Value).&lt;/p&gt;

&lt;h3&gt;
  
  
  External System Connector
&lt;/h3&gt;

&lt;p&gt;This is the Class where external components of the system connect to Connect with the Cache System to insert into Cache or Get value from Cache. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bGItQgwT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1642234097213/2Xok_-lZ_.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bGItQgwT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1642234097213/2Xok_-lZ_.png" alt="whole-architecture.png" width="880" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Cache Connector
&lt;/h2&gt;

&lt;p&gt;Once the Cache Manager decides which Cache System to connect with we will be moving to the next layer called Cache Connector or Cache API connector (Both names are interchangeable).&lt;/p&gt;

&lt;p&gt;Let's take DynamoDB as our Cache System. So once CachceManager decides its DynamoDB, we will be moving to the DynamoDB API Connector layer. This layer will be extending a few methods from CacheConnector Class. &lt;/p&gt;

&lt;h3&gt;
  
  
  CacheConnector Class
&lt;/h3&gt;

&lt;p&gt;In general, will be having the generic methods in which we want to interact with Cache.&lt;/p&gt;

&lt;p&gt;Say we will have methods to insert/get data as JSON or text or HashMap, drop the keys so on. Some Cache may have some methods, not all so the classes (DynamoAPIConnector or RedisAPIConnector) which extend this abstract CacheConnector Class will write a little tweaked version according to their system.&lt;/p&gt;

&lt;p&gt;In Redis we will have something like HSet where we can give two keys to look up the value. While in RocksDB we may not have this, so we will have a different approach to combine these two keys into a single key with some logic.&lt;/p&gt;

&lt;h3&gt;
  
  
  DynamoDB Cache API connector
&lt;/h3&gt;

&lt;p&gt;So as mentioned before this method will be extending the CacheConnector Class. From this class, we will be connecting with  DynamoDB System Connector which will have the core method and initialization logic.&lt;/p&gt;

&lt;p&gt;In this DynamoDB Cache API connector class we will be extending the abstract methods from CacheConnector, and will be implemented according to the DynamoDB system method.&lt;/p&gt;

&lt;h2&gt;
  
  
  DynamoDB Cache System Connector &amp;amp; Actual DynamoDB machine
&lt;/h2&gt;

&lt;p&gt;Cache System Connector is the core class where we will be having things like initialization of Cache and other core methods to interact with the Physical Cache System.&lt;/p&gt;

&lt;p&gt;We will be loading the IP connection URL, read timeout, maximum connection to the physical cache machine, and so on.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is easier?
&lt;/h2&gt;

&lt;p&gt;The main goal of our design decision is to make it easy for any other new system to be pluggable and removable easily.&lt;/p&gt;

&lt;p&gt;If anyone wants to plug new Cache system (with KV) then they have to make 3 modification&lt;br&gt;
1) In DBManager have to add Object creation for new Cache API Connector&lt;br&gt;
2) Class which extends Cache API Connector&lt;br&gt;
3) Class which extends Cache System Connector &lt;/p&gt;

&lt;h2&gt;
  
  
  What is difficult?
&lt;/h2&gt;

&lt;p&gt;One of the major things is, in case we need to manage two Cache systems then we have to write a new method at DBManager.&lt;/p&gt;

&lt;p&gt;This design came up during our casual interaction, feel free to share your thoughts to it can help us or anyone to improve designing the system.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;All the logos are owned by the project companies&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Proxy vs Reverse Proxy</title>
      <dc:creator>Viswaprasath</dc:creator>
      <pubDate>Wed, 28 Apr 2021 15:33:27 +0000</pubDate>
      <link>https://dev.to/iamvp7/proxy-vs-reverse-proxy-4201</link>
      <guid>https://dev.to/iamvp7/proxy-vs-reverse-proxy-4201</guid>
      <description>&lt;p&gt;Originally posted at my &lt;a href="https://iamvp7.github.io//proxy-vs-reverse-proxy"&gt;personal website&lt;/a&gt;&lt;br&gt;
Lets learn about the basics of Proxy server vs Reverse Proxy server. &lt;/p&gt;

&lt;h2&gt;
  
  
  Proxy Server
&lt;/h2&gt;

&lt;p&gt;Proxy is helpful for the client-side connection. It mainly helps the client to hide their identity. &lt;/p&gt;

&lt;p&gt;We can consider a scenario where we connect to the internet via our college network. Think of 3 friends connecting to various servers&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Friend 1: Connecting to the internet via Android phone to google.com &lt;/li&gt;
&lt;li&gt;Friend 2: Connecting to the internet via iPhone to youtube.com &lt;/li&gt;
&lt;li&gt;Friend 3: Connecting to the internet via Dell Laptop to wikipedia.com &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We all 3 connect via our college internet. And our college has a proxy server named CollegeProxy Server.&lt;/p&gt;

&lt;p&gt;First of all, all our requests will be going to this CollegeProxy Server, and this server will be making connections to google.com or facebook.com, or twitter.com for us. &lt;/p&gt;

&lt;h3&gt;
  
  
  Hide Client Identity
&lt;/h3&gt;

&lt;p&gt;For google.com or youtube.com or wikipedia.com, all the details from the client are got by this CollegeProxy Server and this CollegeProxy Server requests us. All these  google.com, youtube.com, and wikipedia.com  will only know CollegeProxy Server has requested.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Blocking website
&lt;/h3&gt;

&lt;p&gt;To make students productive, colleges will be blocking sites like facebook.com or twitter.com if we are connecting via college internet. &lt;br&gt;
A proxy server will be very much helpful for blocking unwanted websites.&lt;/p&gt;

&lt;h3&gt;
  
  
  GeoFencing
&lt;/h3&gt;

&lt;p&gt;Some of the sites can be restricted to access when connected via proxy server alone. For example, when we are connected to our College internet connection (which in turn connects to our CollegeProxy Server)  we will be allowed to access our digital mark sheet website, assignments website, and timetable website which we will not be allowed when are outside of our college internet&lt;/p&gt;

&lt;h2&gt;
  
  
  Reverse Proxy
&lt;/h2&gt;

&lt;p&gt;Reverse Proxy is helpful for Servers. &lt;/p&gt;

&lt;p&gt;As the Proxy server helps the client-side connection (like making anonymity of 3 Friends mentioned above), Reverse Proxy helps Server from unwanted clients. &lt;/p&gt;

&lt;p&gt;Let's assume there are few internal websites in our College. And now let's assume we have a reverse proxy server named CollegeReverseProxy.&lt;/p&gt;

&lt;p&gt;Let's name the domain of the internal website as  collegeinternalwebsite.com&lt;/p&gt;

&lt;h3&gt;
  
  
  Hide Server Identity
&lt;/h3&gt;

&lt;p&gt;Our college internal website (collegeinternalwebsite.com) will be running on 5 or 6 machines. If the IP address of those machines is known to hackers then it can be corrupted. CollegeReverseProxy server can help in &lt;strong&gt;hiding the internal IP address of the servers&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Blocking bots and unwanted users access
&lt;/h3&gt;

&lt;p&gt;Consider there are some notorious students who try to access college internal resources without giving the password and username, these types of &lt;strong&gt;unauthorized access&lt;/strong&gt; can be stopped at CollegeReverseProxy before sending the request to the resource website.&lt;/p&gt;

&lt;p&gt;Think of 1000 requests coming within 10 seconds to the same internal resources from the same machine. Requests like these are mostly &lt;strong&gt;targeted attacks&lt;/strong&gt; and these types of requests &lt;strong&gt;are blocked at CollegeReverseProxy&lt;/strong&gt; level itself before coming to the resources server&lt;/p&gt;

&lt;h3&gt;
  
  
  Can Cache Resources
&lt;/h3&gt;

&lt;p&gt;ReverseProxy server can &lt;strong&gt;cache the most static resources&lt;/strong&gt; which won't be changed for a long time. With this, load coming to the servers can be reduced.&lt;/p&gt;

&lt;h3&gt;
  
  
  Act as Load Balancer
&lt;/h3&gt;

&lt;p&gt;Load Balancer is the special type of use case of Reverse Proxy and its most common example. Simple we can use a Reverse Proxy server to &lt;strong&gt;distribute the request to different servers&lt;/strong&gt; based on some logic. We can check the later detailed post about Load balancer.&lt;/p&gt;

</description>
      <category>systems</category>
      <category>architecture</category>
    </item>
    <item>
      <title> Crio Winter of Doing</title>
      <dc:creator>Viswaprasath</dc:creator>
      <pubDate>Sat, 23 Jan 2021 09:17:39 +0000</pubDate>
      <link>https://dev.to/iamvp7/crio-winter-of-doing-1bac</link>
      <guid>https://dev.to/iamvp7/crio-winter-of-doing-1bac</guid>
      <description>&lt;p&gt;Recently I got a chance to learn about amazing company named Crio started by former employees of Google / Motorola. They were doing a free program named  &lt;a href="https://www.crio.do/crio-winter-of-doing/"&gt;Winter of Doing&lt;/a&gt; . This is so special people learn by doing the things. There will be guided notes / videos and  help articles which can help us to learn more depth on subject.&lt;/p&gt;

&lt;h2&gt;
  
  
  It got 3 stages
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Stage 1: Understanding of basics on HTTP, REST API, Linux, AWS, GIT&lt;/li&gt;
&lt;li&gt;Stage 2: Depth learning on Frontend / Backend + Mini Project&lt;/li&gt;
&lt;li&gt;Stage 3: Externship&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this post we will be checking only about Stage 1. &lt;/p&gt;

&lt;p&gt;First Exciting story. I have completed the Stage 1 and below is the certificate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZPHd6PpJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1611389219130/VwTzPbjTa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZPHd6PpJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1611389219130/VwTzPbjTa.png" alt="viswa-crio-winter-of-doing.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Core of Program
&lt;/h2&gt;

&lt;p&gt;Learn things in hands-on. Having just video or text will never help us. Each and everything is mentioned step by step, so we can easily replicate the same hands-on. Only if we are learning by doing we can remember it easily. This is very simple trick, we might have written notes many times and we will be easily remembering it while if we have read out or listen to the contents it is difficult to reproduce again.&lt;/p&gt;

&lt;h1&gt;
  
  
  Stage 1
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Learning
&lt;/h2&gt;

&lt;h3&gt;
  
  
  HTTP  &amp;amp; REST API
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;What are the various HTTP methods available&lt;/li&gt;
&lt;li&gt;What are different status code&lt;/li&gt;
&lt;li&gt;How we can send HTTP request (Postman, cURL, Java client and so on..)&lt;/li&gt;
&lt;li&gt;Chrome DevTools and so on..&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Linux Basics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Lot of commands&lt;/li&gt;
&lt;li&gt;This is mandatory for anyone who would love to become Developer. When we are going to handle server components, we wont have GUI like in our machine and have to depend on Linux terminal command to execute lot of things.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  AWS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Basics on how to provision on System, how to run it, how to connect it from our machine.&lt;/li&gt;
&lt;li&gt;AWS was so easy we can start our machine within few minutes. Have never experienced it before. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Git
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Obviously without learning any version control there cannot be any developers.&lt;/li&gt;
&lt;li&gt;Git is so popular choice for many companies / project maintainers&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  HTML &amp;amp; CSS &amp;amp; JS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;After this there was intense training on HTML , CSS and JS. Can confidently say with this training we can learn and work on any front end stack.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Micro Experience
&lt;/h2&gt;

&lt;p&gt;After this we were trained to work on a mini project. We were trained to build our own profile &lt;a href="https://heyvp7.netlify.app/"&gt;website&lt;/a&gt; for this Front end is written in ReactJS and Backend using NodeJS.   Our front end is hosted at Netlify and backend at heroku. &lt;/p&gt;

&lt;h2&gt;
  
  
  Community Learning
&lt;/h2&gt;

&lt;p&gt;Around 10K+ participated in this program, most of them were in slack and we can ask questions based on the modules and Crio staff will be helping us and also other peers who are learning will also help us. This is best thing I can say. We all learn by teaching / helping others (remember what most of you did during your school days). &lt;/p&gt;

&lt;h2&gt;
  
  
  Who is this program targeted to
&lt;/h2&gt;

&lt;p&gt;I can feel if some one is passionate about learning the code, they can surely join. Everyone can have many takeaway from this program.  I have 6 years of experience at Zoho, one of the best SaaS company from Chennai, I was able to help few fellow participants and was able to understand how and where people get stuck and we can motivate them to write the code (surely i don't like spoon feeding; I love to push next steps by giving hints)&lt;/p&gt;

&lt;h3&gt;
  
  
  Awards
&lt;/h3&gt;

&lt;p&gt;And participants were also given few awards&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Disciplined Roaster:&lt;/em&gt;  I believe learning is a compounding factor, its not done in a day. Each and every day just 1 hour  if we can learn something new then it will make wonders.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Unstoppable Bull:&lt;/em&gt; Coding is really easy. But remember we should make sure the code which we write is readable by others (as we read English or any other language). This is where craftsmanship exist.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Relentless Bee:&lt;/em&gt; I strongly believer every learner never gives up till they have learned or mastered the skill. There is no full stop for learning, its never ending process.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w0R3EYi7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1611392232661/VzFHYAnQ8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w0R3EYi7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1611392232661/VzFHYAnQ8.png" alt="viswa-crio-awards.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can follow me on &lt;a href="https://twitter.com/HeyVP7"&gt;Twitter&lt;/a&gt; or &lt;a href="https://www.linkedin.com/in/viswaprasathks/"&gt;Linkedin&lt;/a&gt;, I love sharing more about learning opportunities. &lt;/p&gt;

&lt;p&gt;This story is originally posted at &lt;a href="https://heyvp7.hashnode.dev/crio-winter-of-doing"&gt;HashNode&lt;/a&gt;&lt;/p&gt;

</description>
      <category>criodevstories</category>
      <category>criowinterofdoing</category>
      <category>learning</category>
    </item>
    <item>
      <title>Maximum Depth of Binary Tree</title>
      <dc:creator>Viswaprasath</dc:creator>
      <pubDate>Sun, 13 Dec 2020 18:13:02 +0000</pubDate>
      <link>https://dev.to/iamvp7/leetcode-2020-dec-1-maximum-depth-of-binary-tree-52h</link>
      <guid>https://dev.to/iamvp7/leetcode-2020-dec-1-maximum-depth-of-binary-tree-52h</guid>
      <description>&lt;p&gt;This article is originally written at &lt;a href="https://heyvp7.hashnode.dev/leetcode-2020-dec-1-maximum-depth-of-binary-tree"&gt;Vishy tech notes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem Statement&lt;/strong&gt;: We have to find the maximum depth of the Binary Tree. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Maximum depth&lt;/em&gt; can be defined at the maximum number of nodes at the  longest path to the deepest leaf node.&lt;/p&gt;

&lt;p&gt;Consider the Input as  : [3,9,20,null,null,15,7]&lt;/p&gt;

&lt;p&gt;In the above input, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;3 is root node value, it has two childs left is 9 and right is 20; &lt;br&gt;
Again the node with value 9 has no child nodes which is written as null and null (means no child with value or no node).&lt;br&gt;
And the node with value 20 has two child nodes which has child nodes 15 and 7. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Fromt the above example we can understand the path 3 -&amp;gt; 20 -&amp;gt; 7 is largest. So the maxiumum depth in this example is 3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pseudo Code&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check whether the node is null or not. If it is null then return the height as 0. If not continue.&lt;/li&gt;
&lt;li&gt;Check wehther there are any child nodes. If no child nodes then return the height as 1.&lt;/li&gt;
&lt;li&gt;If there are any one child node, then we have to find the height of those child nodes recursively.&lt;/li&gt;
&lt;li&gt;Find the height of left node, it can be done by invoking the same method with the left node passed.&lt;/li&gt;
&lt;li&gt;Second find the height of left node, it can be done by invoking the same method with the right node passed.&lt;/li&gt;
&lt;li&gt;Both the left node and right node will be going till both their children are null.&lt;/li&gt;
&lt;li&gt;Once we get both the height of left and right node, we will whichever is maximum height and then we will add current node depth (+1) and then return.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Java Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private static int findHeight(TreeNode node){
    if(node!= null &amp;amp;&amp;amp; node.left == null &amp;amp;&amp;amp; node.right == null){
        return 1;
    }else if( node != null &amp;amp;&amp;amp; (node.left != null || node.right != null)) {
        int leftHT = findHeight(node.left);
        int rightHT = findHeight(node.right);
        return Math.max(leftHT, rightHT)+1;
   }
   return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>leetcode</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>What is the Output of this</title>
      <dc:creator>Viswaprasath</dc:creator>
      <pubDate>Tue, 14 Jul 2020 17:45:15 +0000</pubDate>
      <link>https://dev.to/iamvp7/what-is-the-output-of-this-4d54</link>
      <guid>https://dev.to/iamvp7/what-is-the-output-of-this-4d54</guid>
      <description>&lt;p&gt;Find the output of this Java program&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ddJeKUe7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://gitlab.com/techpaadam/java-quiz/-/raw/master/obj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ddJeKUe7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://gitlab.com/techpaadam/java-quiz/-/raw/master/obj.png" alt="program"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is very simple program.&lt;/p&gt;

&lt;p&gt;An JSONObject is created with key as key1 and value as value1.&lt;br&gt;
Then its passed to the method;&lt;br&gt;
In that method for the passed JSONObject we will be putting the key as key1 and value as value2.&lt;/p&gt;

&lt;p&gt;What will be the output of this program ?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/TechPaadam/status/1283088886080495616"&gt;Source Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>java</category>
      <category>backend</category>
    </item>
    <item>
      <title>Util files are Important</title>
      <dc:creator>Viswaprasath</dc:creator>
      <pubDate>Mon, 13 Jul 2020 18:56:21 +0000</pubDate>
      <link>https://dev.to/iamvp7/util-files-are-important-2o64</link>
      <guid>https://dev.to/iamvp7/util-files-are-important-2o64</guid>
      <description>&lt;p&gt;Most of the developers know the importance of Util files. I would like to share my story about the Util files I have developed for my work or personal projects during last 5 years.&lt;/p&gt;

&lt;p&gt;During development I found out I will be needing two types of Util files. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First is common to Language I use (can be useful for cross product)&lt;/li&gt;
&lt;li&gt;Second is for the project specific Util files&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common Util Files
&lt;/h2&gt;

&lt;p&gt;I started writing this util file mainly to reduce (or to maintain) the common checks we do during development.&lt;/p&gt;

&lt;p&gt;For example in Java think of checking the String is valid of not.  Valid string can be mentioned as String which has atleast one Character in it. &lt;/p&gt;

&lt;h3&gt;
  
  
  To Check this we will be following the below steps in Java
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Approach 1
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Check whether the String is null or not, if it is null then it cannot be valid&lt;/li&gt;
&lt;li&gt;Check the String not equals to "", if its equal to "" then its not valid&lt;/li&gt;
&lt;li&gt;If both cases are satisfied, i.e., not null and is not equal to "" then it is valid case.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Approach 2
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Check whether the String is null or not, if it is null then it cannot be valid&lt;/li&gt;
&lt;li&gt;Check the String is not empty using isEmpty() in built Java method&lt;/li&gt;
&lt;li&gt;If both cases are satisfied, i.e., not null and is not empty then it is valid case.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even when a single developer is able to write two approaches think of a team with 10 backend developers. It is simple to find more than 5 approaches for simple checks like this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of Common Util files
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;We can use it with other projects. Think of writing a small part as Library and giving it to customers.&lt;/li&gt;
&lt;li&gt;Standard code can be maintained across the project. We need not have different standards inside same project&lt;/li&gt;
&lt;li&gt;Testing can be done easily.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Project Util Files
&lt;/h2&gt;

&lt;p&gt;Like Common Util file, it is very important to have project based util file also. This is generally specific to the project and is not exported. Usually it is bundled and used only in that project.&lt;/p&gt;

&lt;p&gt;Consider an HashMap (or Dictionary) which will have the relationship between the ID and the Search Engine names.&lt;/p&gt;

&lt;p&gt;Example :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 -&amp;gt; Google&lt;/li&gt;
&lt;li&gt;2 -&amp;gt; Bing&lt;/li&gt;
&lt;li&gt;3 -&amp;gt; DuckduckGo&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is very easy if we can have this details in single file. Generally over the period of time, some people tend to write their own implementation and write the code; instead its good to make developers refer a single method which can give the ID of search engine if name is given and vice versa.&lt;/p&gt;

&lt;p&gt;Similarly, there are lot of learning I would like to share about maintaining the constants, Loggers, Exception handler as we go on.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

</description>
      <category>java</category>
      <category>backend</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Create Certificate Templates</title>
      <dc:creator>Viswaprasath</dc:creator>
      <pubDate>Sat, 20 Jun 2020 19:17:57 +0000</pubDate>
      <link>https://dev.to/iamvp7/how-to-create-certificate-templates-1gpi</link>
      <guid>https://dev.to/iamvp7/how-to-create-certificate-templates-1gpi</guid>
      <description>&lt;p&gt;I would like to create a Digital Certificate for event running by our college department.&lt;/p&gt;

&lt;p&gt;We will be having 3 dynamic field Name, event participate and Signature of the professor. &lt;/p&gt;

&lt;p&gt;We will have static background (if possible event based). How can we create this certificate template using Javascript or any other language.  &lt;/p&gt;

&lt;p&gt;Deadline to create is 30th June 2020&lt;/p&gt;

</description>
      <category>help</category>
      <category>discuss</category>
      <category>javascript</category>
      <category>svg</category>
    </item>
    <item>
      <title>What Project for backend</title>
      <dc:creator>Viswaprasath</dc:creator>
      <pubDate>Wed, 27 May 2020 20:43:33 +0000</pubDate>
      <link>https://dev.to/iamvp7/what-project-for-backend-33eb</link>
      <guid>https://dev.to/iamvp7/what-project-for-backend-33eb</guid>
      <description>&lt;p&gt;There are times when I feel backend developer are left out of twitter world. There are so many amazing projects to showcase for frontend devlopers who can code in JS /CSS/ HTML.&lt;/p&gt;

&lt;p&gt;Not sure what are similar things we can do as a backend developer. What will you do if you want to project yourself as a strong backend devlopee in punlic. What projects you ll build and display ? &lt;/p&gt;

</description>
      <category>backend</category>
      <category>codenewbie</category>
      <category>beginners</category>
      <category>discuss</category>
    </item>
    <item>
      <title> Building Browser Extension - Book</title>
      <dc:creator>Viswaprasath</dc:creator>
      <pubDate>Wed, 05 Dec 2018 18:32:11 +0000</pubDate>
      <link>https://dev.to/iamvp7/-building-browser-extension---book-7on</link>
      <guid>https://dev.to/iamvp7/-building-browser-extension---book-7on</guid>
      <description>&lt;p&gt;I recently published my first book on &lt;a href="https://heyvp7.gumroad.com/#iyoBl"&gt;Cross Browser WebExtension development&lt;/a&gt;. This book can be downloaded for free from leanpub and is licensed with Creative Commons license. This book will be good for beginners who are interested to learn more on Javascript. This book contains 7 experiments with good number of API's explained with code examples and another 7 suggested experiments which we can try.&lt;/p&gt;

&lt;h3&gt;
  
  
  Contents in book
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;With this book we can learn about setting us the Firefox Extension development.&lt;/li&gt;
&lt;li&gt;We can learn the amazing 7 experiments listed below.&lt;/li&gt;
&lt;li&gt;We can learn about publishing to Firefox AMO.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Experiments
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Building Motivational Tab&lt;/li&gt;
&lt;li&gt;Building Power Search Add-on&lt;/li&gt;
&lt;li&gt;Building Tabs Closer&lt;/li&gt;
&lt;li&gt;Building PDF WebPage Extension&lt;/li&gt;
&lt;li&gt;Building Water Notifier Extension&lt;/li&gt;
&lt;li&gt;Building Shortcuts for Youtube Controller&lt;/li&gt;
&lt;li&gt;Building Quick Stackoverflow searcher&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Download the book, try it share your experience.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>book</category>
    </item>
  </channel>
</rss>
