This summer, Nirvana Insurance hosted a group of four software engineering interns in our Bangalore office, where they had the opportunity to contribute to our core product offering. As their internships come to an end, we’ll be spotlighting each of the interns and their projects over the next few weeks.

Kushagra Gupta
Kushagra is a senior at the Indian Institute of Technology, Delhi (IITD), pursuing a Bachelors of Technology (B.Tech) in Mathematics & Computing. Previously, he’s worked on machine learning (ML), and data science projects. Currently, he’s focusing on mastering backend development and exploring the intricacies of graph algorithms. When he’s not coding for school or work, he’s coding competitively & for fun, traveling, and practicing his photography skills.
The Project
Nirvana’s pricing models consist of a core pricing engine written in our in-house domain-specific language (DSL) known as RateML. These models are versioned based on factors like geographies and periodic updates. Because of this, Nirvana is required to rerun the same model for more than a year for each customer, imposing backward compatibility requirements on the system. This requires the engineering team to oversee multiple models and accompanying model glue code.
Enter Kushagra, embarking on his internship here at Nirvana, ready to dive in and learn something new. His mission? To create a novel testing framework for the complex pricing engine dependencies we’ve outlined above. His primary objective was to implement continuous integration (CI) tests for pricing engines, designed to detect regressions in the pricing pipeline for all of Nirvana’s pricing models. While the initial focus was on validating the pricing model’s output, as the project evolved, Kushagra and his team expanded their objectives to include crafting assertions that could uncover potential bugs within the rating model.

The Challenges
While parallelizing pricing engine tests, the team confronted a race issue. Tests, although correct, unexpectedly timed out specifically when executed in parallel. Kushagra set out to tackle this conundrum by integrating internally developed components, which came with a dose of legacy code. This legacy code required extensive analysis before integration.
In addition to legacy code analysis, Kushagra also dove into the intricacies of managing race conditions in concurrent operations and ensured that the data insertion into the database adhered to the principles of atomicity, isolation, & durability (ACID).
Despite all of these challenges, the core challenge with testing the pricing engine was its dependence on multiple data sources, leading to inefficient database and API calls. The next section reveals how Kushagra designed the testing framework while navigating these challenges.
The Solution
To ensure the required efficiency of his design, Kushagra collaborated with the engineers behind the original RateML pricing framework, tapping into their expertise to craft an optimal solution. Their goal was to write O(n) tests while still achieving reasonable coverage on models that scaled quadratically.
Kushagra and the team first identified which parts of the pricing codebase underwent frequent changes. Concurrently, he researched strategies for implementing parametric tests capable of validating changes across multiple models simultaneously.
Initially, Kushagra’s tests were time-intensive, averaging more than 120 seconds per variation. To address this, he implemented extensive fixtures and fakes. He and the team also parallelized the tests to concurrently handle the 300-and-growing number of variations.

As he was building out the solution to this problem, he leaned heavily on his Nirvana mentor, Ayush Sharma. Ayush guided Kushagra with patience as they engaged in various code debugging sessions and collaborative research.
After completing his initial project, he had the opportunity to work on product enhancements in the auth components, namely the forgot password flow and supporting bulk user insertion. On these new projects, Vedant Mamgain became his mentor, further enhancing his understanding of coding practices at Nirvana. His guidance focused on code writing, coding best practices, and optimizing functionality.

Why Nirvana
“My introduction to Nirvana came through our college’s placement cell, and I also sought insights from seniors and my LinkedIn connections. It became evident that Nirvana held a distinct position among early-stage startups. The founders’ unique backgrounds piqued my interest. As someone passionate about computer science, I derive satisfaction from writing code that has real-world impact, contributes to product development, and yields visible outcomes. To me, Nirvana seems like the perfect platform to refine skills and immerse myself in the dynamic startup culture. The diverse backgrounds of Nirvana’s employees also attracted me, promising ample exposure during my time there.
This held true as I worked extensively on the product side of projects, such as refining the user flow for forgotten passwords and streamlining the process for creating bulk users.”
Life at Nirvana
“Starting at Nirvana was an incredibly smooth process, thanks to the strong support from the entire team. Ayush, my mentor, played a significant role during my time there. He patiently addressed all my queries and guided me through various problem-solving discussions. Engaging in code debugging sessions and collaborative research was a part of our enjoyable interactions. In subsequent projects, Vedant became my mentor, further enhancing my understanding of coding practices at Nirvana. His guidance focused on code writing, best practices, and optimizing functionality.
My overall interaction with the team was positive and enriching. Besides work-related conversations, we often organized outings and engaging events in Bangalore. Our connection extended to lunchtime gatherings, where we enthusiastically discussed common interests, favorite shows, and movies.”








