<?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"><channel><title><![CDATA[Sourav's Digital 📘 Notebook]]></title><description><![CDATA[Here are my writings on software, engineering, and everything in between. ✍🏻]]></description><link>https://blogs.souravdey.space</link><image><url>https://cdn.hashnode.com/uploads/logos/5f6b2169cbf0b22e6d4443b8/e86cf50d-5803-4b47-914e-1ea924acb067.png</url><title>Sourav&apos;s Digital 📘 Notebook</title><link>https://blogs.souravdey.space</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 11:42:41 GMT</lastBuildDate><atom:link href="https://blogs.souravdey.space/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[My Blog Syndication Strategy 📣]]></title><description><![CDATA[For a long time, I treated publishing a blog post like crossing a finish line. I would write the post, hit publish, share it once, and move on. It felt tidy. It also meant I kept confusing publication with discovery. 😅
My blog syndication strategy c...]]></description><link>https://blogs.souravdey.space/my-blog-syndication-strategy</link><guid isPermaLink="true">https://blogs.souravdey.space/my-blog-syndication-strategy</guid><category><![CDATA[Building in Public]]></category><category><![CDATA[Career]]></category><category><![CDATA[reflection]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Wed, 15 Apr 2026 12:00:00 GMT</pubDate><enclosure url="https://souravdey.space/images/blogs/blog-syndication-strategy/thumbnail.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>For a long time, I treated publishing a blog post like crossing a finish line. I would write the post, hit publish, share it once, and move on. It felt tidy. It also meant I kept confusing publication with discovery. 😅</p>
<p>My blog syndication strategy came from that mistake. 📌</p>
<p><strong>The source of truth lives on <a target="_blank" href="https://souravdey.space">souravdey.space</a>.</strong> <a target="_blank" href="https://dev.to/souravdey777">Dev.to</a> and <a target="_blank" href="https://blogs.souravdey.space/">Hashnode</a> help me distribute the same idea further, but they do not become the home of the work. That distinction sounds small until you have been writing long enough to care about URLs, long tails, and the difference between being discoverable and being dependent.</p>
<p>I wrote about this in <a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-4">Portfolio Website Development Part 4</a>, where I said I should have moved canonical hosting to my own domain much sooner. I meant that. The older I get in public writing, the less romantic I am about platforms. A platform is useful. A platform is not ownership.</p>
<h2 id="heading-the-workflow-at-a-glance">The workflow at a glance</h2>
<p>This is the shape I keep in my head.</p>
<p><strong>Flow:</strong> Write the blog, open a PR, merge it into main, then let GitHub Actions fan the post out to Dev.to, Hashnode, Medium, and the GitHub issue checklist.</p>
<p>The process is simple: I write the blog, I open a PR, and once that PR lands in <code>main</code>, GitHub Actions pick up the follow-up work.</p>
<p>At the command line, the ritual is small enough to remember:</p>
<pre><code class="lang-bash">yarn build
yarn crosspost -- blog-syndication-strategy
</code></pre>
<p>The first command checks whether the post can survive syndication cleanly. The second is the escape hatch I use when I want to inspect or trigger a single post by hand.</p>
<h3 id="heading-what-those-two-commands-actually-do">What those two commands actually do</h3>
<p>This looks tiny. It is not tiny.</p>
<p><code>yarn build</code> is my rehearsal. In this repo it does not just build the Next.js site. It runs <code>yarn check:syndication</code> first, then the site build. So before I ever merge, the pipeline has already asked a useful question: <strong>if this post leaves my website, will it still make sense?</strong></p>
<p><code>yarn crosspost -- slug</code> is narrower and more practical. It resolves one MDX file, reads the frontmatter, converts the body into platform-friendly Markdown, talks to the Dev.to and Hashnode APIs, and updates the saved crosspost state so the next run knows whether it is creating something new or updating something that already exists.</p>
<p>That division matters. One command protects quality. The other handles distribution.</p>
<p>The mental model in code is even simpler: publish once, then automate the platform copies that are truly repeatable.</p>
<pre><code class="lang-ts"><span class="hljs-keyword">const</span> syndicationTargets = [<span class="hljs-string">"Dev.to"</span>, <span class="hljs-string">"Hashnode"</span>] <span class="hljs-keyword">as</span> <span class="hljs-keyword">const</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">publish</span>(<span class="hljs-params">post</span>) </span>{
  publishCanonical(post);
  syndicationTargets.forEach(<span class="hljs-function">(<span class="hljs-params">target</span>) =&gt;</span> {
    crosspost(post, target);
  });
}
</code></pre>
<p><code>publishCanonical(post)</code> is the whole philosophy in one line. Home first. 🏠</p>
<p>Then the loop fans out only across targets that are predictable enough to automate. That is why the array is short. Dev.to and Hashnode fit that model. Medium does not sit in that loop because the action I care about there is different. I do not want “post some Markdown.” I want “import this canonical URL and preserve the original source.”</p>
<p>Medium stays outside that automated loop on purpose. I handle it manually through link import, because preserving the canonical URL matters more to me than forcing every destination to behave the same way.</p>
<p>There are GitHub Actions around this too. I think of them as guardrails, not magic. The local commands are how I work. The workflows are how I stop that process from depending on my memory.</p>
<h2 id="heading-canonical-first">Canonical first</h2>
<p>My site is where the post starts, where it gets updated, and where it stays.</p>
<p>That choice shapes everything else. I write in MDX under <code>src/content/blogs</code>, and the frontmatter decides whether a draft is ready to leave the building. If a post is published, the site treats it as part of the content graph, not as a one-off asset. Search, sitemap entries, RSS, structured data, and the page itself all point back to the same canonical home.</p>
<p>That is the part I care about most.</p>
<p>If someone finds me on Dev.to or Hashnode, I still want the post to know where home is. If search finds the original article, I want that version to be the one search engines remember. If I update the post later, the canonical copy should be the one that carries the truth forward.</p>
<p>Ownership is not just a philosophical preference. It is a maintenance strategy.</p>
<h2 id="heading-what-the-actual-loop-looks-like">What the actual loop looks like</h2>
<p>The loop is simpler than it sounds.</p>
<p>I write the post. I open a PR. Review happens there. When that PR lands in <code>main</code>, that is the moment the canonical post becomes live and the follow-up automation starts.</p>
<p>Before any of that merge machinery matters, <code>yarn build</code> runs the syndication checks locally so I get early feedback if a post contains something the crosspost pipeline cannot translate cleanly.</p>
<p>Then GitHub Actions repeat that discipline in CI.</p>
<h3 id="heading-what-the-github-actions-actually-do">What the GitHub Actions actually do</h3>
<p>The first workflow is <code>syndication-check.yml</code>. It runs on pull requests and on pushes to <code>main</code> when blog files or the syndication code changes. I like that detail more than I expected to. It means the check is not some vague “content pipeline” that wakes up for everything. It wakes up only when the parts that matter change. If I change the syndication logic, or I change a blog post that will be published, the workflow reruns the exact question I care about: <strong>can this MDX survive outside my site without falling apart?</strong></p>
<p>That workflow is the skeptical friend in the system. 👀 It does not publish anything. It just refuses to let me feel prematurely done.</p>
<p>At the YAML level, it is doing something very plain:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">on:</span>
  <span class="hljs-attr">pull_request:</span>
    <span class="hljs-attr">paths:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">"src/content/blogs/**"</span>
  <span class="hljs-attr">push:</span>
    <span class="hljs-attr">branches:</span> [<span class="hljs-string">main</span>]
</code></pre>
<p>That is not glamorous. It is also the reason the workflow feels trustworthy. It runs when blog content changes, and when the code that handles syndication changes. Not on every random edit in the repo.</p>
<p>The second workflow is <code>post-publish-blogs.yml</code>, and this one is the real follow-through. It runs only after content lands on <code>main</code>. That boundary matters to me. Drafting is one phase. Review is another. Distribution starts only when the canonical post is actually live on my domain.</p>
<p>Once that workflow wakes up, it diffs what changed, filters down to published blog slugs, and runs the follow-up work in one place. It can generate OG thumbnails when the image is missing, create audio, crosspost to Dev.to and Hashnode, send social announcements, and open the GitHub distribution checklist issue that reminds me about the manual side of the job. Medium lives there indirectly. Not as an automated API call, but as a deliberate item in the checklist.</p>
<p>The code path is surprisingly readable:</p>
<pre><code class="lang-ts"><span class="hljs-keyword">const</span> publishedSlugs = publishedBlogSlugsFromChanged(changed);

runOgThumbnails(publishedSlugs);
runAudio();
crosspostOk = runCrosspost(publishedSlugs);
socialOk = runSocialAnnounce(publishedSlugs);
runDistributionChecklist(publishedSlugs, crosspostOk, socialOk);
</code></pre>
<p>That sequence is the process in miniature. First figure out which published posts actually changed. Then do the repeatable work around them. Then open the checklist for the parts that still deserve a human hand.</p>
<p>That is the real payoff for me. I do not want to remember five slightly different publishing rituals. I want one publishing model. Let the machine handle repetition. Let me handle judgment.</p>
<p>The crosspost layer does the boring work well. Under the hood, it is basically this:</p>
<pre><code class="lang-ts"><span class="hljs-keyword">const</span> markdown = mdxToCrosspostMarkdown(body, siteUrl);
<span class="hljs-keyword">const</span> footer = originAttributionFooter(<span class="hljs-string">"souravdey.space"</span>, siteUrl);
</code></pre>
<h3 id="heading-what-that-conversion-code-is-really-doing">What that conversion code is really doing</h3>
<p>That little pair of lines carries most of the weight. It turns MDX into platform-friendly Markdown, absolutizes links, strips out components that only make sense on my site, and adds the attribution footer that tells readers where the original lives. In practice, that is the bridge between the thing I enjoy writing and the thing platforms are willing to accept.</p>
<p><code>mdxToCrosspostMarkdown</code> is the messy realism function in this whole setup. It is where custom site-only components stop being UI elements and start becoming readable plain Markdown. It is where local image paths become absolute URLs. It is where embeds that work beautifully on my site turn into links, summaries, or simplified fallbacks for platforms that do not know anything about my component system.</p>
<p><code>originAttributionFooter</code> is simpler, but maybe more important. It is the line that keeps ownership visible after the post travels. Without that footer, syndication can quietly become duplication. With it, the copied post still remembers where home is.</p>
<p>There is another small detail here that makes the whole setup feel grown-up to me. The post-publish workflow commits generated assets back with <code>[skip ci]</code>, so the automation does not keep waking itself up in a loop. That sounds like a tiny implementation detail. It is also the difference between “automation” and “a bot that eats its own tail.” ♻️</p>
<p><strong>A blog post is not done when I finish writing it. It is done when it survives distribution without losing its shape.</strong></p>
<p>That is a different bar.</p>
<h2 id="heading-the-github-issue-checklist">The GitHub issue checklist</h2>
<p>The automated path is only half the story. I also keep a GitHub issue open for the manual side of distribution, so Medium, social shares, and aggregator submissions do not live in my head. The issue is created from the post metadata and labeled <code>distribution</code> by the same follow-up workflow that handles crossposting.</p>
<p>That part matters more than it sounds. A lot of publishing systems look “automated” right up until the moment they quietly dump the human steps back into your brain. I did not want that. If a step is manual, I still want it in the system. Visible. Attached to the post, not floating around as a half-remembered note.</p>
<p><img src="https://souravdey.space/images/blogs/blog-syndication-strategy/distribution-checklist.png" alt="A dark themed GitHub issue checklist shows automated crossposts, manual Medium import, social shares, and aggregator submissions." /></p>
<p>The Medium row is still a direct link paste, because I want the import tool to preserve the canonical URL:</p>
<pre><code class="lang-md"><span class="hljs-bullet">-</span> [<span class="hljs-string"> </span>] [<span class="hljs-string">Medium</span>](<span class="hljs-link">https://medium.com/new-story</span>) <span class="hljs-emphasis">*(use Import tool to preserve canonical URL: https://souravdey.space/blogs/blog-syndication-strategy)*</span>
</code></pre>
<p>That line is intentionally verbose. I do not want future me guessing what “publish to Medium” meant on a sleepy evening.</p>
<p>And if I need to recreate the issue itself by hand, the CLI version is straightforward:</p>
<pre><code class="lang-bash">gh issue create --title <span class="hljs-string">"📢 Distribution: My Blog Syndication Strategy 📣"</span> --label distribution --body-file checklist.md
</code></pre>
<p>That checklist is the human half of the system. It catches the little things automation should not guess.</p>
<h2 id="heading-why-i-still-syndicate">Why I still syndicate</h2>
<p>I do not syndicate because I am unsure where my work belongs.</p>
<p>I syndicate because attention is fragmented, and readers do not all arrive through the same door. Some people discover a post through Dev.to. Some through Hashnode. Some through RSS. Some through search. Some land on my homepage because they already know my name. I want to meet all of them without making every post depend on one channel.</p>
<p>That is the balance I was after: reach without surrendering the original. ✨</p>
<p>If I only published on my own site, I would own everything and reach fewer people. If I only published on platforms, I would get reach and lose some control. Syndication is the middle path I actually believe in. It is not a compromise if the canonical story is strong.</p>
<p>There is also a softer reason. Crossposting makes my writing travel. A good post should be able to sit in different places and still feel like the same thought. That constraint makes me write cleaner, structure better, and keep my MDX honest. If a post depends too heavily on site-specific presentation, I usually need to think harder about whether the core idea stands clearly enough on its own.</p>
<h2 id="heading-the-tradeoffs-are-real">The tradeoffs are real</h2>
<p>I am not pretending this setup is free.</p>
<p>Every layer of automation adds another place where content can break. Some MDX components do not translate neatly. Some images need better alt text than I would otherwise bother with when I am in a hurry. Some internal links need to become absolute URLs on syndicated copies. That is why I like having <code>check:syndication</code> wired into the build. I would rather learn about a conversion problem before the post is public than after I have shared two broken copies.</p>
<p>There is also a mental tradeoff. Syndication can tempt you into caring too much about platform performance. I try not to let that happen. If Dev.to gets more clicks on one post and Hashnode gets more comments on another, that is interesting, but it is not the point. The point is that the original post stays intact, searchable, and under my control.</p>
<p><strong>I want the platform to amplify the writing, not define it.</strong></p>
<p>That line keeps me honest.</p>
<h2 id="heading-what-i-would-do-differently">What I would do differently</h2>
<p>I would move canonical hosting to my own domain even earlier.</p>
<p>That is the cleanest lesson in the whole thing. For years I cared too much about where a post could travel and not enough about where it should live. In <a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-4">Part 4</a> I admitted that. The older version of me thought syndication was a distribution decision. The better version of me sees it as an architecture decision.</p>
<p>I would also document my content conventions sooner. Once a site has more than one content type, memory stops being a reliable system. Frontmatter, tags, images, series, and syndication rules all start to interact. A short internal doc saves future me from guessing, and guessing gets expensive when it happens at publish time.</p>
<p>If I were starting again today, I would still syndicate. I would just be much less sentimental about the platform copy and much more protective of the original.</p>
<p>That is the whole strategy, really.</p>
<p>Write once. Keep the canonical copy at home. Let other platforms do the discovery work. Update the source, and let the copies follow.</p>
<p>The original should always know where home is. 🏠</p>
<hr />
<p><em>Originally published at <a target="_blank" href="https://souravdey.space/blogs/blog-syndication-strategy">souravdey.space</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Why Side Projects Compound 🏗️]]></title><description><![CDATA[For years I treated side projects like a second job I was failing at. 😅
I was still building. The fuel was not a trophy list. It was ideas: problems I could not drop, small "what ifs," things I wanted to exist whether or not anyone asked. Some turne...]]></description><link>https://blogs.souravdey.space/why-side-projects-compound</link><guid isPermaLink="true">https://blogs.souravdey.space/why-side-projects-compound</guid><category><![CDATA[Building in Public]]></category><category><![CDATA[Career]]></category><category><![CDATA[Product Engineering]]></category><category><![CDATA[Side Projects]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Mon, 06 Apr 2026 12:00:00 GMT</pubDate><enclosure url="https://souravdey.space/images/blogs/why-side-projects-compound/thumbnail.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>For years I treated side projects like a second job I was failing at. 😅</p>
<p>I was still building. The fuel was not a trophy list. It was <strong>ideas</strong>: problems I could not drop, small "what ifs," things I wanted to exist whether or not anyone asked. Some turned into code and demos. Some stayed half-born in notes. When something did ship, I parked it on <a target="_blank" href="https://souravdey.space/sideProjects">Side Projects</a> so I could point back without turning the build into a performance. The hard part was not a lack of sparks. It was guilt. Every hour on a personal repo felt like an hour I stole from rest, from my day job, from whatever version of adulthood the noise online says you should perform.</p>
<p>If you have ever closed your laptop at 1 AM 🌙 and thought, <em>this does not count</em>, you know the feeling.</p>
<p>Here is the lesson that took me too long to learn: <strong>side projects add up over time even when they never become startups.</strong> Not because every repo needs a prize. Because they train skills your sprint board rarely optimizes for. ✨</p>
<h2 id="heading-what-side-projects-teach-beyond-your-job">What side projects teach beyond your job 🧾</h2>
<p>At work, someone else shapes the problem, writes the ticket, and often picks the hard choices for you. That is not a knock on you. It is how real companies ship.</p>
<p>Side projects push you into the step before that: choosing what is worth building when no one asked, when the scope is yours, when the only deadline is your own pride. That is where you practice <strong>decisions when nothing is spelled out</strong>, the same habit that later helps when two technical options are both "fine" and someone has to pick.</p>
<p>You also get <strong>shipping in public</strong> if you publish the work. 📣 A private spike teaches syntax. A public repo teaches taste, communication, and the slow work of explaining your own mess.</p>
<p><img src="https://souravdey.space/images/blogs/why-side-projects-compound/show-your-work-learn-teach-cycle.png" alt="Austin Kleon's Show Your Work: Learn 🔁 Teach cycle" /></p>
<p><em>Figure from Austin Kleon's <a target="_blank" href="https://austinkleon.com/show-your-work/">Show Your Work!</a>.</em></p>
<p>That book is where I first saw the <strong>learn and teach</strong> loop drawn as one circle. You learn, you share what you know, and sharing feeds the next round of learning. Austin Kleon's "show your work" idea is not about showing off. It is about letting your thinking meet real people. I wrote about why that cycle is a career catalyst for builders, and how I use it in mentorship, <a target="_blank" href="https://www.linkedin.com/posts/souravdey777_techmentorship-learnandteach-careergrowth-activity-7242487643702231040-CVI7">in this LinkedIn post</a>.</p>
<p>And Guess what? The web is not fair. Polished demos can flop. Rough hacks can take off. You cannot chase likes without turning the whole thing into a second social media job. You can still chase <strong>practice reps</strong>: ship, write it down, cut scope, finish something. 🎯</p>
<h2 id="heading-what-compounding-means-for-side-projects">What compounding means for side projects 📈</h2>
<p>When I say compound, I do not mean every project becomes a clean story for interviews. I mean a set of skills that still help you after you stop opening the repo every week.</p>
<p><strong>Spotting patterns</strong> is the big one. After you debug your own auth flow, deploy surprises, and your own "why is this slow" hunts, incidents at work start to look familiar. The details change. The shape of the problem often does not.</p>
<p><strong>Knowing your tools</strong> is the quiet kind of compound interest. 🛠️ You learn a framework because a weekend idea needed it. Two years later that is not just a resume line. It is speed when the team needs a prototype, or when you read someone else's system and you actually get the constraints.</p>
<p><strong>Proof you can ship</strong> matters more than people say, especially early. ✅ Not proof you are a genius. Proof you can take an idea from zero to something another person can run. That is a different signal than "I finished courses."</p>
<p>There is a follow-on effect too. 🤖 You can ship side projects <strong>lightning fast</strong> now: AI handles boilerplate, glue code, and first drafts so an idea can become a working thing in hours, not weeks. As that wall gets lower, the hard part moves earlier. The rare skill is not typing UI faster. It is naming the problem, picking limits, and knowing what "good enough" means for a user. Side projects are a <strong>low-risk place</strong> to grow that product sense without treating a tutorial like owning a real feature.</p>
<p><strong>Product engineering</strong> is part of that same stack, and it grows fast when you <strong>build for yourself</strong>. You are the user, the scope owner, and the engineer in one loop, so tradeoffs land in your head instead of across three roles in a meeting. I wrote about why that mindset is the skill that survives when AI handles more of the code in <a target="_blank" href="https://souravdey.space/blogs/product-engineers-and-the-ai-era">product engineering in the AI era</a>.</p>
<h2 id="heading-side-projects-are-not-free">Side projects are not free ⚖️</h2>
<p>Growth needs finish lines, not only new ideas. If every spark becomes a new foundation and nothing ships, you get the joke instead of the skills.</p>
<p><img src="https://souravdey.space/images/blogs/why-side-projects-compound/commitstrip-west-side-project.png" alt="CommitStrip comic: a developer leaves a nearly done stone wall for a new wooden frame, says the old project was almost finished, and the last panel shows many half-built structures in a field" /></p>
<p><em>Strip: <a target="_blank" href="https://www.commitstrip.com/en/2014/11/25/west-side-project-story/">West Side-project story</a> (CommitStrip, 2014).</em></p>
<p>Side projects still cost something. Sleep. 😴 Relationships. The trap of using "hustle" to skip rest. I will not tell you every engineer needs a perfect GitHub graph. That is not wellness. It is stress with a brand. 😬</p>
<p>The useful idea is smaller: <strong>if you already build on the side, stop treating it like a character flaw.</strong> Call it practice that stacks over time, then guard your time like a grown person. A side project that ships in six weeks with weekends intact beats a "rewrite everything" dream that eats six months of guilt.</p>
<h2 id="heading-what-i-would-do-differently">What I would do differently 🧭</h2>
<p>I would pick smaller scope and celebrate done more loudly. I would treat docs as part of the product, not an afterthought, because future me is also a user. 📝</p>
<p>I would split real learning from "learning for the feed." Some spikes stay private. Not everything needs a post. The value still lands in your head. 🧠</p>
<p>Most of all, I would stop forcing side projects to prove themselves in the same frame as my job. They are not copies of each other. They are different gyms. One pays your salary. The other builds <strong>more choices</strong>, <strong>speed</strong>, and <strong>confidence</strong> when you see a work problem no one filed yet.</p>
<p>If you are building something odd this weekend and part of you feels guilty for not "optimizing" your career, that build might already be the optimization. Ship the smallest version. Ship it. Then step away.</p>
<p>The compound part was never the repo. It was the person all those reps built. ✨</p>
<hr />
<p><em>Originally published at <a target="_blank" href="https://souravdey.space/blogs/why-side-projects-compound">souravdey.space</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Product Engineering: The Only Skill That Survives AI 🏗️]]></title><description><![CDATA[I've been building customer-facing products for seven years now. From the Test Creation Experience used across 1.9M+ tests at HackerRank to GPT-4o powered features in production, I've seen what separates products that stick from those that get shelve...]]></description><link>https://blogs.souravdey.space/product-engineering-the-only-skill-that-survives-ai</link><guid isPermaLink="true">https://blogs.souravdey.space/product-engineering-the-only-skill-that-survives-ai</guid><category><![CDATA[AI]]></category><category><![CDATA[Career]]></category><category><![CDATA[engineering]]></category><category><![CDATA[product]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Mon, 30 Mar 2026 12:00:00 GMT</pubDate><enclosure url="https://souravdey.space/images/blogs/product-engineers-and-the-ai-era/thumbnail.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I've been building customer-facing products for seven years now. From the Test Creation Experience used across 1.9M+ tests at HackerRank to GPT-4o powered features in production, I've seen what separates products that stick from those that get shelved after three months of development.</p>
<p>Here's what I've learned: <strong>the only limitation in the AI era is product thinking.</strong></p>
<h2 id="heading-the-ai-acceleration-problem">The AI Acceleration Problem</h2>
<p>Everyone's talking about AI making us 10x faster. Write a prompt, get a component. Describe a feature, get working code. The demos are compelling. The productivity gains are real.</p>
<p>But here's what nobody's talking about: <strong>speed without direction is just expensive motion.</strong></p>
<p>I see engineers shipping faster than ever and wondering why their features don't land. They can build anything now. The question they can't answer is: what should I build? 🤔</p>
<p>That gap is product engineering.</p>
<h2 id="heading-what-product-engineering-actually-means">What Product Engineering Actually Means</h2>
<p>Product engineering isn't about choosing React over Vue. It's not about microservices architecture or deployment pipelines.</p>
<p>Product engineering is <strong>building with the user's problem as your north star</strong>, not the technology.</p>
<p>Back in 2023, I was discussing my promotion with my manager at HackerRank. Around the same time, I stumbled upon Gergely Orosz's <a target="_blank" href="https://blog.pragmaticengineer.com/the-product-minded-engineer/">The Product-Minded Software Engineer</a> on The Pragmatic Engineer blog. Reading it felt like someone had written down exactly what I do. Every trait he described, from proactive product ideas to end-to-end feature ownership, mapped to how I have been working for years. That article became my pitch for the promotion. I've never been the strongest "pure coder" in the room, but I've always been a solid product engineer. That's what sets me apart 💪 There is another book on this, <a target="_blank" href="https://www.oreilly.com/library/view/the-product-minded-engineer/9781098173722/">The Product-Minded Engineer</a> (November 2025) by Drew Hoskins, and it reinforces the same core truth: the engineers who have the most impact are the ones who care deeply about the product, not just the code.</p>
<p>When we built the Test Creation Experience at HackerRank, the engineering challenge wasn't the hardest part. The hard part was understanding that recruiters weren't failing to create tests because our UI was clunky. They were failing because they didn't know what good technical questions looked like in the first place.</p>
<p>The feature that moved the needle wasn't better form validation. It was a question recommendation engine that suggested problems based on the role they were hiring for.</p>
<p><strong>Product engineering is seeing the gap between what users say they want and what they actually need.</strong></p>
<p>For the longer career arc behind that idea, see <a target="_blank" href="https://souravdey.space/blogs/7-years-being-a-software-engineer">seven years as a software engineer</a>. For shipping under a brutal clock with a product-shaped goal.</p>
<h2 id="heading-why-ai-makes-this-more-critical-not-less">Why AI Makes This More Critical, Not Less</h2>
<p>In 2019, if you wanted to build a feature, you needed to:</p>
<ul>
<li>Design the database schema</li>
<li>Write the API endpoints</li>
<li>Build the frontend components</li>
<li>Handle edge cases and error states</li>
<li>Deploy and monitor</li>
</ul>
<p>That took weeks. The friction forced you to think: is this worth building?</p>
<p>In 2026, I can describe a feature to Claude and have working code in 20 minutes. The friction is gone. <strong>The forcing function for good judgment disappeared.</strong> 🫠</p>
<p>Now anyone can build anything. The engineers who survive aren't the ones who can prompt better. They're the ones who know what's worth building.</p>
<h2 id="heading-the-obsession-with-great-engineering">The Obsession With "Great Engineering"</h2>
<p>I've worked with brilliant engineers who could optimize a database query from 200ms to 15ms, architect systems that handle millions of requests, and debug race conditions in distributed systems.</p>
<p>Some of them built features nobody used. 😅</p>
<p>The ones who had impact? They started every conversation with: <strong>"What problem are we solving, and for whom?"</strong></p>
<p>They asked questions like:</p>
<ul>
<li>Who specifically has this problem?</li>
<li>How do they solve it today?</li>
<li>What would make them change their workflow?</li>
<li>How do we know if we fixed it?</li>
</ul>
<p>Those questions matter more than knowing the latest JavaScript framework.</p>
<h2 id="heading-my-product-engineering-principles">My Product Engineering Principles</h2>
<p>After seven years and dozens of shipped features, here's what I've learned:</p>
<p><strong>1. Fall in love with the problem, not your solution.</strong>
I've killed features I spent months building because user research showed we were solving the wrong problem. It hurt. But shipping the wrong thing perfectly is worse than not shipping at all.</p>
<p><strong>2. Build for one person first.</strong>
Every successful feature I've shipped started with understanding one specific user's workflow in detail. Generic "user personas" don't build products. Real humans with real problems do.</p>
<p><strong>3. The best code is code you don't write.</strong>
Before building anything, ask: what's the simplest thing that could work? Half the features I thought I needed to build turned out to be configuration changes.</p>
<p><strong>4. Measure behavior, not opinions.</strong>
Users will tell you they want feature X. Then you build feature X and nobody uses it. Watch what they do, not what they say they'll do.</p>
<h2 id="heading-the-ai-era-divide">The AI Era Divide</h2>
<p>I predict a split in our industry:</p>
<p><strong>AI-Assisted Code Writers:</strong> Fast at implementation, focused on technical craft. They can build anything you spec out.</p>
<p><strong>Product Engineers:</strong> Focused on what to build and why. They use AI as a tool to ship faster, but they're solving the right problems.</p>
<p>Both roles matter. But if you're building customer-facing products, <strong>you need to be in the second category.</strong></p>
<p>The companies that win in the AI era won't be the ones with the best AI engineers. They'll be the ones with the best product engineers who happen to use AI. 🚀</p>
<h2 id="heading-what-id-do-differently">What I'd Do Differently</h2>
<p>If I were starting my career today, I wouldn't spend time learning every new framework or AI tool that comes out.</p>
<p>I'd spend time with users. I'd sit in customer support calls. I'd read every piece of feedback. I'd understand how people actually work, not how I think they should work.</p>
<p>The frameworks change every two years. Understanding humans compounds forever.</p>
<p><strong>Product engineering isn't a nice-to-have anymore. In the AI era, it's how you stay relevant.</strong></p>
<p>The future belongs to engineers who can think like builders, not just coders. AI will handle the coding part. <strong>The building part still needs humans.</strong> ✨</p>
<hr />
<p><em>Originally published at <a target="_blank" href="https://souravdey.space/blogs/product-engineers-and-the-ai-era">souravdey.space</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[7 Years as a Software Engineer: What Actually Changed 💼]]></title><description><![CDATA[Green build. Staging fine. I still walked away feeling off 💻
The code did what we agreed on. The agreement was the broken part. That week stuck with me more than any refactor I have shipped since.
Seven years in, I still write code. I also still Goo...]]></description><link>https://blogs.souravdey.space/7-years-as-a-software-engineer-what-actually-changed-1</link><guid isPermaLink="true">https://blogs.souravdey.space/7-years-as-a-software-engineer-what-actually-changed-1</guid><category><![CDATA[Career]]></category><category><![CDATA[engineering]]></category><category><![CDATA[reflection]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Wed, 25 Mar 2026 12:00:00 GMT</pubDate><enclosure url="https://souravdey.space/images/blogs/7-years-being-a-software-engineer/thumbnail.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Green build. Staging fine. I still walked away feeling off 💻</p>
<p>The code did what we agreed on. <strong>The agreement was the broken part.</strong> That week stuck with me more than any refactor I have shipped since.</p>
<p>Seven years in, I still write code. I also still Google things I have looked up a hundred times, and I am fine admitting that. The job stopped being mostly syntax ages ago. It moved into requirements nobody wrote down, roadmaps that pretend six things are one thing, and the gap between what product imagines and what the system can honestly do. You feel that gap in your calendar before you feel it in the compiler.</p>
<p>I am not going to give you a promotion timeline or a framework bingo card.</p>
<p>Here is what moved in how I work, and what I would say to the version of me who was scared of sounding dumb in standup 🙈</p>
<h2 id="heading-the-first-shift-when-it-runs-is-not-the-win">🧭 The first shift: when “it runs” is not the win</h2>
<p>Early on I treated success like a checklist. Tests pass ✅ PR merged. Done. That bar matters. You cannot skip it.</p>
<p>The first time it failed me was ordinary. Everything behaved in staging, users were still unhappy, and the bug was the assumption behind the feature, not a null pointer.</p>
<p>These days I slow down before I type. Who is this actually for? What happens at 10x traffic? What is the cheapest way to prove we are wrong? I used to think those questions were someone else’s job.</p>
<p><strong>They are the job</strong> 🎯</p>
<p>Hackathons taught me scope is the real villain 🏃 Side projects taught me demos follow their own physics. HackerRank taught me the expensive problems sit between intent and reality. Same muscle, different costumes.</p>
<h2 id="heading-ambiguity-stopped-feeling-like-a-personal-failure">🌫️ Ambiguity stopped feeling like a personal failure</h2>
<p>Junior me assumed if I asked enough questions in one Slack thread, uncertainty would pack up and leave.</p>
<p>It does not work that way. Some fog only lifts after there is a real thing to poke at.</p>
<p>I stopped pretending I had it all figured out on day one. I try to pick a step we can undo, say the tradeoff out loud, and invite correction early. A rough prototype still beats a three-day thread. A written assumption beats a silent guess every time ✍️</p>
<p>I mentored at a hackathon once (<a target="_blank" href="https://souravdey.space/blogs/mentoring-hackathon-experience">notes from CentuRITon</a>), on the other side of the table. The struggling teams were rarely lazy. They were drowning in parallel goals 🌊 Helping them kill features felt like coaching courage, not debugging. I still use that instinct when a roadmap tries to ship six epics like they are one.</p>
<h2 id="heading-speed-quality-and-the-lie-of-having-both-for-free">⚖️ Speed, quality, and the lie of having both for free</h2>
<p>You have heard both sermons.</p>
<p>Move fast and break things. Quality is non-negotiable. Real teams live in the middle and rarely say the quiet part out loud.</p>
<p>What helped me was naming the tradeoff in a room full of people. If we optimize for learning speed, we accept rough edges and we instrument them. If we optimize for reliability, we skip shortcuts and we staff for that choice. The painful failure mode is when leadership says one priority and the calendar and incentives say another. Then you get slow and brittle together.</p>
<p><strong>No prize</strong> 💥</p>
<p>I still misread that alignment sometimes. I just catch it faster.</p>
<p>Sounds tiny. It cost a lot of Tuesday evenings to get there 🩹</p>
<h2 id="heading-communication-is-not-fluff-it-is-part-of-the-ship">💬 Communication is not fluff. It is part of the ship.</h2>
<p>I am not the person who “only wants to code.” Not because I love calendars 📅 Because when alignment drifts, it shows up as reverts, sharp tickets, and that quiet distrust nobody puts in writing.</p>
<p>A decent PR description. A diagram someone can find next month. A short note on why we picked this shape. Those things feel soft until you pay for not having them.</p>
<p>When I <a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-1">built this portfolio</a> in public, I realized people read the thinking, not only the pixels. Same thing shows up in code review and design feedback. They are judging whether they can trust your judgment.</p>
<h2 id="heading-competence-and-confidence-refuse-to-stay-in-sync">🧠 Competence and confidence refuse to stay in sync</h2>
<p>Call it imposter syndrome or call it a brain that loves your mistakes more than your wins.</p>
<p><strong>Same glitch.</strong></p>
<p>I stopped waiting for the doubt to vanish. I keep boring receipts now. What shipped. What broke. What I fixed. What someone else shipped because I unblocked them.</p>
<p>Loud moments under pressure helped once. They do not cure anything. They just remind you that you have done hard things before. Without the small receipts, one bad deploy on a random Tuesday eats the whole story 📉</p>
<h2 id="heading-what-actually-aged-well">🧰 What actually aged well</h2>
<p>Syntax turns over. Tools churn 🔄</p>
<p>The skills that kept paying were unglamorous. Reading a stack trace without ego. Tracing a bug across services and saying which layer lied 🐛 Knowing when a library saves time and when it hides the learning you still need.</p>
<blockquote>
<p>Any fool can write code that a computer can understand. Good programmers write code that humans can understand.</p>
<p>— Martin Fowler</p>
</blockquote>
<p>I still enjoy a gnarly bug.</p>
<p>I enjoy it less when the gnarl exists because nobody wrote how the system is supposed to behave. Docs are not admin homework. They are kindness to whoever is on call at 11 PM 🌙 Future you counts.</p>
<h2 id="heading-leadership-without-the-title">🤝 Leadership without the title</h2>
<p>Influence is not a level on a ladder.</p>
<p>It shows up in a clearer ticket, a safer rollback plan, a review comment that teaches instead of scores points. Sometimes it is saying I do not know when everyone else is improvising confidence 🤷</p>
<p>I have spent five years at HackerRank now 🌱 Sustained product engineering, for me, is not heroics. It is <strong>ownership.</strong> It is the quiet work of keeping a platform understandable while it grows.</p>
<h2 id="heading-what-i-would-tell-past-me">✉️ What I would tell past me</h2>
<p>Ask earlier. Ship smaller. Write down why you chose something, not only what you built.</p>
<p>Guard your attention the way you guard uptime, because it is the same finite resource.</p>
<p>Busy is not the same as useful. I am still learning that last one ⏳</p>
<h2 id="heading-what-still-feels-hard">🪨 What still feels hard</h2>
<p>Saying no without becoming the villain in someone else’s story. Estimating when the information is incomplete, without faking precision. Staying curious when the backlog is shouting. Remembering the win is not owning the thread. It is leaving the system less confusing than you found it.</p>
<p><strong>Seven years is not mastery</strong> 🎓</p>
<p>It is enough repetitions to spot the same traps: fake urgency, complexity sold as intelligence, teams confusing motion for progress. Enough time, too, to feel grateful for people who raised the bar 🙏 and a little gentler with myself when I was the bottleneck.</p>
<p>If you are earlier in the curve, the takeaway is smaller than everyone makes it sound.</p>
<p>Show up. Say the risky true thing. Make the next step obvious. Keep building.</p>
<p><strong>The code is only one part of the craft</strong> ✨</p>
<hr />
<p><em>Originally published at <a target="_blank" href="https://souravdey.space/blogs/7-years-being-a-software-engineer">souravdey.space</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Portfolio Website Development 🏗️ - Part 4]]></title><description><![CDATA[In Part 1 I sketched the stack and the Figma-led plan. In Part 2 I shipped a single-page Next.js site with scroll sections and Hashnode powering the latest posts. In Part 3 I described the late 2023 shape of the site: Next.js 13 with the App Router, ...]]></description><link>https://blogs.souravdey.space/portfolio-website-development-part-4</link><guid isPermaLink="true">https://blogs.souravdey.space/portfolio-website-development-part-4</guid><category><![CDATA[Next.js]]></category><category><![CDATA[portfolio]]></category><category><![CDATA[React]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Sun, 24 Aug 2025 12:00:00 GMT</pubDate><content:encoded><![CDATA[<p><img src="https://souravdey.space/images/blogs/portfolio-website-development-part-4/screenshot.png" alt="souravdey.space" /></p>
<p>In <a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-1">Part 1</a> I sketched the stack and the Figma-led plan. In <a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-2">Part 2</a> I shipped a single-page Next.js site with scroll sections and Hashnode powering the latest posts. In <a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-3">Part 3</a> I described the late 2023 shape of the site: Next.js 13 with the App Router, <strong>Contentlayer</strong> for MDX in the repo, and the first dedicated routes for blogs and mind nuggets. A lot has changed since then. This part is about the <strong>current</strong> souravdey.space: what it runs on, how content works, and why I optimized for maintainability and discoverability as much as for the hero section.</p>
<p>If you are reading this on the site, you are already looking at the outcome. If not, here is the same place: <a target="_blank" href="https://souravdey.space">souravdey.space</a>.</p>
<h2 id="heading-from-single-page-scroll-to-the-app-router">⚡ From single-page scroll to the App Router</h2>
<p>The old version felt right at the time: one long page, anchor navigation, a clear story. Over the years I wanted <strong>proper URLs</strong> for every blog and mind nugget, tag and series pages, and room to grow without turning one file into a kitchen sink.</p>
<p>Today the project is <strong>Next.js 15</strong> with the <strong>App Router</strong> (<code>src/app/</code>). Pages like <code>/blogs</code>, <code>/blogs/[slug]</code>, <code>/mindNuggets/[slug]</code>, <code>/mentorship</code>, and <code>/sideProjects</code> are first-class routes instead of sections inside a single view. That choice trades a bit of that original “one canvas” vibe for something closer to how people actually share and return to specific pieces of content.</p>
<h2 id="heading-content-lives-in-the-repo-not-only-in-apis">📦 Content lives in the repo, not only in APIs</h2>
<p>Part 2 mentioned moving blogs to <strong>MDX</strong> on the site. That migration is in place now. Posts and shorter pieces live under <code>src/content/</code> as <code>.mdx</code> files. <strong><a target="_blank" href="https://velite.js.org/">Velite</a></strong> validates frontmatter, runs the MDX pipeline (including syntax highlighting via <strong>rehype-pretty-code</strong>), and generates typed data under <code>.velite/</code> that the app imports through the <code>#content</code> alias.</p>
<p>Collections I use today include <strong>blogs</strong>, <strong>mind nuggets</strong>, <strong>ideas</strong>, and <strong>books</strong>. Blogs support tags, optional series, reading time from metadata, and a table of contents derived from headings. Publishing is a frontmatter flag, so drafts stay out of the sitemap and RSS until I flip them on.</p>
<p>No more fetching “latest four” from Hashnode for the homepage story. The narrative and SEO now center on <strong>this</strong> domain and <strong>this</strong> content graph.</p>
<h2 id="heading-seo-and-feeds-as-first-class-features">🔍 SEO and feeds as first-class features</h2>
<p>Shipping articles is only half the job if search and aggregators cannot see them cleanly. The current setup includes:</p>
<ul>
<li><strong><code>sitemap.ts</code></strong>: entries for published blogs and mind nuggets, plus tag and series index URLs and static pages.</li>
<li><strong><code>robots.ts</code></strong>: allows crawlers and points to the sitemap.</li>
<li><strong><code>feed.xml</code></strong>: RSS with Atom link for blogs (and related structure for discoverability).</li>
</ul>
<p>Per-page <strong><code>generateMetadata</code></strong> on dynamic routes sets titles, descriptions, Open Graph, and Twitter cards from frontmatter (including article dates and tags where it matters). <strong>JSON-LD</strong> covers sitewide <code>Person</code> and <code>WebSite</code> schema, with <strong>BlogPosting</strong> / <strong>Article</strong> style data on content pages so rich results have something consistent to read.</p>
<p>That is not glamour work, but it is the kind of work that compounds once you write in public for years.</p>
<h2 id="heading-ux-details-that-matter-day-to-day">UX details that matter day to day</h2>
<p>A few things I reach for myself when I use the site:</p>
<ul>
<li><strong>Theme toggle</strong> with persistence (light and dark), aligned with how the layout and CSS variables are structured.</li>
<li><strong>Global search</strong> over an index built from content, so jumping to a post or nugget does not depend on remembering the slug.</li>
<li><strong>Motion</strong> used sparingly for page transitions and small accents so the site still feels alive without fighting readability.</li>
<li><strong>MDX components</strong> (callouts, embeds, image grids) so posts are not plain walls of text when the topic needs more than paragraphs.</li>
</ul>
<p>These are not “features for a portfolio checklist.” They are the friction removers you notice once the content count grows.</p>
<h2 id="heading-stack-snapshot-high-level">Stack snapshot (high level)</h2>
<p>If you like a single glance:</p>
<ul>
<li><strong>Framework</strong>: Next.js 15 (App Router), React 18</li>
<li><strong>Styling</strong>: Tailwind CSS v4</li>
<li><strong>Content</strong>: MDX + Velite, content in <code>src/content/</code></li>
<li><strong>Deployment</strong>: still in the Vercel-shaped world you would expect for this stack</li>
<li><strong>Analytics</strong>: Google Analytics via Next’s third-party helper where configured</li>
</ul>
<p>Exact dependency versions belong in <code>package.json</code>; the point is the <strong>shape</strong> of the system: typed content, static generation where it fits, and metadata treated as part of the product.</p>
<h2 id="heading-what-i-would-do-differently">What I would do differently</h2>
<p>Hindsight is easy, but two things stand out.</p>
<p>First, I would have moved <strong>canonical hosting of posts</strong> to the personal domain earlier. Cross-posting and syndication are fine; owning the URL and the HTML long term matters more than I gave it credit for in 2021.</p>
<p>Second, I would document <strong>content conventions</strong> (frontmatter, tags, images, series) in one place as soon as the second post type appeared. Mind nuggets and blogs share patterns but are not identical. A short internal doc saves future me from guessing.</p>
<h2 id="heading-what-is-next">What is next?</h2>
<p>The site is never “done,” but the next improvements I care about are incremental: tighter performance budgets on heavy pages, more internal linking between related posts, and maybe reviving routes I parked behind comments in the nav when I have content worth showing there.</p>
<p>If you are building your own portfolio, you do not need this exact stack. You <strong>do</strong> need a plan for where writing lives, how URLs work, and how a stranger finds one specific thing you wrote. Get that right early; the gradient borders can wait.</p>
<p>✨ Thanks for reading this series. If a Part 5 shows up, it will probably be about something this stack enabled, not the stack itself.</p>
<hr />
<p><em>Originally published at <a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-4">souravdey.space</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Winning the HackGPT 2.0 Hackathon: 2nd Runner-up Position 🧑🏻‍💻]]></title><description><![CDATA[⏱️ 24 hours of non-stop building. ☕ 12 cups of coffee. 🃏 2 hours of poker (someone had to lose their dignity 😂). And somehow, in between all of that, we shipped a working AI-powered code quality platform that might actually change how developer ass...]]></description><link>https://blogs.souravdey.space/winning-the-hackgpt-20-hackathon-2nd-runner-up-position-1</link><guid isPermaLink="true">https://blogs.souravdey.space/winning-the-hackgpt-20-hackathon-2nd-runner-up-position-1</guid><category><![CDATA[Career]]></category><category><![CDATA[engineering]]></category><category><![CDATA[product]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Wed, 05 Jun 2024 12:00:00 GMT</pubDate><enclosure url="https://souravdey.space/images/blogs/2nd-runner-up-hackgpt-2/thumbnail.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>⏱️ 24 hours of non-stop building. ☕ 12 cups of coffee. 🃏 2 hours of poker (someone had to lose their dignity 😂). And somehow, in between all of that, we shipped a working AI-powered code quality platform that might actually change how developer assessments work.</p>
<p>This is the story of <strong>HackGPT 2.0, HackerRank's internal 24-hour hackathon during our May P&amp;E Offsite</strong>. Our team of 8 engineers reached 2nd runner-up position, but the real win was proving something the product team had been theorizing about for months: AI-powered holistic code review isn't just feasible, it's practical at scale.</p>
<p>Kudos to the entire team: <a target="_blank" href="https://www.linkedin.com/in/akakro/">Ankur</a>, <a target="_blank" href="https://www.linkedin.com/in/meankush/">Ankush</a>, <a target="_blank" href="https://www.linkedin.com/in/hannad-rehman/">Hannad</a>, <a target="_blank" href="https://www.linkedin.com/in/nattsudarshan/">Sudarshan</a>, <a target="_blank" href="https://www.linkedin.com/in/satyam-setia/">Satyam</a>, <a target="_blank" href="https://www.linkedin.com/in/dineshyadav009/">Dinesh</a>, and <a target="_blank" href="https://www.linkedin.com/in/dhruv-khirwar-b309b4118/">Dhruv</a> 🙏.</p>
<p><img src="https://souravdey.space/images/blogs/hackgpt2/team.png" alt="HackGPT 2.0 team with the 2nd runner-up prize cheque" /></p>
<h2 id="heading-the-problem-scoring-developers-on-a-single-axis">🎯 The Problem: Scoring Developers on a Single Axis</h2>
<p>Here's the reality of how most coding assessments work today: a candidate writes code, the platform runs testcases, and the output is a single number. Pass 7 out of 10 testcases? That's your score.</p>
<p>But anyone who's done a real code review knows that the score tells you almost nothing about the developer. Two candidates can both score 70%, but one of them wrote clean, well-structured code with thoughtful edge case handling, while the other brute-forced a solution with global variables everywhere and got lucky on the test cases.</p>
<p>The current model measures two things: correctness and partial performance. Everything else (code style, maintainability, security patterns, debugging skills, how the candidate actually <em>approached</em> the problem) is invisible.</p>
<p>This has real consequences. At enterprise scale, one of our customers was manually reviewing <strong>74,000 candidates per year</strong> to compensate for what automated scoring couldn't capture. That's over <strong>12,000 hours</strong> of engineering time spent on manual code review, every single year.</p>
<p>We wanted to build something that could see what the score can't.</p>
<h2 id="heading-designing-a-holistic-skill-profile">🗺️ Designing a Holistic Skill Profile</h2>
<p>Before writing any code, we spent the first couple of hours whiteboarding what a "complete" developer evaluation would actually look like. We landed on five dimensions:</p>
<p><strong>✅ Solution:</strong> Does the code work? Is it performant? This is the baseline that existing systems already cover.</p>
<p><strong>🧹 Code Quality:</strong> Is it readable? Is it maintainable? Would you want to inherit this codebase?</p>
<p><strong>🛡️ Reliability:</strong> Does the candidate think about security, scalability, exception handling, and technical design? These are the signals that separate a junior developer from a senior one.</p>
<p><strong>♿ User Experience:</strong> Does the code consider accessibility? This is especially relevant for frontend assessments.</p>
<p><strong>🧠 Logical Progression:</strong> This is the one that got us most excited. Instead of just reviewing the final submission, what if we could understand <em>how</em> the candidate got there? Their debugging patterns, their persistence when stuck, the moments where they pivoted their approach.</p>
<p>That last dimension is what made our project different from "just another AI code reviewer." We weren't just analyzing code. We were analyzing the <em>process</em> of writing code.</p>
<h2 id="heading-the-architecture-plus-12-cups-of-coffee">🏗️ The Architecture (Plus 12 Cups of Coffee)</h2>
<p>Hour 3. Whiteboard phase over. Coffee cup #3. Time to build.</p>
<p>We designed the system as a standalone platform service, intentionally decoupled from any single product UI so it could eventually plug into screening, interviews, and skill assessments across the board.</p>
<p>The data flow looks like this:</p>
<p><strong>⌨️ Keystroke ingestion:</strong></p>
<p><strong>Flow:</strong> Assessment Frontend → Attempt Processing Worker → Candidate DB</p>
<p><strong>🔬 Code quality analysis:</strong></p>
<p><strong>Flow:</strong> Candidate DB → Code Quality Platform Service → Core API</p>
<p><strong>🤖 AI review engine:</strong></p>
<p><strong>Flow:</strong> Code Review Rubric → Next.js App → AI Platform (LLM)</p>
<p>The <strong>Code Quality Platform Service</strong> is the central piece. It receives attempt data (including raw keystroke streams), runs a combination of static analysis and LLM-powered review against a configurable rubric, and pushes structured results back to the API layer for rendering.</p>
<p>The <strong>Next.js app</strong> handles the review orchestration, consuming rubric definitions and coordinating with the AI platform to produce categorized, line-level code comments.</p>
<p>And then there was the part I spent most of my 24 hours on.</p>
<h2 id="heading-my-contribution-turning-keystrokes-into-a-time-machine">⏪ My Contribution: Turning Keystrokes into a Time Machine</h2>
<p>Here's the thing about keystroke data: it's raw. Really raw. A stream of individual key events with timestamps. Insert character. Delete character. Cursor move. Paste. Undo. Thousands of events per coding session.</p>
<p>My job was to turn that raw stream into something an AI reviewer could actually reason about.</p>
<p>I built a <strong>keystroke serialization engine</strong> that reconstructs snapshots of the candidate's code at configurable intervals. Instead of just handing the LLM the final submission and saying "review this," the engine generates a sequence of code states, a snapshot every <em>n</em> keystrokes, that captures the candidate's code at different points in their journey.</p>
<p>Think of it like git commits, but automatic and granular 📸. Snapshot at keystroke 50. Snapshot at keystroke 150. Snapshot at keystroke 300. Each one is a frozen moment of the candidate's progress.</p>
<p>This changes what the AI reviewer can see. It's not just <em>what</em> the candidate wrote, it's <em>how</em> they got there 🕵️.</p>
<p>Did they start with a brute-force approach and refactor? Did they handle the happy path first and then circle back for edge cases? Did they get stuck on a syntax error for 10 minutes or catch it in 30 seconds? Did they delete half their code and restart with a better approach, or did they keep patching a broken foundation?</p>
<p>The configurable gap parameter is where the real tradeoff lives: you tune snapshot frequency based on question complexity. For a quick algorithm question, every 30 keystrokes gives enough resolution. For a longer system design problem, every 100.</p>
<blockquote>
<p>More granular snapshots = more LLM calls, higher latency, and higher inference cost. The cost-to-resolution curve is a real production problem this approach needs to address before it can scale.</p>
</blockquote>
<p>On top of the serialization engine, I built the <strong>Next.js frontend</strong> that surfaces all of this: the code playback UI, the inline AI review comments, and the attempt timeline that shows the candidate's phases visually.</p>
<p>By hour 18, keystroke-to-snapshot serialization was working end to end. By hour 22, it was integrated with the AI review pipeline and rendering in the UI. The last two hours were pure polish and demo prep (and coffee cups #11 and #12).</p>
<h2 id="heading-what-the-ai-reviewer-actually-outputs">📊 What the AI Reviewer Actually Outputs</h2>
<p>The review engine produces structured, line-level comments. Not vague "this could be better" feedback, but specific, categorized, severity-tagged observations:</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"severity"</span>: <span class="hljs-string">"High"</span>,
  <span class="hljs-attr">"category"</span>: <span class="hljs-string">"Code Style"</span>,
  <span class="hljs-attr">"lines"</span>: <span class="hljs-string">"5-6"</span>,
  <span class="hljs-attr">"comment"</span>: <span class="hljs-string">"Extensive use of global variables. Leads to unexpected side effects and complicates debugging."</span>
}
</code></pre>
<p>These comments overlay directly on the code playback, so a reviewer sees the AI's observations at the exact lines where issues appear.</p>
<p>Beyond line-level feedback, the system generates an <strong>Attempt Summary</strong>, a natural-language overview designed for non-technical hiring stakeholders. It includes a composite score, a phase timeline (initial setup → debugging → edge-case handling → optimization), and structured highlights and lowlights.</p>
<blockquote>
<p>Defined evaluation criteria fed as structured prompts is what makes LLM code review reliable enough to surface to hiring teams. Without the rubric layer, you get opinions. With it, you get a repeatable process.</p>
</blockquote>
<h2 id="heading-24-hours-of-in-office-hackathon-culture">🌙 24 Hours of In-Office Hackathon Culture</h2>
<p>I want to talk about the vibe for a second, because it matters.</p>
<p>There's something different about building alongside your team in a room at 3 AM with empty coffee cups and a deadline. The brainstorming is faster. The decisions are bolder. Nobody's overthinking a PR review. You're just shipping. The energy of an in-office hackathon compresses months of "we should build this someday" into one intense, focused burst.</p>
<p>The first hour was chaos, eight people talking over each other about what to build. Then someone pulled up a whiteboard and it clicked. The next 22 hours were a mix of deep focus sprints, quick syncs standing around someone's laptop, and exactly the right amount of distraction (the poker game was competitive, I'll leave it at that 🃏).</p>
<p>This is the stuff that builds team trust. You learn more about how someone thinks and works in 24 hours of hackathon pressure than in months of regular sprint work.</p>
<h2 id="heading-from-hackathon-to-product">🚀 From Hackathon to Product</h2>
<p>By demo time, we had two things working end to end:</p>
<ol>
<li>A fully operational <strong>Code Quality Platform Service</strong>: keystroke ingestion, snapshot serialization, AI-powered multi-dimensional review, and structured output via API.</li>
<li>A working <strong>frontend integration</strong>: inline code review comments, skill dimension indicators, attempt timeline, and natural-language summary, all rendered in the assessment UI.</li>
</ol>
<p>We placed <strong>2nd runner-up</strong> 🥉 out of all teams at HackGPT 2.0. More importantly, the prototype demonstrated something the product team had been theorizing about for months: that AI-powered holistic code review is not just feasible, but practical at scale.</p>
<p>Our CEO later called it out publicly 📢:</p>
<p><a target="_blank" href="https://twitter.com/rvivek/status/1825563452229767607">Post on X</a></p>
<p>That validation felt great 🙌. But what I keep thinking about is the second-order implication: if keystroke data becomes a first-class evaluation signal, the way assessments get <em>designed</em> changes. Question complexity, time windows, the balance between free-form coding and structured problems, all of it needs rethinking. The technology isn't the hard part. Rethinking the assessment design around it is 🤝.</p>
<h2 id="heading-what-i-learned">💡 What I Learned</h2>
<ul>
<li><p>⛏️ <strong>Keystroke data is an underrated goldmine.</strong> Most platforms throw it away or use it only for proctoring. Treating it as a first-class data source for skill assessment opens up an entirely new evaluation dimension.</p>
</li>
<li><p>🤖 <strong>LLMs are good at code review, with guardrails.</strong> You can't just dump code into an LLM and expect consistent, structured output. The rubric-driven approach, where you define evaluation criteria separately and feed them as structured prompts, is what makes the output reliable enough to surface to hiring teams.</p>
</li>
<li><p>⚡ <strong>Hackathons compress learning.</strong> I went deeper on keystroke event processing, snapshot reconstruction, and LLM orchestration in 24 hours than I would have in weeks of regular work. Constraints breed focus.</p>
</li>
</ul>
<p>Eight people with different expertise areas, 24 hours, one shared vision. That's how real systems get built ✨</p>
<hr />
<p><em>Originally published at <a target="_blank" href="https://souravdey.space/blogs/2nd-runner-up-hackgpt-2">souravdey.space</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Portfolio Website Development 🏗️ - Part 3]]></title><description><![CDATA[This blog is the 3rd part after Portfolio Website Development - Part 1 and Part 2.
Part 2 ended with a single long page: anchor jumps, Hashnode pulling the latest four posts, and a layout I still liked visually. The problem showed up in day-to-day us...]]></description><link>https://blogs.souravdey.space/portfolio-website-development-part-3</link><guid isPermaLink="true">https://blogs.souravdey.space/portfolio-website-development-part-3</guid><category><![CDATA[Next.js]]></category><category><![CDATA[portfolio]]></category><category><![CDATA[React]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Sat, 28 Oct 2023 12:00:00 GMT</pubDate><enclosure url="https://souravdey.space/images/blogs/portfolio-website-development-part-3/screenshot.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://souravdey.space/images/blogs/portfolio-website-development-part-3/screenshot.png" alt="souravdey.space" /></p>
<p>This blog is the 3rd part after <strong><a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-1">Portfolio Website Development - Part 1</a></strong> and <strong><a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-2">Part 2</a></strong>.</p>
<p>Part 2 ended with a single long page: anchor jumps, Hashnode pulling the latest four posts, and a layout I still liked visually. The problem showed up in day-to-day use. I kept pasting links and then typing “scroll to…” or sending people to Hashnode for the full post. That is fine for a launch story. It is a bad fit when you actually want <strong>this domain</strong> to be where the writing lives.</p>
<p>So I rebuilt the shape of the site around <strong>real routes</strong> and <strong>MDX in the repo</strong>.</p>
<h2 id="heading-nextjs-13-and-the-app-router">⚡ Next.js 13 and the App Router</h2>
<p>I am on <strong>Next.js 13.4.x</strong> with the <strong>App Router</strong> (<code>experimental.appDir</code> in <code>next.config.js</code>). The <strong><code>src/app/</code></strong> tree now owns <code>/</code>, <code>/blogs</code>, <code>/blogs/[slug]</code>, <code>/mindNuggets</code>, <code>/mindNuggets/[slug]</code>, nested <code>/aboutMe/*</code>, <code>/ideas</code>, <code>/mentorship</code>, and the rest. Clicking the menu is navigation, not <code>scrollIntoView</code> on one canvas.</p>
<p>The tradeoff is honest: I lost some of that “one continuous landing page” feel. I gained URLs I can drop in a DM, Open Graph that points at <strong>souravdey.space</strong>, and room to grow without turning <code>page.tsx</code> into a junk drawer.</p>
<h2 id="heading-contentlayer-mdx">📦 Contentlayer + MDX</h2>
<p>Blogs and mind nuggets are <strong><code>.mdx</code> files under <code>src/content/</code></strong>. <strong><a target="_blank" href="https://contentlayer.dev/">Contentlayer</a></strong> with <strong><code>next-contentlayer</code></strong> is what turns those files into typed documents and generated imports from <strong><code>contentlayer/generated</code></strong> (<code>allBlogs</code>, and the same pattern for other types). My build is <code>yarn contentlayer build &amp;&amp; next build</code>.</p>
<p>In <code>contentlayer.config.js</code> I defined <strong>Blog</strong>, <strong>MindNugget</strong>, <strong>Idea</strong>, and <strong>Book</strong> document types. MDX goes through <strong>remark-gfm</strong>, <strong>rehype-slug</strong>, <strong>rehype-pretty-code</strong> (Shiki, <code>github-dark</code>), and <strong>rehype-autolink-headings</strong> so code blocks and headings behave the way I expect in long posts.</p>
<p>The homepage still composes <strong><code>intro.mdx</code></strong> and friends via <strong><code>@next/mdx</code></strong>, with <strong><code>experimental.mdxRs</code></strong> where it helps. Two MDX paths sound like extra noise. In practice it let me ship the marketing shell and the article pipeline without blocking one on the other.</p>
<h2 id="heading-styling-and-motion">🎨 Styling and motion</h2>
<p>I did <strong>not</strong> move to Tailwind for this pass. Most surfaces use <strong>CSS Modules</strong> (<code>page.module.css</code>, component-level <code>*.module.css</code>) plus tokens in <strong><code>globals.css</code></strong>. <strong><code>prefers-color-scheme: dark</code></strong> drives a simple light or dark flip through CSS variables so I get a baseline theme without a custom toggle yet.</p>
<p><strong>Framer Motion</strong> is still doing the heavy lifting for scroll progress and the small transitions that stop long pages from feeling dead. Icons are <strong>lucide-react</strong> and <strong>@icons-pack/react-simple-icons</strong> where I need brand marks.</p>
<h2 id="heading-tooling-snapshot">Tooling snapshot</h2>
<p><strong>Node 18.x</strong> in <code>engines</code>, <strong>React 18.2</strong>, <strong>TypeScript 5.0.x</strong>, <strong>eslint-config-next</strong>. On blog pages <strong>dayjs</strong>, <strong>reading-time</strong>, and <strong>clsx</strong> handle dates, read time, and class names. Nothing here is trying to be clever. It is the stack I could operate while still shipping features after work.</p>
<h2 id="heading-what-is-next">What is next?</h2>
<ul>
<li>Tighten metadata and sharing cards per route so every blog and nugget looks right when linked on Twitter or LinkedIn.</li>
<li>Keep pulling more writing off third-party hosts so <strong>souravdey.space</strong> stays the canonical place.</li>
<li>Revisit the <code>/aboutMe</code> subtree and side pages so they match the same content model where it makes sense.</li>
<li>I am sure I will find ten more rough edges once I stop touching the same three files on repeat.</li>
</ul>
<p>If you are on a similar journey: <strong>routes first, content compiler second, polish third</strong>. I spent too long in Part 2 pretending scroll targets were URLs. Fixing that unlocked everything else.</p>
<p>✨ Live site: <a target="_blank" href="https://souravdey.space">souravdey.space</a></p>
<hr />
<p><em>Originally published at <a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-3">souravdey.space</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[My Hackathon Mentoring Experience 🚀]]></title><description><![CDATA[I’ve been on the hacker side of hackathons: Google Cloud DevJam, PandoConnect, the 2 AM debugging sessions, the scramble to get a demo working with 20 minutes left. I know that feeling. So when I got the chance to mentor at the CentuRITon Hackathon, ...]]></description><link>https://blogs.souravdey.space/my-hackathon-mentoring-experience</link><guid isPermaLink="true">https://blogs.souravdey.space/my-hackathon-mentoring-experience</guid><category><![CDATA[Career]]></category><category><![CDATA[hackathon]]></category><category><![CDATA[mentoring]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Sat, 26 Nov 2022 12:00:00 GMT</pubDate><content:encoded><![CDATA[<p>I’ve been on the hacker side of hackathons: <a target="_blank" href="https://souravdey.space/blogs/google-cloud-devjam-hackathon">Google Cloud DevJam</a>, <a target="_blank" href="https://souravdey.space/blogs/pandoconnect-a-social-media-to-share-inspire-and-fight-the-pandemic-together">PandoConnect</a>, the 2 AM debugging sessions, the scramble to get a demo working with 20 minutes left. I know that feeling. So when I got the chance to mentor at the <strong>CentuRITon Hackathon</strong>, a 72-hour event organized by Ramaiah Institute of Technology, I said yes immediately.</p>
<p>10 teams. 72 hours. And me on the other side of the table for the first time.</p>
<p><img src="https://souravdey.space/images/blogs/my-hackathon-mentoring-experience/01.jpeg" alt="Sourav at the CentuRITon Hackathon, mentoring teams at Ramaiah Institute of Technology" /></p>
<h2 id="heading-the-biggest-lesson-scope-is-the-real-enemy">The biggest lesson: scope is the real enemy 🎯</h2>
<p>Here’s the pattern I saw across almost every team. Hour 1: “We’re going to build a full-stack app with auth, real-time chat, ML-powered recommendations, and a mobile app.” Hour 20: stuck on setting up the database. Hour 40: panic.</p>
<p>The hardest thing I did wasn’t debugging code. It was convincing teams to kill features. To take their “we want to do X, Y, and Z” and turn it into “let’s nail X first, make the demo tell a clear story, and see where we land.” That conversation happened with almost every team I mentored.</p>
<p>One team wanted to build a health-tracking platform with 6 features. I asked them: “If the judges only remember one thing about your project, what should it be?” They thought about it and said “the medication reminder from a photo of the prescription.” Cool, that’s the product. The other 5 features are distractions. Build that one thing well. They did. And their demo was 10x sharper because of it.</p>
<blockquote>
<p>Scope isn’t a planning problem. It’s a courage problem. Cutting a feature you’re excited about feels like losing. But shipping one thing that works beats demoing five things that don’t.</p>
</blockquote>
<h2 id="heading-what-i-actually-spent-my-time-on">What I actually spent my time on</h2>
<p>Most of my 72 hours went into three things:</p>
<ul>
<li><strong>Idea sharpening</strong> 🎯: Not “is this a good idea?” but “is this a buildable idea in 72 hours?” Two very different questions. I helped teams find the smallest version of their product that still told a complete story.</li>
<li><strong>Technical unblocking</strong> 🔧: Stack decisions, API choices, and the occasional “your CORS issue is because you forgot the trailing slash” moment 😅. Sometimes the mentor’s job is just to be the person who’s seen that error before.</li>
<li><strong>Scope negotiations</strong> ✂️: The hardest part. Helping teams let go of features they loved because the clock was real. “You can always build v2 after the hackathon” became my most-used line.</li>
</ul>
<p>The thing nobody tells you about mentoring: you’re not there to have all the answers. You’re there to ask the right questions. “What’s the one thing your user needs?” cuts through more confusion than any technical advice.</p>
<p><img src="https://souravdey.space/images/blogs/my-hackathon-mentoring-experience/02.jpeg" alt="An active mentoring session, working through a team's idea and architecture at CentuRITon" /></p>
<h2 id="heading-offline-hackathons-hit-different">Offline hackathons hit different 🏟️</h2>
<p>After years of online-only events, being in a room full of people building things was something else. You could walk up to a team’s table, look at their screen, sketch an architecture on a whiteboard, and feel the energy shift when something clicks. The 3 AM coffee runs. The “wait, it’s working!” moments echoing across the hall.</p>
<p>The next generation of builders isn’t just sitting in classrooms absorbing theory. They’re shipping real projects, learning in public, and helping each other debug at 2 AM. That’s the kind of thing that keeps the ecosystem alive.</p>
<p><img src="https://souravdey.space/images/blogs/my-hackathon-mentoring-experience/03.jpeg" alt="CentuRITon Hackathon venue, teams building their projects across the 72-hour event" /></p>
<h2 id="heading-the-people-matter-more-than-the-projects">The people matter more than the projects 🤝</h2>
<p>The projects were great. But honestly, the conversations were better. I got to connect with <strong>Ananya</strong> and <strong>Ashutosh</strong>, sharp, driven people who were there to build and to help others build. The hallway conversations, the impromptu whiteboard sessions, the post-event reflections: that’s what I remember most. Not the tech stacks. The people.</p>
<h2 id="heading-what-mentoring-taught-me-about-my-own-work">What mentoring taught me about my own work</h2>
<p>Here’s the thing nobody tells you about being on the mentor side: you learn more about your own gaps than your mentees’. Explaining “why” behind a technical decision, not just “what”, forces you to examine whether you actually understand it yourself. There were moments when a team asked me something and I thought, “huh, I’ve been doing this on autopilot for years and never questioned it.”</p>
<p>Teaching is debugging your own understanding 🧠</p>
<hr />
<p>If you’ve only ever been on the hacker side, try mentoring at least once. You’ll see the same problems from a completely different angle, and you’ll realize that the skill of shipping under constraints isn’t just about code. It’s about decisions. What to build, what to cut, and when to stop polishing and start demoing.</p>
<p>And if you were at CentuRITon and we crossed paths, thanks for the 72 hours. It was a blast ✨</p>
<p>You can also find my shorter take on the same event <a target="_blank" href="https://www.linkedin.com/posts/souravdey777_the-weekend-went-well-i-attended-activity-7002682505866719233-wu9S">on LinkedIn</a>.</p>
<hr />
<p><em>Originally published at <a target="_blank" href="https://souravdey.space/blogs/mentoring-hackathon-experience">souravdey.space</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[YouTube Live with PrepInsta and Careerboat 🎥]]></title><description><![CDATA[I got invited by PrepInsta and Careerboat for a YouTube live on a topic I care a lot about: how freshers can land good tech jobs without coming from a "target" college or having FAANG on their resume.]]></description><link>https://blogs.souravdey.space/youtube-live-with-prepinsta-and-careerboat</link><guid isPermaLink="true">https://blogs.souravdey.space/youtube-live-with-prepinsta-and-careerboat</guid><category><![CDATA[engineering]]></category><category><![CDATA[Career]]></category><category><![CDATA[software development]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Sat, 27 Aug 2022 12:00:00 GMT</pubDate><content:encoded><![CDATA[<p>I got invited by <a href="https://prepinsta.com/home/">PrepInsta</a> and <a href="https://www.careerboat.io/">Careerboat</a> for a YouTube live on a topic I care a lot about: how freshers can land good tech jobs without coming from a "target" college or having FAANG on their resume.</p>
<p>This one's personal. I went from TCS Digital Cadre (top 1,500 of 60,000 employees) to HackerRank. That path wasn't obvious and nobody handed it to me. So when PrepInsta asked me to share what I'd learned, I said yes.  </p>
<p><a class="embed-card" href="https://www.youtube.com/watch?v=C8kML0IEwr8">https://www.youtube.com/watch?v=C8kML0IEwr8</a></p>

<h2>What I talked about 🎙️</h2>
<h3>My journey from TCS to HackerRank</h3>
<p>The full story: how I got into TCS Digital Cadre, what I learned building products there (TCS ClickFit, Google Cloud services, the works), and how I made the jump to a product company. The short version: side projects, hackathons, and showing up consistently in public. The long version is in the video 👆</p>
<h3>The projects that actually matter 🔧</h3>
<p>Not "build a to-do app." I'm talking about projects that solve a real problem, use real APIs, and ship to real users. <a href="https://souravdey.space/blogs/hashnode-blog-cards">Hashnode Blog Cards</a>, <a href="https://souravdey.space/blogs/how-i-created-my-covid-19-info-bot">COVID-19 Info Bot</a>, <a href="https://souravdey.space/blogs/pandoconnect-a-social-media-to-share-inspire-and-fight-the-pandemic-together">PandoConnect</a>. Every one of these taught me something that interviews couldn't test and courses couldn't teach. The projects you build outside of work are your proof of curiosity. Hiring managers notice that.</p>
<h3>Skills that actually get you hired 🎯</h3>
<ul>
<li><p><strong>Building things end-to-end</strong>: not just "I know React" but "I built a product from Figma to deploy and here's the repo." Full-stack thinking matters even if your role is frontend.</p>
</li>
<li><p><strong>Learning in public</strong>: blogs, open source contributions, LinkedIn posts. Your GitHub profile and your writing are your portfolio. They speak louder than your resume.</p>
</li>
<li><p><strong>Communication</strong>: the most underrated skill in tech. The developer who can explain their technical decisions clearly will always stand out over the one who can only code silently.</p>
</li>
</ul>
<h3>The mindset shift nobody talks about 🧠</h3>
<p>College teaches you to solve problems that have known answers. Industry gives you problems with no clear answer, shifting requirements, and 4 stakeholders with different opinions. The sooner you make that mental shift, from "find the right answer" to "make a good decision with incomplete information", the faster you grow.</p>
<h3>Personal branding isn't cringe, it's leverage 📢</h3>
<p>I know "personal branding" sounds like LinkedIn buzzword territory. But here's what it actually means: be visible. Write about what you learn. Share your projects. Help others. Over time, opportunities start finding you instead of the other way around. My Topmate mentoring, speaking invitations, and even the HackerRank opportunity, all of these came from putting work out in public.</p>
<hr />
<p>Thanks <a href="https://prepinsta.com/home/">PrepInsta</a> and <a href="https://www.careerboat.io/">Careerboat</a> for having me on. If even one person watching that live decided to start building a project instead of collecting another certificate, it was worth the hour ✨</p>
<hr />
<p><em>Originally published at</em> <a href="https://souravdey.space/blogs/youtube-live-with-prepinsta-and-careerboat"><em>souravdey.space</em></a><em>.</em></p>
]]></content:encoded></item><item><title><![CDATA[LeetCode Question - 509. Fibonacci Number 🤪]]></title><description><![CDATA[About the Series
Problem-solving is a key skill set for any tech-related stuff you might be working on.
When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.
So, this serie...]]></description><link>https://blogs.souravdey.space/leetcode-question-509-fibonacci-number</link><guid isPermaLink="true">https://blogs.souravdey.space/leetcode-question-509-fibonacci-number</guid><category><![CDATA[Daily LeetCode Challenge]]></category><category><![CDATA[#dailyLeetcodeChallenge]]></category><category><![CDATA[leetcode]]></category><category><![CDATA[data structures]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Thu, 07 Jul 2022 08:07:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1657181110738/cAz_IYHvw.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-about-the-series">About the Series</h3>
<p>Problem-solving is a key skill set for any tech-related stuff you might be working on.</p>
<p>When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.</p>
<p>So, this series of blogs is all about practicing Daily LeetCode Challenges &amp; Problem-solving. 🚀</p>
<h3 id="heading-problem-statement">Problem Statement</h3>
<p><a target="_blank" href="https://leetcode.com/problems/fibonacci-number/"><strong>Fibonacci Number</strong></a></p>
<blockquote>
<p>The Fibonacci numbers, commonly denoted <code>F(n)</code> form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is,</p>
<ul>
<li><code>F(0) = 0, F(1) = 1</code></li>
<li><code>F(n) = F(n - 1) + F(n - 2), for n &gt; 1.</code></li>
</ul>
<p>Given n, calculate F(n).</p>
</blockquote>
<p><strong>Example 1:</strong></p>
<pre><code><span class="hljs-attribute">Input</span>: n = <span class="hljs-number">2</span>
<span class="hljs-attribute">Output</span>: <span class="hljs-number">1</span>
<span class="hljs-attribute">Explanation</span>: F(<span class="hljs-number">2</span>) = F(<span class="hljs-number">1</span>) + F(<span class="hljs-number">0</span>) = <span class="hljs-number">1</span> + <span class="hljs-number">0</span> = <span class="hljs-number">1</span>.
</code></pre><p><strong>Example 2:</strong></p>
<pre><code><span class="hljs-attribute">Input</span>: n = <span class="hljs-number">3</span>
<span class="hljs-attribute">Output</span>: <span class="hljs-number">2</span>
<span class="hljs-attribute">Explanation</span>: F(<span class="hljs-number">3</span>) = F(<span class="hljs-number">2</span>) + F(<span class="hljs-number">1</span>) = <span class="hljs-number">1</span> + <span class="hljs-number">1</span> = <span class="hljs-number">2</span>.
</code></pre><p><strong>Example 3:</strong></p>
<pre><code><span class="hljs-attribute">Input</span>: n = <span class="hljs-number">4</span>
<span class="hljs-attribute">Output</span>: <span class="hljs-number">3</span>
<span class="hljs-attribute">Explanation</span>: F(<span class="hljs-number">4</span>) = F(<span class="hljs-number">3</span>) + F(<span class="hljs-number">2</span>) = <span class="hljs-number">2</span> + <span class="hljs-number">1</span> = <span class="hljs-number">3</span>.
</code></pre><h3 id="heading-video-explanation">Video Explanation</h3>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/a87elJk3ztU">https://youtu.be/a87elJk3ztU</a></div>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656783229902/L2fEwmCDd.png" alt="Sketch-annotation-element-stroke-line-arrow-spiral-up.png" class="image--right mx-auto mr-0" /></p>
<h3 id="heading-solution-1-recursive-approach">Solution 1: Recursive Approach</h3>
<p><strong>Algorithm</strong></p>
<ol>
<li>This is the recursive solution where If <code>n</code> is <code>0</code> it will return <code>0</code> or if <code>n</code> is <code>1</code> it will return <code>1</code>. This is the base case for recursion </li>
<li>Recursively call the <code>f(n-1)</code> and <code>f(n-2)</code> to return the final value of <code>f(n)</code></li>
<li>Finally we get out <code>f(n)</code>.</li>
</ol>
<p><strong>Code in JS 🧑‍💻 </strong></p>
<pre><code><span class="hljs-comment">/**
 * @param {number} n
 * @return {number}
 */</span>
<span class="hljs-keyword">var</span> fib <span class="hljs-operator">=</span> <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">n</span>) </span>{
  <span class="hljs-keyword">if</span> (n <span class="hljs-operator">&lt;</span> <span class="hljs-number">2</span>) <span class="hljs-keyword">return</span> n;
  <span class="hljs-keyword">return</span> fib(n <span class="hljs-operator">-</span> <span class="hljs-number">1</span>) <span class="hljs-operator">+</span> fib(n <span class="hljs-operator">-</span> <span class="hljs-number">2</span>);
};
</code></pre><p><strong>Time Complexity : <code>O(n)</code> </strong></p>
<p><strong>Space Complexity: <code>O(n)</code></strong></p>
<h3 id="heading-solution-2-iterative-approach-with-an-array">Solution 2: Iterative approach with an array</h3>
<p><strong>Algorithm</strong></p>
<ol>
<li>First of all, <code>n = 0</code> return <code>0</code> and for <code>n = 1</code> return <code>1</code></li>
<li>Create an array and store the first two values of the Fibonacci sequence in the array</li>
<li>Now update the <code>ith</code> value of the array with the <code>i-1</code> value + the <code>i-2</code> value of the array.</li>
<li>Repeat the same for n iterations and then the array will have the <code>nth</code> value too.</li>
<li>Return the <code>nth</code> value from the array</li>
</ol>
<p><strong>Code in JS 🧑‍💻 </strong></p>
<pre><code><span class="hljs-comment">/**
 * @param {number} n
 * @return {number}
 */</span>
<span class="hljs-keyword">var</span> fib <span class="hljs-operator">=</span> <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">n</span>) </span>{
  <span class="hljs-keyword">if</span> (n <span class="hljs-operator">&lt;</span> <span class="hljs-number">2</span>) <span class="hljs-keyword">return</span> n;
  <span class="hljs-keyword">var</span> fibArray <span class="hljs-operator">=</span> [];
  fibArray[<span class="hljs-number">0</span>] <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;
  fibArray[<span class="hljs-number">1</span>] <span class="hljs-operator">=</span> <span class="hljs-number">1</span>;
  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-operator">=</span> <span class="hljs-number">2</span>; i <span class="hljs-operator">&lt;</span><span class="hljs-operator">=</span> n; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
    fibArray[i] <span class="hljs-operator">=</span> fibArray[i <span class="hljs-operator">-</span> <span class="hljs-number">1</span>] <span class="hljs-operator">+</span> fibArray[i <span class="hljs-operator">-</span> <span class="hljs-number">2</span>];
  }
  <span class="hljs-keyword">return</span> fibArray[n];
};
</code></pre><p><strong>Time Complexity : <code>O(n)</code> </strong></p>
<p><strong>Space Complexity: <code>O(n)</code></strong></p>
<h3 id="heading-solution-3-iterative-approach-without-an-array">Solution 3: Iterative approach without an array</h3>
<p><strong>Algorithm</strong></p>
<p>The approach is similar to the 2nd solution but it is done without using a new array.</p>
<ol>
<li>First of all, <code>n = 0</code> return <code>0</code> and for <code>n = 1</code> return <code>1</code></li>
<li>Store the last two values of the Fibonacci series in <code>f1</code> and <code>f2</code>.</li>
<li>Update <code>f1</code> with <code>f2</code></li>
<li>Update <code>f2</code> with the current sum of <code>f1</code> and <code>f2</code>.</li>
<li>Steps 2 and 3 will be repeated till we get the final value after n iterations.</li>
<li>Return <code>f2</code>.</li>
</ol>
<p><strong>Code in JS 🧑‍💻 </strong></p>
<pre><code><span class="hljs-comment">/**
 * @param {number} n
 * @return {number}
 */</span>
<span class="hljs-keyword">var</span> fib <span class="hljs-operator">=</span> <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">n</span>) </span>{
  <span class="hljs-keyword">if</span> (n <span class="hljs-operator">&lt;</span> <span class="hljs-number">2</span>) <span class="hljs-keyword">return</span> n;
  <span class="hljs-keyword">var</span> f1 <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;
  <span class="hljs-keyword">var</span> f2 <span class="hljs-operator">=</span> <span class="hljs-number">1</span>;
  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-operator">=</span> <span class="hljs-number">2</span>; i <span class="hljs-operator">&lt;</span><span class="hljs-operator">=</span>n; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
    <span class="hljs-keyword">var</span> currentSum <span class="hljs-operator">=</span> f1 <span class="hljs-operator">+</span> f2;
    f1 <span class="hljs-operator">=</span> f2;
    f2 <span class="hljs-operator">=</span> currentSum;
  }
  <span class="hljs-keyword">return</span> f2;
};
</code></pre><p><strong>Time Complexity : <code>O(n)</code> </strong></p>
<p><strong>Space Complexity: <code>O(1)</code></strong></p>
<h3 id="heading-similar-questions-for-practice">Similar Questions for practice</h3>
<p>Now it is time to try some similar questions</p>
<ul>
<li><a target="_blank" href="https://leetcode.com/problems/climbing-stairs/">Climbing Stairs</a></li>
<li><a target="_blank" href="https://leetcode.com/problems/split-array-into-fibonacci-sequence/">Split Array into Fibonacci Sequence</a></li>
<li><a target="_blank" href="https://leetcode.com/problems/length-of-longest-fibonacci-subsequence/">Length of Longest Fibonacci Subsequence</a></li>
<li><a target="_blank" href="https://leetcode.com/problems/n-th-tribonacci-number/">N-th Tribonacci Number</a></li>
</ul>
<h3 id="heading-you-can-find-me-on-the-web">You can find me on the web 🌍</h3>
<ul>
<li><a target="_blank" href="https://github.com/Souravdey777">Github</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/souravdey777">LinkedIn</a></li>
<li><a target="_blank" href="https://twitter.com/Souravdey777">Twitter</a></li>
</ul>
<p>Add your solution or approach in the comments below. Also, show your love by Sharing the blog. 🤗 </p>
<blockquote>
<p>“Belief creates the actual fact.”</p>
<p>~ William James</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[LeetCode Question - 128. Longest Consecutive Sequence 🏃🏻]]></title><description><![CDATA[About the Series
Problem-solving is a key skill set for any tech-related stuff you might be working on.
When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.
So, this serie...]]></description><link>https://blogs.souravdey.space/leetcode-question-128-longest-consecutive-sequence</link><guid isPermaLink="true">https://blogs.souravdey.space/leetcode-question-128-longest-consecutive-sequence</guid><category><![CDATA[Daily LeetCode Challenge]]></category><category><![CDATA[#dailyLeetcodeChallenge]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[data structures]]></category><category><![CDATA[leetcode]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Tue, 05 Jul 2022 22:30:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1657021411607/-jMJgNP7A.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-about-the-series">About the Series</h3>
<p>Problem-solving is a key skill set for any tech-related stuff you might be working on.</p>
<p>When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.</p>
<p>So, this series of blogs is all about practicing Daily LeetCode Challenges &amp; Problem-solving. 🚀</p>
<h3 id="heading-problem-statement">Problem Statement</h3>
<p><a target="_blank" href="https://leetcode.com/problems/longest-consecutive-sequence/"><strong>Longest Consecutive Sequence</strong></a></p>
<blockquote>
<p>Given an unsorted array of integers <code>nums</code>, return the length of the longest consecutive elements sequence.</p>
<p>You must write an algorithm that runs in <code>O(n)</code> time.</p>
</blockquote>
<p><strong>Example 1:</strong></p>
<pre><code><span class="hljs-attr">Input:</span> <span class="hljs-string">nums</span> <span class="hljs-string">=</span> [<span class="hljs-number">100</span>,<span class="hljs-number">4</span>,<span class="hljs-number">200</span>,<span class="hljs-number">1</span>,<span class="hljs-number">3</span>,<span class="hljs-number">2</span>]
<span class="hljs-attr">Output:</span> <span class="hljs-number">4</span>
<span class="hljs-attr">Explanation:</span> <span class="hljs-string">The</span> <span class="hljs-string">longest</span> <span class="hljs-string">consecutive</span> <span class="hljs-string">elements</span> <span class="hljs-string">sequence</span> <span class="hljs-string">is</span> [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]<span class="hljs-string">.</span> <span class="hljs-string">Therefore</span> <span class="hljs-string">its</span> <span class="hljs-string">length</span> <span class="hljs-string">is</span> <span class="hljs-number">4</span><span class="hljs-string">.</span>
</code></pre><p><strong>Example 2:</strong></p>
<pre><code><span class="hljs-attr">Input:</span> <span class="hljs-string">nums</span> <span class="hljs-string">=</span> [<span class="hljs-number">0</span>,<span class="hljs-number">3</span>,<span class="hljs-number">7</span>,<span class="hljs-number">2</span>,<span class="hljs-number">5</span>,<span class="hljs-number">8</span>,<span class="hljs-number">4</span>,<span class="hljs-number">6</span>,<span class="hljs-number">0</span>,<span class="hljs-number">1</span>]
<span class="hljs-attr">Output:</span> <span class="hljs-number">9</span>
</code></pre><h3 id="heading-video-explanation">Video Explanation</h3>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/IWmw5xkJd9s">https://youtu.be/IWmw5xkJd9s</a></div>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656783229902/L2fEwmCDd.png" alt="Sketch-annotation-element-stroke-line-arrow-spiral-up.png" class="image--right mx-auto mr-0" /></p>
<h3 id="heading-solution">Solution</h3>
<p><strong>Algorithm</strong></p>
<ol>
<li>we create a <code>numsMap</code> and store all the values in the map.</li>
<li>Now Iterate through the <code>nums</code> array and check if it is the starting point of a consecutive sequence of values or not. ie. <code>num-1</code> exists or not. If it doesn’t exist that means it can be starting value of the sequence.</li>
<li>Now check whether the next consecutive value exists or not in a while loop and increment the value of the current sequence length.</li>
<li>Compare the longest sequence length with the current sequence length whichever is maximum will be stored in longest sequence length</li>
<li>Finally return the longest sequence length.</li>
</ol>
<p><strong>Code in JS 🧑‍💻 </strong></p>
<pre><code><span class="hljs-comment">/**
 * @param {number[]} nums
 * @return {number}
 */</span>
<span class="hljs-keyword">var</span> longestConsecutive <span class="hljs-operator">=</span> <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">nums</span>) </span>{
  <span class="hljs-keyword">var</span> numsMap <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> Map();
  <span class="hljs-keyword">for</span> (const num of nums) {
    numsMap.set(num);
  }

  <span class="hljs-keyword">var</span> longestSequence <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;
  <span class="hljs-keyword">for</span> (const num of nums) {
    <span class="hljs-keyword">if</span> (<span class="hljs-operator">!</span>numsMap.has(num <span class="hljs-operator">-</span> <span class="hljs-number">1</span>)) {
      <span class="hljs-keyword">var</span> currentSequence <span class="hljs-operator">=</span> <span class="hljs-number">1</span>;
      <span class="hljs-keyword">var</span> currentNum <span class="hljs-operator">=</span> num;
      <span class="hljs-keyword">while</span> (numsMap.has(currentNum <span class="hljs-operator">+</span> <span class="hljs-number">1</span>)) {
        currentNum<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
        currentSequence<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
      }
      longestSequence <span class="hljs-operator">=</span> Math.<span class="hljs-built_in">max</span>(longestSequence, currentSequence);
    }
  }
  <span class="hljs-keyword">return</span> longestSequence;
};
</code></pre><p><strong>Time Complexity : <code>O(n)</code> </strong></p>
<p><strong>Space Complexity: <code>O(1)</code></strong></p>
<h3 id="heading-similar-questions-for-practice">Similar Questions for practice</h3>
<p>Now it is time to try some similar questions</p>
<ul>
<li><a target="_blank" href="https://leetcode.com/problems/binary-tree-longest-consecutive-sequence/">Binary Tree Longest Consecutive Sequence</a></li>
<li><a target="_blank" href="https://leetcode.com/problems/find-three-consecutive-integers-that-sum-to-a-given-number/">Find Three Consecutive Integers That Sum to a Given Number</a></li>
<li><a target="_blank" href="https://leetcode.com/problems/maximum-consecutive-floors-without-special-floors/">Maximum Consecutive Floors Without Special Floors</a></li>
</ul>
<h3 id="heading-you-can-find-me-on-the-web">You can find me on the web 🌍</h3>
<ul>
<li><a target="_blank" href="https://github.com/Souravdey777">Github</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/souravdey777">LinkedIn</a></li>
<li><a target="_blank" href="https://twitter.com/Souravdey777">Twitter</a></li>
</ul>
<p>Add your solution or approach in the comments below. Also, show your love by Sharing the blog. 🤗 </p>
<blockquote>
<p>“Believe you can and you’re halfway there.”</p>
<p>~ Theodore Roosevelt</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[LeetCode Question - 135. Candy 🍭]]></title><description><![CDATA[About the Series
Problem-solving is a key skill set for any tech-related stuff you might be working on.
When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.
So, this serie...]]></description><link>https://blogs.souravdey.space/leetcode-question-135-candy</link><guid isPermaLink="true">https://blogs.souravdey.space/leetcode-question-135-candy</guid><category><![CDATA[Daily LeetCode Challenge]]></category><category><![CDATA[#dailyLeetcodeChallenge]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[data structures]]></category><category><![CDATA[leetcode]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Tue, 05 Jul 2022 19:09:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1657018874363/6IRTRdi82.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-about-the-series">About the Series</h3>
<p>Problem-solving is a key skill set for any tech-related stuff you might be working on.</p>
<p>When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.</p>
<p>So, this series of blogs is all about practicing Daily LeetCode Challenges &amp; Problem-solving. 🚀</p>
<h3 id="heading-problem-statement">Problem Statement</h3>
<p><a target="_blank" href="https://leetcode.com/problems/candy/"><strong>Candy 🍭</strong></a></p>
<blockquote>
<p>There are <code>n</code> children standing in a line. Each child is assigned a rating value given in the integer array <code>ratings</code>.</p>
<p>You are giving candies to these children subjected to the following requirements:</p>
<ul>
<li>Each child must have at least one candy.</li>
<li>Children with a higher rating get more candies than their neighbors.</li>
</ul>
<p>Return the minimum number of candies you need to have to distribute the candies to the children.</p>
</blockquote>
<p><strong>Example 1:</strong></p>
<pre><code><span class="hljs-attr">Input:</span> <span class="hljs-string">ratings</span> <span class="hljs-string">=</span> [<span class="hljs-number">1</span>,<span class="hljs-number">0</span>,<span class="hljs-number">2</span>]
<span class="hljs-attr">Output:</span> <span class="hljs-number">5</span>
<span class="hljs-attr">Explanation:</span> <span class="hljs-string">You</span> <span class="hljs-string">can</span> <span class="hljs-string">allocate</span> <span class="hljs-string">to</span> <span class="hljs-string">the</span> <span class="hljs-string">first,</span> <span class="hljs-string">second,</span> <span class="hljs-string">and</span> <span class="hljs-string">third</span> <span class="hljs-string">child</span> <span class="hljs-string">with</span> <span class="hljs-number">2</span><span class="hljs-string">,</span> <span class="hljs-number">1</span><span class="hljs-string">,</span> <span class="hljs-number">2</span> <span class="hljs-string">candies</span> <span class="hljs-string">respectively.</span>
</code></pre><p><strong>Example 2:</strong></p>
<pre><code><span class="hljs-attr">Input:</span> <span class="hljs-string">ratings</span> <span class="hljs-string">=</span> [<span class="hljs-number">1</span>,<span class="hljs-number">2</span>,<span class="hljs-number">2</span>]
<span class="hljs-attr">Output:</span> <span class="hljs-number">4</span>
<span class="hljs-attr">Explanation:</span> <span class="hljs-string">You</span> <span class="hljs-string">can</span> <span class="hljs-string">allocate</span> <span class="hljs-string">to</span> <span class="hljs-string">the</span> <span class="hljs-string">first,</span> <span class="hljs-string">second,</span> <span class="hljs-string">and</span> <span class="hljs-string">third</span> <span class="hljs-string">child</span> <span class="hljs-string">with</span> <span class="hljs-number">1</span><span class="hljs-string">,</span> <span class="hljs-number">2</span><span class="hljs-string">,</span> <span class="hljs-number">1</span> <span class="hljs-string">candies</span> <span class="hljs-string">respectively.</span>
<span class="hljs-string">The</span> <span class="hljs-string">third</span> <span class="hljs-string">child</span> <span class="hljs-string">gets</span> <span class="hljs-number">1</span> <span class="hljs-string">candy</span> <span class="hljs-string">because</span> <span class="hljs-string">it</span> <span class="hljs-string">satisfies</span> <span class="hljs-string">the</span> <span class="hljs-string">above</span> <span class="hljs-string">two</span> <span class="hljs-string">conditions.</span>
</code></pre><p><strong>Constraints:</strong></p>
<ul>
<li><code>n == ratings.length</code></li>
<li><code>1 &lt;= n &lt;= 2 * 10^4</code></li>
<li><code>0 &lt;= ratings[i] &lt;= 2 * 10^4</code></li>
</ul>
<h3 id="heading-video-explanation">Video Explanation</h3>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/OxN9ZklMQcY">https://youtu.be/OxN9ZklMQcY</a></div>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656783229902/L2fEwmCDd.png" alt="Sketch-annotation-element-stroke-line-arrow-spiral-up.png" class="image--right mx-auto mr-0" /></p>
<h3 id="heading-solution">Solution</h3>
<p><strong>Algorithm</strong></p>
<ol>
<li>Create a new array of <code>candies</code> with all initial values as at least one candy will be given to all the children.</li>
<li>Now, traverse from the left of the array to the right of the array and increase the count of the candies to be given based on the rating of the neighbor child. In this iteration, we are incrementing candies count only based on the left neighbor.</li>
<li>Now, repeat the above from right to left and also store the sum.</li>
<li>Finally return the total sum of candies. 🍭 </li>
</ol>
<p><strong>Code in JS 🧑‍💻 </strong></p>
<pre><code><span class="hljs-comment">/**
 * @param {number[]} ratings
 * @return {number}
 */</span>
<span class="hljs-keyword">var</span> candy <span class="hljs-operator">=</span> <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">ratings</span>) </span>{
  <span class="hljs-keyword">var</span> candies <span class="hljs-operator">=</span> Array(ratings.<span class="hljs-built_in">length</span>).fill(<span class="hljs-number">1</span>);
  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; i <span class="hljs-operator">&lt;</span> ratings.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
    <span class="hljs-keyword">if</span> (ratings[i] <span class="hljs-operator">&gt;</span> ratings[i <span class="hljs-operator">-</span> <span class="hljs-number">1</span>]) {
      candies[i] <span class="hljs-operator">=</span> candies[i <span class="hljs-operator">-</span> <span class="hljs-number">1</span>] <span class="hljs-operator">+</span> <span class="hljs-number">1</span>;
    }
  }
  <span class="hljs-keyword">var</span> sum <span class="hljs-operator">=</span> candies[ratings.<span class="hljs-built_in">length</span> <span class="hljs-operator">-</span> <span class="hljs-number">1</span>];
  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-operator">=</span> ratings.<span class="hljs-built_in">length</span> <span class="hljs-operator">-</span> <span class="hljs-number">2</span>; i <span class="hljs-operator">&gt;</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i<span class="hljs-operator">-</span><span class="hljs-operator">-</span>) {
    <span class="hljs-keyword">if</span> (ratings[i] <span class="hljs-operator">&gt;</span> ratings[i <span class="hljs-operator">+</span> <span class="hljs-number">1</span>]) {
      candies[i] <span class="hljs-operator">=</span> Math.<span class="hljs-built_in">max</span>(candies[i], candies[i <span class="hljs-operator">+</span> <span class="hljs-number">1</span>] <span class="hljs-operator">+</span> <span class="hljs-number">1</span>);
    }
    sum <span class="hljs-operator">+</span><span class="hljs-operator">=</span> candies[i];
  }
  <span class="hljs-keyword">return</span> sum;
};
</code></pre><p><strong>Time Complexity : <code>O(n)</code> </strong></p>
<p><strong>Space Complexity: <code>O(n)</code></strong></p>
<h3 id="heading-you-can-find-me-on-the-web">You can find me on the web 🌍</h3>
<ul>
<li><a target="_blank" href="https://github.com/Souravdey777">Github</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/souravdey777">LinkedIn</a></li>
<li><a target="_blank" href="https://twitter.com/Souravdey777">Twitter</a></li>
</ul>
<p>Add your solution or approach in the comments below. Also, show your love by Sharing the blog. 🤗 </p>
<blockquote>
<p>“Life is like riding a bicycle. To keep your balance, you must keep moving.”</p>
<p>– Albert Einstein</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[LeetCode Question - 376. Wiggle Subsequence 🧠]]></title><description><![CDATA[About the Series
Problem-solving is a key skill set for any tech-related stuff you might be working on.
When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.
So, this serie...]]></description><link>https://blogs.souravdey.space/leetcode-question-376-wiggle-subsequence</link><guid isPermaLink="true">https://blogs.souravdey.space/leetcode-question-376-wiggle-subsequence</guid><category><![CDATA[leetcode]]></category><category><![CDATA[data structures]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Daily LeetCode Challenge]]></category><category><![CDATA[#dailyLeetcodeChallenge]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Mon, 04 Jul 2022 10:42:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1656932117734/QSvqobntoP.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-about-the-series">About the Series</h3>
<p>Problem-solving is a key skill set for any tech-related stuff you might be working on.</p>
<p>When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.</p>
<p>So, this series of blogs is all about practicing Daily LeetCode Challenges &amp; Problem-solving. 🚀</p>
<h3 id="heading-problem-statement">Problem Statement</h3>
<p><a target="_blank" href="https://leetcode.com/problems/wiggle-subsequence/"><strong>Wiggle Subsequence</strong></a></p>
<blockquote>
<p>A <strong>wiggle sequence</strong> is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with one element and a sequence with two non-equal elements are trivially wiggle sequences.</p>
<ul>
<li>For example, <code>[1, 7, 4, 9, 2, 5]</code> is a wiggle sequence because the differences <code>(6, -3, 5, -7, 3)</code> alternate between positive and negative.</li>
<li>In contrast, <code>[1, 4, 7, 2, 5]</code> and <code>[1, 7, 4, 5, 5]</code> are not wiggle sequences. The first is not because its first two differences are positive, and the second is not because its last difference is zero.
A <strong>subsequence</strong> is obtained by deleting some elements (possibly zero) from the original sequence, leaving the remaining elements in their original order.</li>
</ul>
<p>Given an integer array <code>nums</code>, return the length of the longest wiggle subsequence of <code>nums</code>.</p>
</blockquote>
<h3 id="heading-video-explanation">Video Explanation</h3>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=mp5-uz6W8MA">https://www.youtube.com/watch?v=mp5-uz6W8MA</a></div>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656783229902/L2fEwmCDd.png" alt="Sketch-annotation-element-stroke-line-arrow-spiral-up.png" class="image--right mx-auto mr-0" /></p>
<h3 id="heading-solution">Solution</h3>
<p><strong>Algorithm</strong></p>
<ol>
<li>First check if the length of the <code>nums</code> array is smaller than two or not. If yes, we will simply return the length of the array ie. <code>0</code> for <code>[]</code> and <code>1</code> for <code>[x]</code> (where x can be any value)</li>
<li>We check the first difference between the <code>1st</code> from the <code>0th</code> value in the <code>nums</code> array and store it in the <code>previousdiff</code></li>
<li>If the values are not equal we will count both the no. for the wiggle sequence thus our counter will be <code>2</code> and if equal we take our counter to be <code>1</code></li>
<li>Now, While iterating the <code>nums</code> array we will compare the compare current difference and previous difference. If one is positive the other should be negative or vice versa. Now, we will increment the count if the conditions are satisfied and update the previous difference with the current difference. </li>
<li>Finally return the count of the wiggle sequence.</li>
</ol>
<p><strong>Code in JS 🧑‍💻 </strong></p>
<pre><code><span class="hljs-comment">/**
 * @param {number[]} nums
 * @return {number}
 */</span>
<span class="hljs-keyword">var</span> wiggleMaxLength <span class="hljs-operator">=</span> <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">nums</span>) </span>{
  <span class="hljs-keyword">if</span> (nums.<span class="hljs-built_in">length</span> <span class="hljs-operator">&lt;</span> <span class="hljs-number">2</span>) {
    <span class="hljs-keyword">return</span> nums.<span class="hljs-built_in">length</span>;
  }
  <span class="hljs-keyword">var</span> previousdiff <span class="hljs-operator">=</span> nums[<span class="hljs-number">1</span>] <span class="hljs-operator">-</span> nums[<span class="hljs-number">0</span>];
  <span class="hljs-keyword">var</span> counter <span class="hljs-operator">=</span> previousdiff <span class="hljs-operator">!</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span> ? <span class="hljs-number">2</span> : <span class="hljs-number">1</span>;

  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; i <span class="hljs-operator">&lt;</span> nums.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
    const currentDiff <span class="hljs-operator">=</span> nums[i] <span class="hljs-operator">-</span> nums[i <span class="hljs-operator">-</span> <span class="hljs-number">1</span>];
    <span class="hljs-keyword">if</span> (
      (currentDiff <span class="hljs-operator">&gt;</span> <span class="hljs-number">0</span> <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> previousdiff <span class="hljs-operator">&lt;</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span>
      (currentDiff <span class="hljs-operator">&lt;</span> <span class="hljs-number">0</span> <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> previousdiff <span class="hljs-operator">&gt;</span><span class="hljs-operator">=</span> <span class="hljs-number">0</span>)
    ) {
      counter<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
      previousdiff <span class="hljs-operator">=</span> currentDiff;
    }
  }
  <span class="hljs-keyword">return</span> counter;
};
</code></pre><p><strong>Time Complexity : <code>O(n)</code> </strong></p>
<p><strong>Space Complexity: <code>O(1)</code></strong></p>
<h3 id="heading-similar-questions-for-practice">Similar Questions for practice</h3>
<p>Now it is time to try more similar questions</p>
<ul>
<li><a target="_blank" href="https://leetcode.com/problems/rearrange-array-elements-by-sign/">Rearrange Array Elements by Sign</a></li>
</ul>
<h3 id="heading-you-can-find-me-on-the-web">You can find me on the web 🌍</h3>
<ul>
<li><a target="_blank" href="https://github.com/Souravdey777">Github</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/souravdey777">LinkedIn</a></li>
<li><a target="_blank" href="https://twitter.com/Souravdey777">Twitter</a></li>
</ul>
<p>Add your solution or approach in the comments below. Also, show your love by Sharing the blog. 🤗 </p>
<blockquote>
<p>"Dream big. Start small. But most of all, start."</p>
<p>~ Simon Sinek</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[LeetCode Question - 1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts 🍰]]></title><description><![CDATA[About the Series
Problem-solving is a key skill set for any tech-related stuff you might be working on.
When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.
So, this serie...]]></description><link>https://blogs.souravdey.space/leetcode-question-1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts</link><guid isPermaLink="true">https://blogs.souravdey.space/leetcode-question-1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[leetcode]]></category><category><![CDATA[data structures]]></category><category><![CDATA[Daily LeetCode Challenge]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Sun, 03 Jul 2022 19:34:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1656876472993/ptIsQzf2b.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-about-the-series">About the Series</h3>
<p>Problem-solving is a key skill set for any tech-related stuff you might be working on.</p>
<p>When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.</p>
<p>So, this series of blogs is all about practicing Daily LeetCode Challenges &amp; Problem-solving. 🚀</p>
<h3 id="heading-problem-statement">Problem Statement</h3>
<p><a target="_blank" href="https://leetcode.com/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/"><strong>Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts 🍰</strong></a></p>
<blockquote>
<p>You are given a rectangular cake of size <code>h x w</code> and two arrays of integers <code>horizontalCuts</code> and <code>verticalCuts</code> where:</p>
<ul>
<li><code>horizontalCuts[i]</code> is the distance from the top of the rectangular cake to the <code>ith</code> horizontal cut and similarly, and</li>
<li><code>verticalCuts[j]</code> is the distance from the left of the rectangular cake to the <code>jth</code> vertical cut.</li>
</ul>
<p>Return the maximum area of a piece of cake after you cut at each horizontal and vertical position provided in the arrays <code>horizontalCuts</code> and <code>verticalCuts</code>. Since the answer can be a large number, return this <code>modulo 109 + 7</code></p>
</blockquote>
<h3 id="heading-video-explanation">Video Explanation</h3>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/gErjVSkoKDA">https://youtu.be/gErjVSkoKDA</a></div>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656783229902/L2fEwmCDd.png" alt="Sketch-annotation-element-stroke-line-arrow-spiral-up.png" class="image--right mx-auto mr-0" /></p>
<h3 id="heading-solution">Solution</h3>
<p><strong>Algorithm</strong></p>
<ol>
<li>Push <code>0</code> and <code>h</code> in the <code>horizontalCuts</code>.</li>
<li>Sort the <code>horizontalCuts</code> array in Ascending Order.</li>
<li>Take the maximum difference between the cuts by iterating on the list of <code>horizontalCuts</code></li>
<li>Push <code>0</code> and <code>h</code> in the <code>horizontalCuts</code>.</li>
<li>Sort the <code>horizontalCuts</code> array in Ascending Order.</li>
<li>Take the maximum difference between the cuts by iterating on the list of <code>horizontalCuts</code></li>
<li>Multiply both the max values and return the modulo <code>10^9 + 7</code></li>
<li>Now, we got the largest piece of Cake 🍰 </li>
</ol>
<p><strong>Code in JS 🧑‍💻 </strong></p>
<pre><code><span class="hljs-comment">/**
 * @param {number} h
 * @param {number} w
 * @param {number[]} horizontalCuts
 * @param {number[]} verticalCuts
 * @return {number}
 */</span>
<span class="hljs-keyword">var</span> maxArea <span class="hljs-operator">=</span> <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">h, w, horizontalCuts, verticalCuts</span>) </span>{
  horizontalCuts.<span class="hljs-built_in">push</span>(<span class="hljs-number">0</span>, h);
  horizontalCuts.sort((a, b) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> a <span class="hljs-operator">-</span> b);
  <span class="hljs-keyword">var</span> maxH <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;
  verticalCuts.<span class="hljs-built_in">push</span>(<span class="hljs-number">0</span>, w);
  verticalCuts.sort((a, b) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> a <span class="hljs-operator">-</span> b);
  <span class="hljs-keyword">var</span> maxW <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;

  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; i <span class="hljs-operator">&lt;</span> horizontalCuts.<span class="hljs-built_in">length</span>; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
    maxH <span class="hljs-operator">=</span> Math.<span class="hljs-built_in">max</span>(maxH, horizontalCuts[i] <span class="hljs-operator">-</span> horizontalCuts[i <span class="hljs-operator">-</span> <span class="hljs-number">1</span>]);
  }

  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> j <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; j <span class="hljs-operator">&lt;</span> verticalCuts.<span class="hljs-built_in">length</span>; j<span class="hljs-operator">+</span><span class="hljs-operator">+</span>) {
    maxW <span class="hljs-operator">=</span> Math.<span class="hljs-built_in">max</span>(maxW, verticalCuts[j] <span class="hljs-operator">-</span> verticalCuts[j <span class="hljs-operator">-</span> <span class="hljs-number">1</span>]);
  }

  <span class="hljs-keyword">return</span> (BigInt(maxH) <span class="hljs-operator">*</span> BigInt(maxW)) <span class="hljs-operator">%</span> BigInt(<span class="hljs-number">1e9</span> <span class="hljs-operator">+</span> <span class="hljs-number">7</span>);
};
</code></pre><p><strong>Time Complexity : <code>O(nlogn)</code> </strong></p>
<p><strong>Space Complexity: <code>O(1)</code></strong></p>
<h3 id="heading-you-can-find-me-on-the-web">You can find me on the web 🌍</h3>
<ul>
<li><a target="_blank" href="https://github.com/Souravdey777">Github</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/souravdey777">LinkedIn</a></li>
<li><a target="_blank" href="https://twitter.com/Souravdey777">Twitter</a></li>
</ul>
<p>Add your solution or approach in the comments below.</p>
<p>Show your love by Sharing the blog. 🤗 </p>
<blockquote>
<p>“The best way to predict the future is to create it.”</p>
<p>~ Peter Drucker</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[LeetCode #376: Wiggle Subsequence]]></title><description><![CDATA[LeetCode Question - 376. Wiggle Subsequence 🧠
About the Series
Problem-solving is a key skill set for any tech-related stuff you might be working on.
When it comes to developers it's one of the most crucial skills which is needed in almost any day-t...]]></description><link>https://blogs.souravdey.space/leetcode-376-wiggle-subsequence</link><guid isPermaLink="true">https://blogs.souravdey.space/leetcode-376-wiggle-subsequence</guid><category><![CDATA[algorithms]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Sun, 03 Jul 2022 12:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1656932117734/QSvqobntoP.jpg?w=1600&amp;h=840&amp;fit=crop&amp;crop=entropy&amp;auto=compress,format&amp;format=webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-leetcode-question-376-wiggle-subsequence">LeetCode Question - 376. Wiggle Subsequence 🧠</h2>
<h3 id="heading-about-the-series">About the Series</h3>
<p>Problem-solving is a key skill set for any tech-related stuff you might be working on.</p>
<p>When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.</p>
<p>So, this series of blogs is all about practicing Daily LeetCode Challenges &amp; Problem-solving. 🚀</p>
<p>Earlier in this series: <a target="_blank" href="https://souravdey.space/blogs/leetcode-daily-challenge-02">LeetCode #1465: Maximum Area of Cake After Cuts</a>.</p>
<h3 id="heading-problem-statement">Problem Statement</h3>
<p><a target="_blank" href="https://leetcode.com/problems/wiggle-subsequence/"><strong>Wiggle Subsequence</strong></a></p>
<blockquote>
<p>A <strong>wiggle sequence</strong> is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. A sequence with one element and a sequence with two non-equal elements are trivially wiggle sequences.</p>
<ul>
<li>For example, <code>[1, 7, 4, 9, 2, 5]</code> is a wiggle sequence because the differences <code>(6, -3, 5, -7, 3)</code> alternate between positive and negative.</li>
<li>In contrast, <code>[1, 4, 7, 2, 5]</code> and <code>[1, 7, 4, 5, 5]</code> are not wiggle sequences. The first is not because its first two differences are positive, and the second is not because its last difference is zero.
A <strong>subsequence</strong> is obtained by deleting some elements (possibly zero) from the original sequence, leaving the remaining elements in their original order.</li>
</ul>
<p>Given an integer array <code>nums</code>, return the length of the longest wiggle subsequence of <code>nums</code>.</p>
</blockquote>
<h3 id="heading-video-explanation">Video Explanation</h3>
<p><a target="_blank" href="https://www.youtube.com/watch?v=mp5-uz6W8MA">Watch on YouTube</a></p>
<h3 id="heading-solution">Solution</h3>
<p><strong>Algorithm</strong></p>
<ol>
<li>First check if the length of the <code>nums</code> array is smaller than two or not. If yes, we will simply return the length of the array ie. <code>0</code> for <code>[]</code> and <code>1</code> for <code>[x]</code> (where x can be any value)</li>
<li>We check the first difference between the <code>1st</code> from the <code>0th</code> value in the <code>nums</code> array and store it in the <code>previousdiff</code></li>
<li>If the values are not equal we will count both the no. for the wiggle sequence thus our counter will be <code>2</code> and if equal we take our counter to be <code>1</code></li>
<li>Now, While iterating the <code>nums</code> array we will compare the compare current difference and the previous difference. If one is positive the other should be negative or vice versa. Now, we will increment the count if the conditions are satisfied and update the previous difference with the current difference.</li>
<li>Finally return the count of the wiggle sequence.</li>
</ol>
<p><strong>Code in JS 🧑‍💻</strong></p>
<pre><code class="lang-js"><span class="hljs-comment">/**
 * <span class="hljs-doctag">@param <span class="hljs-type">{number[]}</span> <span class="hljs-variable">nums</span></span>
 * <span class="hljs-doctag">@return <span class="hljs-type">{number}</span></span>
 */</span>
<span class="hljs-keyword">var</span> wiggleMaxLength = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">nums</span>) </span>{
  <span class="hljs-keyword">if</span> (nums.length &lt; <span class="hljs-number">2</span>) {
    <span class="hljs-keyword">return</span> nums.length;
  }
  <span class="hljs-keyword">var</span> previousdiff = nums[<span class="hljs-number">1</span>] - nums[<span class="hljs-number">0</span>];
  <span class="hljs-keyword">var</span> counter = previousdiff != <span class="hljs-number">0</span> ? <span class="hljs-number">2</span> : <span class="hljs-number">1</span>;

  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">1</span>; i &lt; nums.length; i++) {
    <span class="hljs-keyword">const</span> currentDiff = nums[i] - nums[i - <span class="hljs-number">1</span>];
    <span class="hljs-keyword">if</span> (
      (currentDiff &gt; <span class="hljs-number">0</span> &amp;&amp; previousdiff &lt;= <span class="hljs-number">0</span>) ||
      (currentDiff &lt; <span class="hljs-number">0</span> &amp;&amp; previousdiff &gt;= <span class="hljs-number">0</span>)
    ) {
      counter++;
      previousdiff = currentDiff;
    }
  }
  <span class="hljs-keyword">return</span> counter;
};
</code></pre>
<p><strong>Time Complexity : <code>O(n)</code></strong></p>
<p><strong>Space Complexity: <code>O(1)</code></strong></p>
<h3 id="heading-similar-questions-for-practice">Similar Questions for practice</h3>
<p>Now it is time to try more similar questions</p>
<ul>
<li><a target="_blank" href="https://leetcode.com/problems/rearrange-array-elements-by-sign/">Rearrange Array Elements by Sign</a></li>
</ul>
<h3 id="heading-you-can-find-me-on-the-web">You can find me on the web 🌍</h3>
<ul>
<li><a target="_blank" href="https://github.com/Souravdey777">Github</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/souravdey777">LinkedIn</a></li>
<li><a target="_blank" href="https://twitter.com/Souravdey777">Twitter</a></li>
</ul>
<p>Add your solution or approach in the comments below. Also, show your love by Sharing the blog. 🤗</p>
<blockquote>
<p>"Dream big. Start small. But most of all, start."</p>
<p>~ Simon Sinek</p>
</blockquote>
<hr />
<p><em>Originally published at <a target="_blank" href="https://souravdey.space/blogs/leetcode-daily-challenge-03">souravdey.space</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[LeetCode Question - 1710. Maximum Units on a Truck 🚛]]></title><description><![CDATA[About the Series
Problem-solving is a key skill set for any tech-related stuff you might be working on.
When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.
So, this serie...]]></description><link>https://blogs.souravdey.space/leetcode-question-1710-maximum-units-on-a-truck</link><guid isPermaLink="true">https://blogs.souravdey.space/leetcode-question-1710-maximum-units-on-a-truck</guid><category><![CDATA[leetcode]]></category><category><![CDATA[data structures]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Daily LeetCode Challenge]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Sat, 02 Jul 2022 17:43:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1656781114983/YDnC8e0Zy.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-about-the-series">About the Series</h3>
<p>Problem-solving is a key skill set for any tech-related stuff you might be working on.</p>
<p>When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.</p>
<p>So, this series of blogs is all about practicing Daily LeetCode Challenges &amp; Problem-solving. 🚀</p>
<h3 id="heading-problem-statement">Problem Statement</h3>
<p><a target="_blank" href="https://leetcode.com/problems/maximum-units-on-a-truck"><strong>Maximum Units on a Truck 🚛</strong></a></p>
<blockquote>
<p>You are assigned to put some amount of boxes onto one truck. You are given a 2D array <code>boxTypes</code>, where <code>boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBoxi]</code>:</p>
<ul>
<li><code>numberOfBoxes</code> is the number of boxes of type i.</li>
<li><code>numberOfUnitsPerBox</code> is the number of units in each box of type i.
You are also given an integer <code>truckSize</code>, which is the maximum number of boxes that can be put on the truck. You can choose any boxes to put on the truck as long as the number of boxes does not exceed <code>truckSize</code>.</li>
</ul>
<p>Return the maximum total number of units that can be put on the truck.</p>
</blockquote>
<h3 id="heading-video-explanation">Video Explanation</h3>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/mx1Z7PszOkU">https://youtu.be/mx1Z7PszOkU</a></div>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656783229902/L2fEwmCDd.png" alt="Sketch-annotation-element-stroke-line-arrow-spiral-up.png" class="image--right mx-auto mr-0" /></p>
<h3 id="heading-solution">Solution</h3>
<p><strong>Algorithm</strong></p>
<ol>
<li>Sorting the array in descending order based on the no. of units in each box. 📦 </li>
<li>Iterate through the sorted array elements and check the remaining <code>truckSize</code>.<ul>
<li>If not enough size for all boxes take as many boxes as you can and calculate the total units</li>
<li>Else take all the boxes and calculate the total units.</li>
</ul>
</li>
<li>Return the total units </li>
</ol>
<p><strong>Code 🧑‍💻 </strong></p>
<pre><code><span class="hljs-keyword">var</span> maximumUnits <span class="hljs-operator">=</span> <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">boxTypes, truckSize</span>) </span>{
  boxTypes.sort((a, b) <span class="hljs-operator">=</span><span class="hljs-operator">&gt;</span> b[<span class="hljs-number">1</span>] <span class="hljs-operator">-</span> a[<span class="hljs-number">1</span>]);

  <span class="hljs-keyword">var</span> maxTotal <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;
  <span class="hljs-keyword">var</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;

  <span class="hljs-keyword">while</span> (truckSize <span class="hljs-operator">&gt;</span> <span class="hljs-number">0</span> <span class="hljs-operator">&amp;</span><span class="hljs-operator">&amp;</span> i <span class="hljs-operator">&lt;</span> boxTypes.<span class="hljs-built_in">length</span>) {
    const numOfBoxes <span class="hljs-operator">=</span> boxTypes[i][<span class="hljs-number">0</span>];
    const numOfUnits <span class="hljs-operator">=</span> boxTypes[i][<span class="hljs-number">1</span>];

    <span class="hljs-keyword">if</span> (truckSize <span class="hljs-operator">&lt;</span><span class="hljs-operator">=</span> numOfBoxes) {
      maxTotal <span class="hljs-operator">+</span><span class="hljs-operator">=</span> truckSize <span class="hljs-operator">*</span> numOfUnits;
      truckSize <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;
    } <span class="hljs-keyword">else</span> {
      maxTotal <span class="hljs-operator">+</span><span class="hljs-operator">=</span> numOfBoxes <span class="hljs-operator">*</span> numOfUnits;
      truckSize <span class="hljs-operator">-</span><span class="hljs-operator">=</span> numOfBoxes;
    }

    i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
  }
  <span class="hljs-keyword">return</span> maxTotal;
};
</code></pre><p><strong>Time Complexity : O(nlogn)+O(n) = O(nlogn) </strong></p>
<p><strong>Space Complexity: O(1)</strong></p>
<h3 id="heading-similar-questions-for-practice">Similar Questions for practice</h3>
<p>Now it is time to try more similar questions</p>
<ul>
<li><a target="_blank" href="https://leetcode.com/problems/maximum-bags-with-full-capacity-of-rocks/">Maximum Bags With Full Capacity of Rocks</a></li>
</ul>
<h3 id="heading-you-can-find-me-on-the-web">You can find me on the web 🌍</h3>
<ul>
<li><a target="_blank" href="https://github.com/Souravdey777">Github</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/souravdey777">LinkedIn</a></li>
<li><a target="_blank" href="https://twitter.com/Souravdey777">Twitter</a></li>
</ul>
<p>Add your solutions or approaches to the comments. </p>
<p>Show your love by Sharing the blog. 🤗 </p>
<blockquote>
<p>"I didn't fail 1000 times. The light bulb was an invention with 1000 steps."</p>
<p>~Thomas A. Edison</p>
</blockquote>
]]></content:encoded></item><item><title><![CDATA[LeetCode #1465: Maximum Area of Cake After Cuts]]></title><description><![CDATA[LeetCode Question - 1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts 🍰
About the Series
Problem-solving is a key skill set for any tech-related stuff you might be working on.
When it comes to developers it's one of the most c...]]></description><link>https://blogs.souravdey.space/leetcode-1465-maximum-area-of-cake-after-cuts</link><guid isPermaLink="true">https://blogs.souravdey.space/leetcode-1465-maximum-area-of-cake-after-cuts</guid><category><![CDATA[algorithms]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Sat, 02 Jul 2022 12:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1656876472993/ptIsQzf2b.jpg?w=1600&amp;h=840&amp;fit=crop&amp;crop=entropy&amp;auto=compress,format&amp;format=webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-leetcode-question-1465-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts">LeetCode Question - 1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts 🍰</h2>
<h3 id="heading-about-the-series">About the Series</h3>
<p>Problem-solving is a key skill set for any tech-related stuff you might be working on.</p>
<p>When it comes to developers it's one of the most crucial skills which is needed in almost any day-to-day code you might be writing.</p>
<p>So, this series of blogs is all about practicing Daily LeetCode Challenges &amp; Problem-solving. 🚀</p>
<p>Earlier in this series: <a target="_blank" href="https://souravdey.space/blogs/leetcode-daily-challenge-01">LeetCode #1710: Maximum Units on a Truck</a>.</p>
<h3 id="heading-problem-statement">Problem Statement</h3>
<p><a target="_blank" href="https://leetcode.com/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/"><strong>Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts 🍰</strong></a></p>
<blockquote>
<p>You are given a rectangular cake of size <code>h x w</code> and two arrays of integers <code>horizontalCuts</code> and <code>verticalCuts</code> where:</p>
<ul>
<li><code>horizontalCuts[i]</code> is the distance from the top of the rectangular cake to the <code>ith</code> horizontal cut and similarly, and</li>
<li><code>verticalCuts[j]</code> is the distance from the left of the rectangular cake to the <code>jth</code> vertical cut.</li>
</ul>
<p>Return the maximum area of a piece of cake after you cut at each horizontal and vertical position provided in the arrays <code>horizontalCuts</code> and <code>verticalCuts</code>. Since the answer can be a large number, return this <code>modulo 109 + 7</code></p>
</blockquote>
<h3 id="heading-video-explanation">Video Explanation</h3>
<p><a target="_blank" href="https://www.youtube.com/watch?v=gErjVSkoKDA">Watch on YouTube</a></p>
<h3 id="heading-solution">Solution</h3>
<p><strong>Algorithm</strong></p>
<ol>
<li>Push <code>0</code> and <code>h</code> in the <code>horizontalCuts</code>.</li>
<li>Sort the <code>horizontalCuts</code> array in Ascending Order.</li>
<li>Take the maximum difference between the cuts by iterating on the list of <code>horizontalCuts</code></li>
<li>Push <code>0</code> and <code>h</code> in the <code>horizontalCuts</code>.</li>
<li>Sort the <code>horizontalCuts</code> array in Ascending Order.</li>
<li>Take the maximum difference between the cuts by iterating on the list of <code>horizontalCuts</code></li>
<li>Multiply both the max values and return the modulo <code>10^9 + 7</code></li>
<li>Now, we got the largest piece of Cake 🍰</li>
</ol>
<p><strong>Code in JS 🧑‍💻</strong></p>
<pre><code class="lang-js"><span class="hljs-comment">/**
 * <span class="hljs-doctag">@param <span class="hljs-type">{number}</span> <span class="hljs-variable">h</span></span>
 * <span class="hljs-doctag">@param <span class="hljs-type">{number}</span> <span class="hljs-variable">w</span></span>
 * <span class="hljs-doctag">@param <span class="hljs-type">{number[]}</span> <span class="hljs-variable">horizontalCuts</span></span>
 * <span class="hljs-doctag">@param <span class="hljs-type">{number[]}</span> <span class="hljs-variable">verticalCuts</span></span>
 * <span class="hljs-doctag">@return <span class="hljs-type">{number}</span></span>
 */</span>
<span class="hljs-keyword">var</span> maxArea = <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params">h, w, horizontalCuts, verticalCuts</span>) </span>{
  horizontalCuts.push(<span class="hljs-number">0</span>, h);
  horizontalCuts.sort(<span class="hljs-function">(<span class="hljs-params">a, b</span>) =&gt;</span> a - b);
  <span class="hljs-keyword">var</span> maxH = <span class="hljs-number">0</span>;
  verticalCuts.push(<span class="hljs-number">0</span>, w);
  verticalCuts.sort(<span class="hljs-function">(<span class="hljs-params">a, b</span>) =&gt;</span> a - b);
  <span class="hljs-keyword">var</span> maxW = <span class="hljs-number">0</span>;

  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">1</span>; i &lt; horizontalCuts.length; i++) {
    maxH = <span class="hljs-built_in">Math</span>.max(maxH, horizontalCuts[i] - horizontalCuts[i - <span class="hljs-number">1</span>]);
  }

  <span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> j = <span class="hljs-number">1</span>; j &lt; verticalCuts.length; j++) {
    maxW = <span class="hljs-built_in">Math</span>.max(maxW, verticalCuts[j] - verticalCuts[j - <span class="hljs-number">1</span>]);
  }

  <span class="hljs-keyword">return</span> (BigInt(maxH) * BigInt(maxW)) % BigInt(<span class="hljs-number">1e9</span> + <span class="hljs-number">7</span>);
};
</code></pre>
<p><strong>Time Complexity : <code>O(nlogn)</code></strong></p>
<p><strong>Space Complexity: <code>O(1)</code></strong></p>
<h3 id="heading-you-can-find-me-on-the-web">You can find me on the web 🌍</h3>
<ul>
<li><a target="_blank" href="https://github.com/Souravdey777">Github</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/souravdey777">LinkedIn</a></li>
<li><a target="_blank" href="https://twitter.com/Souravdey777">Twitter</a></li>
</ul>
<p>Add your solution or approach in the comments below.</p>
<p>Show your love by Sharing the blog. 🤗</p>
<blockquote>
<p>“The best way to predict the future is to create it.”</p>
<p>~ Peter Drucker</p>
</blockquote>
<hr />
<p><em>Originally published at <a target="_blank" href="https://souravdey.space/blogs/leetcode-daily-challenge-02">souravdey.space</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Portfolio Website Development - Part 2 🏗️]]></title><description><![CDATA[This blog is the 2nd part of my previous blog: Portfolio Website Development - Part 1
→ Link to the website

The link mentioned above is the older version of the website. If you are not reading this on my website here is the link for reference: ✨ sou...]]></description><link>https://blogs.souravdey.space/portfolio-website-development-part-2</link><guid isPermaLink="true">https://blogs.souravdey.space/portfolio-website-development-part-2</guid><category><![CDATA[branding]]></category><category><![CDATA[portfolio]]></category><category><![CDATA[Blogging]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Tue, 26 Oct 2021 17:01:38 GMT</pubDate><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1690824004233/d4fa27f2-12e4-4fd7-b8f1-4bc8311e1ef8.png" alt class="image--center mx-auto" /></p>
<p>This blog is the 2nd part of my previous blog: <a target="_blank" href="https://souravdey.space/blogs/portfolio-website-development-part-1"><strong>Portfolio Website Development - Part 1</strong></a></p>
<p>→ <a target="_blank" href="https://souravdey-space-fjvgj711m-souravdey777.vercel.app/">Link to the website</a></p>
<blockquote>
<p>The link mentioned above is the older version of the website. If you are not reading this on my website here is the link for reference: ✨ <a target="_blank" href="https://souravdey.space">souravdey.space</a></p>
</blockquote>
<p>Check out the video below:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://souravdey.space/images/blogs/portfolio-website-development-part-2/recorded.mp4">https://souravdey.space/images/blogs/portfolio-website-development-part-2/recorded.mp4</a></div>
<p> </p>
<hr />
<h2 id="heading-section-on-the-website">Section on the website</h2>
<ul>
<li><p>/aboutMe</p>
</li>
<li><p>/workExperience</p>
</li>
<li><p>/techSkills</p>
</li>
<li><p>/latestBlogs</p>
</li>
</ul>
<p>The website is a single-page website that has a scroll view. On clicking on the top right menu items the page scrolls to that specific section.</p>
<h2 id="heading-about-the-design-and-content">About the design and content</h2>
<p>The website color and theme are created keeping in mind the fact that it should convey a design language to all the visitors. The content also conveyed on this website belongs to the software developer.</p>
<h2 id="heading-some-details-that-i-would-like-to-highlight">Some details that I would like to highlight:</h2>
<h4 id="heading-before-each-section-git-checkout-b-sectionname">Before each section "git checkout -b sectionName":</h4>
<p>Each section on the website starts with the git command to create a new branch:<br /><code>git checkout -b sectionName</code>. This brings the element of a unique experience that is more familiar to the software developers.</p>
<h4 id="heading-usage-of-camelcase-in-some-places">Usage of camelCase in some places</h4>
<p>All the section names are in the camel case. And there is no doubt that it also brings an element that we all software developers are familiar with.</p>
<h2 id="heading-aboutme">/aboutMe</h2>
<p>The <strong>/aboutMe</strong> section gives a small brief about me. Here, is the same text mentioned below.</p>
<blockquote>
<p>I am 24 years old <strong>passionate learner</strong> having a keen interest in collaborating to build digital solutions 👨‍💻 that <strong>solve real-world problems</strong> 🌍</p>
<p>I'm also a <strong>design thinking facilitator</strong> and a <strong>user-centric developer</strong> who believes that the merger between Design Thinking and Digital Technologies will lead to the building of user-centered solutions that are impactful toward the betterment of business and society.</p>
</blockquote>
<h2 id="heading-workexperience-andamp-techskills">/workExperience &amp; /techSkills</h2>
<p>The <strong>/workExperience</strong> &amp; <strong>/techSkills</strong> section is all about my professional experience and tech skills.</p>
<h2 id="heading-latestblogs">/latestBlogs</h2>
<p>The <strong>/latestBlogs</strong> section calls <strong>the Hashnode GraphQL API and fetches the 4 recent blogs</strong>. After the four blogs, there is a Call to action button to check all my other blogs in the Hashnode profile.</p>
<hr />
<h2 id="heading-what-is-next">What is next?</h2>
<ul>
<li><p>Move all the blogs to my website and use <code>.mdx</code> files for blogs.</p>
</li>
<li><p>Add an option for endorsement of each skill.</p>
</li>
<li><p>Modify the experience section.</p>
</li>
<li><p>Social Presence section needs to be added.</p>
</li>
</ul>
<p>There is a huge scope for improvement. But, I am happy about the fact where it currently stands.</p>
<p>✨ Do check out the website: <a target="_blank" href="https://souravdey.space">souravdey.space</a></p>
]]></content:encoded></item><item><title><![CDATA[Moving Gradient animation with CSS 🎨]]></title><description><![CDATA[Simple animations can bring a huge difference to your websites.
Let's build something simple and unique.
Complete page background animation with CSS moving gradient
https://codepen.io/souravdey777/pen/poROYza

The above Codepen example shows a moving...]]></description><link>https://blogs.souravdey.space/moving-gradient-animation-with-css</link><guid isPermaLink="true">https://blogs.souravdey.space/moving-gradient-animation-with-css</guid><category><![CDATA[Web Development]]></category><category><![CDATA[CSS]]></category><category><![CDATA[HTML5]]></category><category><![CDATA[Design]]></category><category><![CDATA[animation]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Tue, 20 Apr 2021 10:55:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1618916032680/207Gh-MAd.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Simple animations can bring a huge difference to your websites.
Let's build something simple and unique.</p>
<h2 id="heading-complete-page-background-animation-with-css-moving-gradient">Complete page background animation with CSS moving gradient</h2>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/souravdey777/pen/poROYza">https://codepen.io/souravdey777/pen/poROYza</a></div>
<blockquote>
<p>The above Codepen example shows a moving gradient animation on the whole body of the website.</p>
</blockquote>
<p>Code snippet for the animation effect.</p>
<p>HTML 👇</p>
<pre><code>&lt;body&gt;
  <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>
     Animation effect on "body"
  <span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span></span>
&lt;/body&gt;
</code></pre><p>CSS 👇</p>
<pre><code>body {
  <span class="hljs-attr">background</span>: -webkit-linear-gradient(
    <span class="hljs-number">-70</span>deg,
    #a2facf,
    #<span class="hljs-number">64</span>acff
  );
  background-size: <span class="hljs-number">400</span>% <span class="hljs-number">400</span>%;
  animation: gradient <span class="hljs-number">5</span>s ease infinite;
}

@keyframes gradient {
  <span class="hljs-number">0</span>% {
    background-position: <span class="hljs-number">0</span>% <span class="hljs-number">50</span>%;
  }
  <span class="hljs-number">50</span>% {
    background-position: <span class="hljs-number">100</span>% <span class="hljs-number">50</span>%;
  }
  <span class="hljs-number">100</span>% {
    background-position: <span class="hljs-number">0</span>% <span class="hljs-number">50</span>%;
  }
}
</code></pre><h2 id="heading-so-what-is-happening">So, What is happening ??</h2>
<p>The <strong> background size here is 400% 400%</strong> and the background is moving. Thus, the animation is happening.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1618910655541/iHGAtnmJX.png" alt="Frame 2.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1618910678556/58MXeNJ4m.png" alt="Frame 3.png" /></p>
<p>A lot of cool stuff can be coded with this type of animation.</p>
<h2 id="heading-1-rainbow-effect">1. 🌈 Rainbow Effect</h2>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/souravdey777/pen/JjEmYRQ">https://codepen.io/souravdey777/pen/JjEmYRQ</a></div>
<blockquote>
<p>The above Codepen example shows a 🌈 rainbow effect.</p>
</blockquote>
<p>This is similar to the animation that we saw in the previous example but with 7 colors.</p>
<h2 id="heading-2-loader-for-cards-and-simple-components">2. Loader for cards and simple components.</h2>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/souravdey777/pen/dyNgYZY">https://codepen.io/souravdey777/pen/dyNgYZY</a></div>
<blockquote>
<p>The above Codepen example shows a loader 🐌 with the same gradient animation.</p>
</blockquote>
<h2 id="heading-3-implementing-the-same-effect-on-a-button-or-cards">3. Implementing the same effect on a button or cards</h2>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/souravdey777/pen/WNRaGMB">https://codepen.io/souravdey777/pen/WNRaGMB</a></div>
<blockquote>
<p>The above Codepen example shows 🌈 the rainbow effect on a button.</p>
</blockquote>
<h2 id="heading-4-on-hover-the-same-animation-effect">4. On Hover the same animation effect</h2>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/souravdey777/pen/ExZdNav">https://codepen.io/souravdey777/pen/ExZdNav</a></div>
<blockquote>
<p>Animation on hovering on the card</p>
</blockquote>
<h2 id="heading-configurable-parameters">Configurable parameters</h2>
<ul>
<li>Changing the <code>background-size</code></li>
<li>Changing the <code>time-duration</code></li>
<li>Changing the <code>degree</code> of the linear gradient.</li>
</ul>
<p>Now, put on your creative 🤠 hats and make an interesting animation effect with moving gradients.</p>
<p>Drop the website link in the comments for which you would be doing it or have done it.</p>
<p>Show your love by Sharing the blog. 🤗</p>
<h3 id="heading-you-can-find-me-on-the-web">You can find me on the web 🌍</h3>
<ul>
<li><a target="_blank" href="https://github.com/Souravdey777">Github</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/souravdey777">LinkedIn</a></li>
<li><a target="_blank" href="https://twitter.com/Souravdey777">Twitter</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Page fade-in animation with CSS 🎨]]></title><description><![CDATA[Simple animations can bring a huge difference to your websites.
Let us create a page fade-in animation with CSS.
https://codepen.io/souravdey777/pen/KKaByRY

The above Codepen shows animation with opacity: from 0 to 1. Because of infinite, it is anim...]]></description><link>https://blogs.souravdey.space/page-fade-in-animation-with-css</link><guid isPermaLink="true">https://blogs.souravdey.space/page-fade-in-animation-with-css</guid><category><![CDATA[HTML5]]></category><category><![CDATA[CSS]]></category><category><![CDATA[animation]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[Design]]></category><dc:creator><![CDATA[Sourav Dey]]></dc:creator><pubDate>Sat, 17 Apr 2021 18:29:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1618916224522/hJATP3EQP.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-simple-animations-can-bring-a-huge-difference-to-your-websites">Simple animations can bring a huge difference to your websites.</h3>
<p>Let us create a page fade-in animation with CSS.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/souravdey777/pen/KKaByRY">https://codepen.io/souravdey777/pen/KKaByRY</a></div>
<blockquote>
<p>The above Codepen shows animation with <code>opacity:</code> from <code>0</code> to <code>1</code>. Because of <code>infinite</code>, it is animating continuously.</p>
</blockquote>
<p>Check the whole code in <a target="_blank" href="https://codepen.io/souravdey777/pen/KKaByRY">Codepen</a> or,
Check the code below for the animation</p>
<p>HTML snippet.</p>
<pre><code class="lang-HTML"><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>
    This is the fade-in animation moving in the y-axis
  <span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
  <span class="hljs-comment">&lt;!-- Your code --&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
</code></pre>
<p>Now, add the below code to your 🎨 CSS.</p>
<pre><code class="lang-CSS"><span class="hljs-selector-tag">body</span>{
  <span class="hljs-attribute">animation</span>: fadeIn <span class="hljs-number">2s</span> infinite;
}

<span class="hljs-keyword">@keyframes</span> fadeIn {
  <span class="hljs-selector-tag">from</span> {
    <span class="hljs-attribute">opacity</span>: <span class="hljs-number">0</span>;
  }
  <span class="hljs-selector-tag">to</span> {
    <span class="hljs-attribute">opacity</span>: <span class="hljs-number">1</span>;
  }
}
</code></pre>
<p>If you remove the <code>infinite</code> from the CSS you will get the animation effect on the first render only. With <code>infinite</code> it is animating continuously.</p>
<p>There can be many more possibilities.</p>
<p>Check this out,</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/souravdey777/pen/PoWBEGV">https://codepen.io/souravdey777/pen/PoWBEGV</a></div>
<blockquote>
<p>The above codepen shows animation with <code>transform:</code> from <code>translateY(50px)</code> to <code>translateY(0)</code> and <code>opacity:</code> from <code>0</code> to <code>1</code>. Because of <code>infinite</code> it is animating continuously.</p>
</blockquote>
<p>Link for <a target="_blank" href="https://codepen.io/souravdey777/pen/PoWBEGV">Codepen</a></p>
<p>The HTML code snippet will be the same as for the 🎨 CSS. check the code below 👇</p>
<pre><code class="lang-CSS"><span class="hljs-selector-tag">body</span>{
  <span class="hljs-attribute">animation</span>: fadeIn <span class="hljs-number">2s</span> infinite;
}

<span class="hljs-keyword">@keyframes</span> fadeIn {
  <span class="hljs-selector-tag">from</span> {
    <span class="hljs-attribute">opacity</span>: <span class="hljs-number">0</span>;
    <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateY</span>(<span class="hljs-number">50px</span>);
  }
  <span class="hljs-selector-tag">to</span> {
    <span class="hljs-attribute">opacity</span>: <span class="hljs-number">1</span>;
    <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateY</span>(<span class="hljs-number">0</span>);
  }
}
</code></pre>
<p>Just remove the <code>infinite</code> from the CSS code for getting the animation once on the load of the page only.</p>
<p>Now, put on your creative hats and make an animation effect for your whole website on the initial load.</p>
<p>You can check something similar I did for my portfolio website.
<a target="_blank" href="https://souravdey.space">Souravdey.Space</a> ✌</p>
<p>Drop the website link in the comments for which you would be doing it or have done it.</p>
<p>Show your love by Sharing the blog. 🤗</p>
<h3 id="heading-contact-me">Contact me 🌍</h3>
<ul>
<li><a target="_blank" href="https://github.com/Souravdey777/">Github</a></li>
<li><a target="_blank" href="https://www.linkedin.com/in/souravdey777">LinkedIn</a></li>
<li><a target="_blank" href="https://twitter.com/Souravdey777">Twitter</a></li>
</ul>
]]></content:encoded></item></channel></rss>