<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Swati Jha on Medium]]></title>
        <description><![CDATA[Stories by Swati Jha on Medium]]></description>
        <link>https://medium.com/@swatijha.0829?source=rss-7cc90bdedb2a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*JvxyhdZt-im8AEZJ</url>
            <title>Stories by Swati Jha on Medium</title>
            <link>https://medium.com/@swatijha.0829?source=rss-7cc90bdedb2a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:28:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@swatijha.0829/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[N+1 Query Problem]]></title>
            <link>https://medium.com/@swatijha.0829/n-1-query-problem-0aba1eced6b2?source=rss-7cc90bdedb2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/0aba1eced6b2</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[spring-data-jpa]]></category>
            <category><![CDATA[hibernate-jpa]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Swati Jha]]></dc:creator>
            <pubDate>Sun, 16 Aug 2026 15:26:12 GMT</pubDate>
            <atom:updated>2026-08-16T15:26:12.798Z</atom:updated>
            <content:encoded><![CDATA[<pre>public class Department {<br> @Id<br> @GeneratedValue(strategy = GenerationType.IDENTITY)<br> private Long id;<br> <br> private String name;<br> <br> @OneToMany(mappedBy = &quot;department&quot;)<br> private List&lt;Employee&gt; employees = new ArrayList&lt;&gt;();<br>}</pre><pre>@Entity<br>public class Employee {<br><br>    @Id<br>    @GeneratedValue(strategy = GenerationType.IDENTITY)<br>    private Long id;<br><br>    private String name;<br><br>    @ManyToOne<br>    @JoinColumn(name = &quot;department_id&quot;)<br>    private Department department;<br>}</pre><p>Department has a OnetoMany relationship with department, means for 1 department there can be many employees.</p><p>Department 1 -&gt; * Employee</p><p><strong>But where is the relationship actually stored? <br> </strong>Notice something: There is no employee_ids column in Department.<br> Instead, the employee table contains: department_id<br> That’s because an employee belongs to one department.</p><p><strong>What is mappedBy ? </strong><br>In department class, we have mappedBy = “department”, It refers to the Java field name, not the database column name.<br>mappedBy = “department” means: “The department field inside the Employee class maps this relationship.”<br>In Employee table, we have department_id, which stores the mapped department id.</p><p><strong>Why do we need mappedBy?</strong><br>Suppose you DON’T write mappedBy, Hibernate may think that Department also wants to manage the relationship.<br>You could end up with unnecessary relationship management, potentially including an additional join table depending on the mapping.<br>with mappedBy, you’re explicitly telling Hibernate : “Don’t create/manage another relationship from Department’s side. The Employee.department mapping already handles it.”</p><p><strong>How N+1 Query Problem generates ? <br></strong>Suppose you fetch departments :</p><pre>List&lt;Department&gt; departments = departmentRepository.findAll();</pre><p>Hibernate initially executes:</p><pre>SELECT * FROM department; //and you get all departments.</pre><p>Now suppose somewhere you do</p><pre>for (Department department : departments) {<br>	System.out.println(department.getEmployees());<br>}</pre><p>If employees is lazily loaded, Hibernate may execute:</p><pre>SELECT * FROM employee WHERE department_id = 1;<br>SELECT * FROM employee WHERE department_id = 2;<br>SELECT * FROM employee WHERE department_id = 3;<br>...<br>SELECT * FROM employee WHERE department_id = 100;</pre><p>So instead of 1 query, you potentially get:</p><pre>1 query → departments<br>+<br>100 queries → employees<br>——————————————-<br>101 queries<br>That&#39;s the N+1 problem.</pre><p>Why @OneToMany is particularly dangerous ? <br>By default, a collection like this is LAZY</p><pre>@OneToMany(mappedBy = &quot;department&quot;)<br>private List&lt;Employee&gt; employees;</pre><p>That’s generally good because you don’t want every employee loaded every time you load a department.<br>But the problem appears when your code accesses the collection for many departments.</p><p><strong>there’s another 1:N problem: huge collections <br></strong>If one department has 100,000 employees and you load:</p><p>department.getEmployees();</p><p>Hibernate may need to materialize a huge collection.<br>That can cause: <br>1. high memory usage<br>2. slow queries<br>3. slow serialization<br>4. huge API responses</p><p>And situation with REST APIs.</p><pre>@GetMapping(&quot;/departments/{id}&quot;)<br>public Department getDepartment(…) {<br>return department;<br>}</pre><p>Jackson may see: Department → employees → Employee → department → employees which can lead to infinite recursion / StackOverflowError unless you handle the bidirectional relationship properly.</p><p><strong>why not EAGER Loading ?<br></strong>EAGER means: “When you load the Department, load its employees too.”</p><pre>@OneToMany(<br>mappedBy = &quot;department&quot;,<br>fetch = FetchType.EAGER<br>)<br>private List&lt;Employee&gt; employees;</pre><p>List&lt;Department&gt; departments = departmentRepository.findAll(); //this loads Department and all employees<br>Hibernate knows: “Department’s employees are EAGER. I need to load them too.”<br>Conceptually:<br>get Department → Department + Employees → everything loaded immediately</p><p><strong>Solution to N+1 Problem :</strong></p><ol><li>JOIN FETCH</li></ol><pre>@Query(&quot;&quot;&quot;<br>SELECT d<br>FROM Department d<br>JOIN FETCH d.employees<br>&quot;&quot;&quot;)<br>List&lt;Department&gt; findAllDepartmentsWithEmployees();</pre><pre>SELECT d., e.<br>FROM department d<br>JOIN employee e<br>ON d.id = e.department_id;</pre><p>Instead of: <br>1 query → departments<br>N queries → employees</p><p>you fetch the required data together.<br>Why this is good ?<br>You haven’t changed your entity to : fetch = FetchType.EAGER<br>You’re saying:<br>“Employees are normally lazy, but for this particular query, I need them.”<br>That’s much more controlled.</p><p>2. DTO</p><p>Sometimes you don’t actually need full Department and Employee entities.<br>For example, your API only needs :<br>Department name; Department location; Employee name</p><p>Then you can fetch exactly what you need into a DTO.<br>Something like:</p><pre>public class DepartmentEmployeeDTO{<br> String departmentName,<br> String location,<br> String employeeName<br>} <br>// Now you&#39;re not loading entire entities unnecessarily.<br>//This is particularly useful for large applications/APIs.</pre><p>3. Batch fetching</p><pre>@OneToMany(mappedBy = &quot;department&quot;)<br>@BatchSize(size = 3)<br>private List&lt;Employee&gt; employees = new ArrayList&lt;&gt;();</pre><p>Now Hibernate knows:<br>“When one department’s employees are requested, if there are other departments whose employee collections are also pending, fetch them in batches of 3.”</p><p>Hibernate can do:</p><pre>SELECT *<br>FROM employee<br>WHERE department_id IN (1, 2, 3);</pre><p>Then :</p><pre>SELECT *<br>FROM employee<br>WHERE department_id IN (4, 5, 6);</pre><p>Without batch: <br>Department query<br>Employee 1<br>Employee 2<br>Employee 3<br>Employee 4<br>Employee 5<br>Employee 6<br>= 7 queries</p><p>With batch size 3: <br>Department query<br>Employees 1,2,3<br>Employees 4,5,6<br>= 3 queries</p><p><strong>UseCase <br></strong>You have many parent entities 100 Departments <br>and You may access their collections :<br>Department 1 → employees Department 2 → employees Department 3 → employees … <br>but you don’t necessarily want to JOIN FETCH everything upfront. <br>So: LAZY + Batch fetching gives you a middle ground.</p><p>3. Non Hibernate solution <br>Get the values of department and employees separately and map them in code.</p><pre>List&lt;Department&gt; departments = departmentRepository.findAll();<br>List&lt;Employee&gt; employees = employeeRepository.findAll();</pre><p>and in Code side, we create HashMap&lt;Integer, List&lt;Employee&gt;&gt; departmentEmployeeMapping; (keeping key as department_id)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0aba1eced6b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java 8 to Java 21: A Developer’s Guide to Everything That Changed]]></title>
            <link>https://medium.com/@swatijha.0829/java-8-to-java-21-a-developers-guide-to-everything-that-changed-b77f63120be9?source=rss-7cc90bdedb2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b77f63120be9</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java21]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Swati Jha]]></dc:creator>
            <pubDate>Sat, 18 Jul 2026 08:45:47 GMT</pubDate>
            <atom:updated>2026-07-18T08:45:47.264Z</atom:updated>
            <content:encoded><![CDATA[<p>When Java 8 was released in 2014, it transformed the Java ecosystem with Lambda Expressions, the Stream API, and the modern Date &amp; Time API. For many organizations, Java 8 became the long-term standard, powering enterprise applications for nearly a decade.</p><p>Fast forward to today, and Java has evolved significantly. Java 21, a Long-Term Support (LTS) release, is not just another version upgrade — it represents years of improvements in language design, performance, developer productivity, and application scalability.</p><p>If you’re migrating from Java 8 directly to Java 21, the number of changes can feel overwhelming. This article highlights the most important additions — with the version each one actually arrived in — and explains why they matter in real-world development.</p><h3>1. The Java Release Cycle Changed</h3><p>One of the biggest differences isn’t a language feature at all.</p><p>Before Java 9, new Java versions were released every few years. Since Java 9 (2017), Java follows a <strong>six-month release cycle</strong>, with Long-Term Support (LTS) versions arriving every few years.</p><p>The LTS versions are:</p><ul><li>Java 8 (2014)</li><li>Java 11 (2018)</li><li>Java 17 (2021)</li><li>Java 21 (2023)</li></ul><p>Most enterprises upgrade between LTS versions because they receive long-term security updates and stability. Everything below is available to you on Java 21, even though most features arrived in earlier releases along the way.</p><h3>2. Local Variable Type Inference (var) — Java 10</h3><p>Instead of writing long variable declarations:</p><pre>HashMap&lt;String, List&lt;Employee&gt;&gt; employees = new HashMap&lt;&gt;();</pre><p>you can write:</p><pre>var employees = new HashMap&lt;String, List&lt;Employee&gt;&gt;();</pre><p>The compiler infers the type at compile time — var is not dynamic typing.</p><p><strong>Benefits:</strong></p><ul><li>Less boilerplate</li><li>Improved readability when the type is obvious from the right-hand side</li><li>Easier refactoring</li></ul><p>Note: var works only for local variables (and, since Java 11, lambda parameters). It cannot be used for fields, method parameters, or return types.</p><h3>3. Collection Factory Methods — Java 9</h3><p>Creating small collections in Java 8 often looked like this:</p><pre>List&lt;String&gt; fruits = new ArrayList&lt;&gt;();<br>fruits.add(&quot;Apple&quot;);<br>fruits.add(&quot;Banana&quot;);</pre><p>Now:</p><pre>List&lt;String&gt; fruits = List.of(&quot;Apple&quot;, &quot;Banana&quot;);<br>Set&lt;String&gt; colors = Set.of(&quot;Red&quot;, &quot;Green&quot;);<br>Map&lt;String, Integer&gt; ages = Map.of(&quot;John&quot;, 30, &quot;Jane&quot;, 25);</pre><p>These collections are <strong>immutable</strong> — calling add() or put() throws UnsupportedOperationException, and List.of/Map.of reject null elements. Keep both in mind when replacing existing code.</p><h3>4. Better String Handling — Java 11 and 12</h3><p>Java 11 added several convenient String methods. Instead of:</p><pre>if (str.trim().isEmpty())</pre><p>use:</p><pre>str.isBlank();</pre><p>Other useful methods:</p><pre>str.lines();          // stream of lines<br>str.repeat(5);        // repeat the string<br>str.strip();          // Unicode-aware trim<br>str.stripLeading();<br>str.stripTrailing();</pre><p>Unlike trim(), the strip() family is Unicode-aware and handles whitespace characters that trim() misses. Java 12 added indent() and transform() as well.</p><h3>5. Text Blocks — Java 15</h3><p>Writing multiline JSON or SQL in Java 8 was messy:</p><pre>String json =<br>    &quot;{\n&quot; +<br>    &quot;  \&quot;name\&quot;:\&quot;John\&quot;\n&quot; +<br>    &quot;}&quot;;</pre><p>With text blocks (standardized in Java 15):</p><pre>String json = &quot;&quot;&quot;<br>    {<br>      &quot;name&quot;:&quot;John&quot;<br>    }<br>    &quot;&quot;&quot;;</pre><p>No escape characters, no concatenation, and the compiler strips incidental indentation. This dramatically improves readability for JSON, SQL, HTML, and regex.</p><h3>6. Switch Expressions — Java 14</h3><p>Traditional switch statements:</p><pre>switch (day) {<br>    case MONDAY:<br>        value = 1;<br>        break;<br>    // ...<br>}</pre><p>Modern switch (standardized in Java 14):</p><pre>int value = switch (day) {<br>    case MONDAY -&gt; 1;<br>    case TUESDAY -&gt; 2;<br>    default -&gt; 0;<br>};</pre><p><strong>Benefits:</strong></p><ul><li>Less boilerplate</li><li>No accidental fall-through</li><li>Returns a value directly</li><li>The compiler enforces exhaustiveness for enums, so a missing case is a compile error rather than a silent bug</li></ul><h3>7. Pattern Matching for instanceof — Java 16</h3><p>Java 8:</p><pre>if (obj instanceof Employee) {<br>    Employee e = (Employee) obj;<br>    System.out.println(e.getName());<br>}</pre><p>Java 16+:</p><pre>if (obj instanceof Employee e) {<br>    System.out.println(e.getName());<br>}</pre><p>No explicit cast, no chance of a mismatched cast. Cleaner and safer.</p><h3>8. Record Classes — Java 16</h3><p>One of Java’s biggest quality-of-life improvements. Instead of hand-writing a constructor, getters, equals(), hashCode(), and toString(), you write:</p><pre>record Employee(int id, String name) {}</pre><p>Java generates all of it. Records are shallowly immutable — fields are final and there are no setters.</p><p>Perfect for:</p><ul><li>DTOs</li><li>API responses</li><li>Value objects and map keys (correct equals/hashCode for free)</li><li>Configuration objects</li></ul><h3>9. Sealed Classes — Java 17</h3><p>Sometimes inheritance should be restricted:</p><pre>public sealed interface Shape<br>    permits Circle, Rectangle {}</pre><p>Only the permitted types can implement Shape. Each permitted subtype must be final, sealed, or non-sealed.</p><p>Sealed types pair naturally with pattern matching for switch (below): when the compiler knows every possible subtype, it can verify your switch covers all cases — no default branch needed.</p><h3>10. Helpful NullPointerException Messages — Java 14</h3><p>Java 8:</p><pre>Exception in thread &quot;main&quot; java.lang.NullPointerException</pre><p>Java 14+ (on by default since Java 15):</p><pre>Exception in thread &quot;main&quot; java.lang.NullPointerException:<br>    Cannot invoke &quot;Employee.getName()&quot; because &quot;employee&quot; is null</pre><p>The JVM tells you exactly which reference was null in a chained expression. Debugging becomes significantly easier.</p><h3>11. Virtual Threads (Project Loom) — Java 21</h3><p>Perhaps the headline feature of Java 21.</p><p>Previously, each Java thread mapped 1:1 to an expensive OS thread, so servers capped concurrency with pools:</p><pre>ExecutorService pool = Executors.newFixedThreadPool(100);</pre><p>Now:</p><pre>ExecutorService executor = Executors.newVirtualThreadPerTaskExecutor();</pre><p>Virtual threads are cheap, JVM-managed threads. An application can run millions of concurrent tasks without millions of OS threads, using the familiar thread-per-request style — no reactive rewrite required.</p><p><strong>Benefits:</strong></p><ul><li>Massive scalability for I/O-bound workloads</li><li>Lower memory usage than platform threads</li><li>Simpler concurrent programming than async/reactive styles</li><li>Excellent for web servers and microservices</li></ul><p><strong>Caveats:</strong> virtual threads don’t speed up CPU-bound work, and code holding locks around blocking calls (particularly synchronized blocks in Java 21) can &quot;pin&quot; the carrier thread and reduce the benefit.</p><h3>12. Structured Concurrency — Java 21 (Preview)</h3><p>Managing multiple concurrent tasks becomes easier. Instead of manually coordinating threads and handling failures, Structured Concurrency treats a group of related tasks as a single unit of work:</p><pre>try (var scope = new StructuredTaskScope.ShutdownOnFailure()) {<br>    var user  = scope.fork(() -&gt; findUser(id));<br>    var order = scope.fork(() -&gt; fetchOrder(id));<br>    scope.join().throwIfFailed();<br>    return new Response(user.get(), order.get());<br>}</pre><p><strong>Benefits:</strong></p><ul><li>If one subtask fails, the others are cancelled automatically</li><li>Errors propagate cleanly</li><li>Concurrent code reads like sequential code</li></ul><p>Note: still a <strong>preview</strong> feature in Java 21 (requires --enable-preview), so treat it as a look at where Java is heading rather than something for production code yet.</p><h3>13. Sequenced Collections — Java 21</h3><p>Ordered collections finally share a common interface:</p><pre>list.getFirst();<br>list.getLast();<br>list.reversed();   // a reversed view, not a copy<br>list.addFirst(e);<br>list.addLast(e);</pre><p>SequencedCollection, SequencedSet, and SequencedMap give lists, LinkedHashSet, LinkedHashMap, and friends a consistent API for working with elements in encounter order.</p><h3>14. Record Patterns — Java 21</h3><p>Records become even more powerful. Instead of:</p><pre>if (obj instanceof Point p) {<br>    int x = p.x();<br>    int y = p.y();<br>}</pre><p>you can destructure directly:</p><pre>if (obj instanceof Point(int x, int y)) {<br>    System.out.println(x + y);<br>}</pre><p>Patterns nest, too — Line(Point(var x1, var y1), Point(var x2, var y2)) pulls values out of nested records in one step.</p><h3>15. Pattern Matching for Switch — Java 21</h3><p>Switch becomes much more expressive. Instead of chains of instanceof checks:</p><pre>String describe(Object obj) {<br>    return switch (obj) {<br>        case Integer i when i &gt; 0 -&gt; &quot;positive int: &quot; + i;<br>        case Integer i            -&gt; &quot;int: &quot; + i;<br>        case String s             -&gt; &quot;string of length &quot; + s.length();<br>        case null                 -&gt; &quot;null&quot;;<br>        default                   -&gt; &quot;something else&quot;;<br>    };<br>}</pre><p>Combined with sealed types and record patterns, this enables clean, compiler-checked handling of every case — no default needed when the type hierarchy is sealed.</p><h3>16. Foreign Function &amp; Memory API — Java 21 (Preview)</h3><p>Interacting with native C libraries used to require JNI, which was complex and error-prone. The FFM API (third preview in Java 21, finalized in Java 22) provides a modern replacement for:</p><ul><li>Calling native code without writing JNI glue</li><li>Managing off-heap memory safely</li><li>High-performance systems programming scenarios</li></ul><h3>17. Better Garbage Collectors</h3><p>Garbage collection has improved enormously since Java 8:</p><ul><li><strong>G1 GC</strong> — existed in Java 8, became the default in Java 9, and has been heavily optimized since</li><li><strong>ZGC</strong> — production-ready since Java 15; Java 21 adds <strong>Generational ZGC</strong> with sub-millisecond pauses even on multi-terabyte heaps</li><li><strong>Shenandoah</strong> — production-ready since Java 15, focused on consistently low pause times</li></ul><p>Meanwhile, the old CMS collector was removed (Java 14). For enterprise applications handling large heaps or high concurrency, these improvements deliver lower pause times, better scalability, and more predictable latency.</p><h3>18. Performance Improvements</h3><p>Even if you adopt no new language features, running on Java 21 typically delivers:</p><ul><li>Faster startup</li><li>Better JIT compiler optimizations</li><li>Improved memory management (e.g., compact strings since Java 9)</li><li>Reduced GC pauses</li><li>Better CPU utilization</li></ul><p>Many applications see measurable performance gains simply by switching the JVM.</p><h3>Migrating from Java 8 to Java 21</h3><p>A direct migration is rarely just changing the JDK version. Plan for:</p><ul><li><strong>Removed Java EE modules (Java 11):</strong> JAXB, JAX-WS, javax.activation, and CORBA were removed from the JDK—add them as explicit dependencies (now under jakarta.* namespaces)</li><li><strong>Strong encapsulation of JDK internals (Java 16–17):</strong> libraries that reflect into sun.*/jdk.internal.* break; upgrade them or use --add-opens as a stopgap</li><li><strong>Framework upgrades:</strong> Spring Boot 3.x requires Java 17+ and the javax.* → jakarta.* package migration</li><li><strong>Build tooling:</strong> update Maven/Gradle and compiler/surefire plugins to versions that support JDK 21</li><li><strong>Removed components:</strong> Nashorn JavaScript engine (Java 15), CMS GC (Java 14), and various deprecated JVM flags</li><li><strong>Third-party libraries:</strong> verify compatibility — bytecode manipulation libraries (Lombok, ByteBuddy, ASM-based tools) are the usual suspects</li><li><strong>Comprehensive regression testing</strong>, then adopt new language features gradually rather than rewriting everything at once</li></ul><p>A practical path: migrate 8 → 11 → 17 → 21, stabilizing at each LTS. The migration is also a good opportunity to clean up technical debt and remove outdated dependencies.</p><h3>Final Thoughts</h3><p>Moving from Java 8 to Java 21 is a significant leap, covering nearly a decade of innovation. Features like Records, Pattern Matching, Text Blocks, and Switch Expressions make code more concise and expressive, while Virtual Threads fundamentally change how Java applications scale.</p><p>The best part: you don’t need to adopt every feature immediately. Upgrade the runtime, ensure your application is stable, then gradually introduce modern language features where they improve readability and maintainability.</p><p>Java 21 isn’t just a newer version of Java — it’s a more productive, performant, and developer-friendly platform. If your applications are still running on Java 8, the migration takes effort, but the long-term benefits in performance, maintainability, and developer experience make it well worth the investment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b77f63120be9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java 21 Migration Journey]]></title>
            <link>https://medium.com/@swatijha.0829/java-21-migration-journey-4b6673dc6f57?source=rss-7cc90bdedb2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b6673dc6f57</guid>
            <category><![CDATA[java-spring-boot]]></category>
            <category><![CDATA[technical]]></category>
            <category><![CDATA[java21]]></category>
            <category><![CDATA[backend-engineering]]></category>
            <category><![CDATA[java8]]></category>
            <dc:creator><![CDATA[Swati Jha]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 19:21:49 GMT</pubDate>
            <atom:updated>2026-06-09T19:21:49.836Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, my company migrated from Java 8 to Java 21. What seemed like a straightforward upgrade quickly turned into a challenging but insightful process involving dependency upgrades, framework compatibility issues, and understanding the impact of newer Java features.</p><p>Despite the challenges, the migration turned out to be an incredible learning experience. I got hands-on exposure to Java 21 features, Spring Boot compatibility changes, and a deeper understanding of why keeping applications up to date with modern technology stacks is so important.</p><p>One key lesson stood out throughout this journey: writing code is not just about making logic work. Clean, maintainable, and well-structured code becomes critical when a project evolves over time. During the migration, it became very clear how good coding practices, proper organization, and thoughtful design decisions can significantly reduce complexity and make large-scale upgrades much smoother.</p><p>This experience reinforced an important idea: software development is not only about solving problems today, but also about making future changes easier for the developers who will work on the code tomorrow — including your future self.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b6673dc6f57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Interviewed at Airtel — The Process Was a Mess]]></title>
            <link>https://medium.com/@swatijha.0829/i-interviewed-at-airtel-the-process-was-a-mess-b0f4aab9b91a?source=rss-7cc90bdedb2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0f4aab9b91a</guid>
            <category><![CDATA[hiring-experience]]></category>
            <category><![CDATA[work-culture]]></category>
            <category><![CDATA[job-interview]]></category>
            <category><![CDATA[sde-interview]]></category>
            <category><![CDATA[interview-experience]]></category>
            <dc:creator><![CDATA[Swati Jha]]></dc:creator>
            <pubDate>Sun, 18 May 2025 07:53:14 GMT</pubDate>
            <atom:updated>2026-06-09T18:03:12.548Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Interviewed at Airtel, The Process Was a Mess</h3><p><strong>From repeated HR calls to broken compensation promises — here’s how Airtel’s hiring process left me disillusioned.</strong></p><p><a href="https://medium.com/@swatijha.0829/airtel-senior-engineer-backend-eng-interview-experience-f67bcaee593a">Click here to read Airtel interview questions</a></p><p>Recently, I interviewed at Airtel for a Senior Software Engineer role. What I expected to be a professional and structured hiring process turned into a chaotic experience full of miscommunication, last-minute changes, and broken promises.</p><h3>Too Many Calls, Same Questions</h3><p>Even before the technical rounds were scheduled, I received <strong>four different calls</strong> from 2 different HR — all asking the <strong>same basic questions</strong>. It felt completely uncoordinated and repetitive.</p><p>During the last call, we finally agreed on a compensation package that included a <strong>60% hike</strong> over my current CTC. That assurance was the only reason I moved forward with the interviews.</p><h3>Tech Rounds: Disorganized and Rushed</h3><ul><li>The <strong>first technical round</strong> was rescheduled just <strong>2 minutes </strong>before it’s scheduled time.</li><li>The <strong>second round</strong> didn’t happen at all. I waited for 15 minutes, contacted the HR (no response), and finally sent an email. He later called back saying the interviewer <em>“might be busy”</em> and rescheduled it.</li></ul><h3>“You’re Selected” — But Where’s the Offer?</h3><p>After clearing the interviews, I was told I’d been selected — but <strong>no offer letter</strong> was shared. Instead, I received email for documents to proceed.</p><p>Then came another call. The HR again asked about my current CTC and casually mentioned they could offer <strong>only a 30% hike</strong>, not the 60% we had agreed upon.</p><p>When I reminded him of our earlier discussion, he said it might be difficult but he’d <em>“check with management.”</em> But the very next day, I received the <strong>same call again</strong> — same questions, no update.</p><h3>The Final Call: Disrespect and Disconnection</h3><p>Then I got a call from the <strong>HR Manager</strong>. She began by confirming I’d been communicating with her team, and then asked:</p><blockquote><em>“What is the CTC you’re asking for?”</em></blockquote><p>When I quoted my expected figure, she responded in a <strong>rude and dismissive tone</strong>:</p><blockquote><em>“But your offer is this — you know you’re asking for a 60% hike. On what basis are you asking for this, considering your current CTC?”</em></blockquote><p>It wasn’t a curious question — it was <strong>judgmental and condescending</strong>, as if I didn’t deserve what I was asking for.</p><p>I calmly explained that I already had another offer with a <strong>35% hike</strong> and that I was well aware of <strong>my value in the current job market</strong>.</p><p>She brushed that off and began listing Airtel’s benefits: hybrid work, free mobile recharge, 15 days of hotel stay with food, etc. I replied that I currently work <strong>fully remote</strong>, and these benefits don’t justify the lower compensation.</p><p>She then asked, <em>“If you knew your worth, why did you proceed with the interview?”</em></p><p>I told her clearly: <em>Because I was promised a 60% hike at the start — that’s why I gave my time. But now you’ve changed the CTC.</em></p><p>She conveniently ignored that part of the conversation and instead asked for the <strong>name and location</strong> of the company that had offered me 35%.</p><p>I reminded her that <strong>my current CTC is fixed</strong>, and so is the one in my new offer.</p><p>When I stood firm and said I wouldn’t accept a 30% hike after being promised 60%, she didn’t acknowledge anything — she simply <strong>hung up mid-conversation</strong>. No courtesy. No follow-up. No offer letter ever arrived.</p><h3>Final Thoughts</h3><p>A company’s hiring process is a reflection of its internal culture.</p><p>If basic communication, professionalism, and commitments can’t be upheld during interviews, it raises serious concerns about how things might be internally.</p><p>I moved forward with the process only because <strong>they promised a 60% hike</strong>. If that was never their real intention, they <strong>shouldn’t have wasted my time</strong>.</p><p>I’m sharing this experience not out of bitterness, but in the hope that companies — big or small — prioritie <strong>transparency, accountability, and respect</strong> in their hiring practices.</p><p><strong>Candidates deserve better.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0f4aab9b91a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Airtel Senior Engineer -Backend Eng. Interview Experience]]></title>
            <link>https://medium.com/@swatijha.0829/airtel-senior-engineer-backend-eng-interview-experience-f67bcaee593a?source=rss-7cc90bdedb2a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f67bcaee593a</guid>
            <dc:creator><![CDATA[Swati Jha]]></dc:creator>
            <pubDate>Sun, 18 May 2025 07:20:11 GMT</pubDate>
            <atom:updated>2025-05-18T07:20:11.099Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Round 1 : Screening Round</strong></p><p>HR from airtel called me to ask my expertise, notice period, current salary, expected salary. then scheduled tech interview date.</p><p><strong>Round 2 : Tech Round 1</strong></p><p>He asked for brief introduction and then asked projects i have worked on and challenges i faced. I told 1 and he said it is more of a design challenge in terms of db did you face any issue and then i told him another one and he 1 follow up.</p><p>and asked keep pen and paper ready for questions and open an online ide of your choice.</p><p>1st Ques : start pattern —</p><p>____*____</p><p>___*_*___</p><p>__*_*_*__</p><p>_*_*_*_*_</p><p>and asked to run the code.</p><p>2nd Ques : Shift all 0’s on the right side and non zero on the left side but order should be maintained.</p><p>He first asked for my approach, complexity and asked to code it and run and then asked to optimize it.</p><p>3rd Ques: search number in 2D Matrix.</p><p>He asked for approach and then optimised it, I explained it writing psuedo code so he said leave execution.</p><p>Then we proceeded to Debugging Questions</p><p>Q1: if a project is deployed in an enviornment and let’s say some error occured how would you debug it. I couldn’t answer so he said for debugging where your code is stuck you would have to know which thread is running. Then i gave 2–3 answers he said no and then he told me command to run which is thread kill and thread interuption will happen and then asked me what it is.</p><p>Q2: how would you know which port your program is running. not through code but by terminal. I said i don’t know so he said no issues then proceeded with Theory questions</p><p>Theory Question : These were pure Java questions. it was more of a discussion round. 1 Question is asked and then more questions based on my answe</p><p>Ques were — what is thread dump ? , how 2 threads run parallely. ans — synchronisation. how is this implemented. in case of using a variable to achieve synchronisation what should be its type, ans — volatile, synchronised keyword.</p><p>what is Singleton Design Pattern ? based on my answer he asked where is it used ? Is the constructor private ? how do you ensure only 1 thread is created ? how does synchronisation happen ? what is lock ?</p><p>there were some other questions too in this discussion but i forgot them.</p><p>after interviw he said any questions and i asked them.</p><p>after 1 week i received call from HR for next round.</p><p><strong>Round 3 : Tech Round 2</strong></p><p>He asked for brief Introduction and then shared google docs link.</p><p>there was already 1 question there.</p><p>Q1 : Find first rotated index in sorted and rotated array.</p><p>Input: [4,5,6,1,2] output : 3.</p><p>Asked for approach, dry run and then code it. Not psuedo code, proper code but only func.</p><p>Q.2 you have multiple users and time frame when that user logged in, you have to write an SQL Query where you have to show the number of times a user visited. visit is counted everytime a user logs in and the current time is more than 1 hr of last visited time.</p><p>I explained using CTE, so he asked me can you solve it using time window i said i am not aware of that topic so he told me to leave it. I said but with CTE, we can achieve this but he didn’t listen and asked to solve it using Java and i did so he moved to next ques.</p><p>Q.3 you are at server and everytime a server logs in with a file location and in output you have to give new files that are recorded.</p><p>t=0, Input: file1, Output : file1</p><p>t=1, Input: file1/file2,</p><p>Output already had file1. so this time only file2 will log.</p><p>I explained the approach then asked me couple of questions based on that answer.</p><p>at the end, asked me if i had any questions and then we discussed on that ques.</p><p>after 1 hour i received pre offer mail.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f67bcaee593a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>