<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sivalingam</title>
    <description>The latest articles on DEV Community by Sivalingam (@cvalingam).</description>
    <link>https://dev.to/cvalingam</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3818959%2F013503ca-5c7c-461c-99b6-292e7bfda424.png</url>
      <title>DEV Community: Sivalingam</title>
      <link>https://dev.to/cvalingam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cvalingam"/>
    <language>en</language>
    <item>
      <title>I Solved 800+ LeetCode Problems in C# - Here's What I Built</title>
      <dc:creator>Sivalingam</dc:creator>
      <pubDate>Mon, 30 Mar 2026 18:04:24 +0000</pubDate>
      <link>https://dev.to/cvalingam/i-solved-800-leetcode-problems-in-c-heres-what-i-built-2ljf</link>
      <guid>https://dev.to/cvalingam/i-solved-800-leetcode-problems-in-c-heres-what-i-built-2ljf</guid>
      <description>&lt;h2&gt;
  
  
  What's on the site
&lt;/h2&gt;

&lt;p&gt;Every solution page has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Clean, readable C# code with syntax highlighting&lt;/li&gt;
&lt;li&gt;📝 The approach explained in plain English&lt;/li&gt;
&lt;li&gt;⏱️ Time and space complexity&lt;/li&gt;
&lt;li&gt;🔗 Direct link to the LeetCode problem&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can browse by &lt;strong&gt;topic&lt;/strong&gt; (Dynamic Programming, Trees, Graphs, Sliding Window, Two Pointers, and 40+ more) or filter by &lt;strong&gt;difficulty&lt;/strong&gt; (Easy / Medium / Hard).&lt;/p&gt;




&lt;h2&gt;
  
  
  Example — Two Sum
&lt;/h2&gt;

&lt;p&gt;Here's what a typical solution looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Approach: Use a dictionary to store each number's index.&lt;/span&gt;
&lt;span class="c1"&gt;// For each number, check if its complement (target - num) already exists.&lt;/span&gt;
&lt;span class="c1"&gt;// Time: O(n) Space: O(n)&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Solution&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="nf"&gt;TwoSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Dictionary&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;complement&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ContainsKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;complement&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;complement&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
            &lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Empty&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every solution follows this pattern — the comment at the top explains the core idea before you read any code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why C#?
&lt;/h2&gt;

&lt;p&gt;C# is underused in competitive programming, but it's a great choice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strong typing catches bugs the compiler&lt;/li&gt;
&lt;li&gt;LINQ makes array/list operations expressive&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Dictionary&amp;lt;K,V&amp;gt;&lt;/code&gt; and &lt;code&gt;HashSet&amp;lt;T&amp;gt;&lt;/code&gt; are fast and easy to use&lt;/li&gt;
&lt;li&gt;It's what most .NET/backend engineers use day-to-day&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're preparing for interviews at Microsoft, Amazon, or any .NET shop, practicing in C# makes your prep directly transferable.&lt;/p&gt;




&lt;h2&gt;
  
  
  GeeksforGeeks too
&lt;/h2&gt;

&lt;p&gt;I also solve the &lt;strong&gt;GFG Problem of the Day&lt;/strong&gt; every day in Java. Those are at &lt;a href="https://dsasolved.com/gfg" rel="noopener noreferrer"&gt;dsasolved.com/gfg&lt;/a&gt; — 530+ solutions and growing daily.&lt;/p&gt;




&lt;h2&gt;
  
  
  Tech behind the site
&lt;/h2&gt;

&lt;p&gt;Built with &lt;strong&gt;Next.js 14&lt;/strong&gt; (App Router), fully statically generated — 1,380+ pages pre-rendered at build time. Uses Shiki for syntax highlighting. Deployed on Vercel.&lt;/p&gt;

&lt;p&gt;The solutions themselves live in a GitHub repo: each &lt;code&gt;.cs&lt;/code&gt; file is one problem. The site reads them at build time and generates the pages.&lt;/p&gt;




</description>
      <category>leetcode</category>
      <category>csharp</category>
      <category>algorithms</category>
      <category>programming</category>
    </item>
    <item>
      <title>I built a linter that enforces Clean Architecture rules in TypeScript</title>
      <dc:creator>Sivalingam</dc:creator>
      <pubDate>Wed, 11 Mar 2026 19:13:21 +0000</pubDate>
      <link>https://dev.to/cvalingam/i-built-a-linter-that-enforces-clean-architecture-rules-in-typescript-483g</link>
      <guid>https://dev.to/cvalingam/i-built-a-linter-that-enforces-clean-architecture-rules-in-typescript-483g</guid>
      <description>&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;In every TypeScript codebase I've worked on, the same violation appears eventually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// controllers/orderController.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;OrderRepository&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../repositories/orderRepository&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ❌&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A controller importing a repository directly. The service layer completely bypassed.&lt;/p&gt;

&lt;p&gt;ESLint can't catch this - it has no concept of architectural layers. Code reviews catch it sometimes, but not always. And the bugs it causes are subtle.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;architecture-linter&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;You create a &lt;code&gt;.context.yml&lt;/code&gt; in your project root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;architecture&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;layers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;controller&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;service&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;repository&lt;/span&gt;

&lt;span class="na"&gt;rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;controller&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;cannot_import&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;repository&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx architecture-linter scan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ Architecture violation detected

   File:   controllers/orderController.ts
   Import: repositories/orderRepository
   Rule:   Controller cannot import Repository

Found 1 violation in 3 file(s) scanned.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Setup takes 2 minutes
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--save-dev&lt;/span&gt; architecture-linter
npx architecture-linter init   &lt;span class="c"&gt;# auto-detects your framework and layers&lt;/span&gt;
npx architecture-linter scan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;init&lt;/code&gt; automatically detects NestJS and Next.js from your package.json and generates the right config - including file-suffix scanning (&lt;code&gt;.controller.ts&lt;/code&gt;, &lt;code&gt;.service.ts&lt;/code&gt;, etc.) for NestJS projects. Pass &lt;code&gt;--force&lt;/code&gt; to overwrite an existing config.&lt;/p&gt;




&lt;h2&gt;
  
  
  Three ways to use it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. CLI&lt;/strong&gt; - run locally or in any CI pipeline&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. VS Code extension&lt;/strong&gt; - violations appear as red squiggles in real time, with fix hints in the Problems panel&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. GitHub Action&lt;/strong&gt; - annotates PRs with inline violations on the exact line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cvalingam/architecture-linter@v1&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Built-in presets
&lt;/h2&gt;

&lt;p&gt;No need to write rules from scratch. Use a preset:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;extends&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;nestjs&lt;/span&gt;   &lt;span class="c1"&gt;# or clean-architecture, hexagonal, nextjs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Available presets: &lt;code&gt;nestjs&lt;/code&gt;, &lt;code&gt;clean-architecture&lt;/code&gt;, &lt;code&gt;hexagonal&lt;/code&gt;, &lt;code&gt;nextjs&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/cvalingam/architecture-linter" rel="noopener noreferrer"&gt;https://github.com/cvalingam/architecture-linter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;npm: &lt;a href="https://www.npmjs.com/package/architecture-linter" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/architecture-linter&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;VS Code Extension: &lt;a href="https://marketplace.visualstudio.com/items?itemName=cvalingam.architecture-linter-vscode" rel="noopener noreferrer"&gt;https://marketplace.visualstudio.com/items?itemName=cvalingam.architecture-linter-vscode&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Free and open source. Feedback welcome in the comments.&lt;/p&gt;

&lt;p&gt;❤️ If this tool saves you time, consider &lt;a href="https://github.com/sponsors/cvalingam" rel="noopener noreferrer"&gt;sponsoring on GitHub&lt;/a&gt; - even $5/month helps keep it maintained and growing.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>node</category>
    </item>
  </channel>
</rss>
