Skip to main content

Posts

Showing posts with the label software development

Fixing Multiple Switch Case Problem in C#

 I n this Chapter we will see how we can fix growing switch case which cause code maintainability issue In our development projects we may have below situation where switch cases increase with time and getting difficult to maintain Let’s understand problem using System; class Program { static void ProcessOrder ( string orderType ) { switch (orderType) { case "NEW_ORDER" : Console.WriteLine( "Processing new order." ); // New order logic here break ; case "CANCEL_ORDER" : Console.WriteLine( "Cancelling order." ); // Cancel order logic here break ; case "SHIPPING" : Console.WriteLine( "Shipping order." ); // Shipping logic here break ; case "DELIVERED" : Console.WriteLine( "Ord...

Best practice Generic List Filter using Func in C#

  In this Chapter we will learn about Func<x,y> delegate and its real time implementations and will see how we can create centralize functions to filter generic list. Basic Definition Func delegates offer a straightforward approach to defining and utilising methods by passing them as parameters and returning them as results. Func<>  is a delegate type for methods that return a value. we can have up to 16 parameters, with the return type always being the last type parameter. It’s useful for passing methods as arguments or working with lambda expressions in a clean and concise way. Syntax Consider below syntax, it has two parts left and right. Right side of lamba expression is return value and Left side of lamba expression is input parameters. Example:  This is simple code using System; class Program { static void Main () { // A Func delegate that adds two integers Func< int , int , int > add = (x, y) => x + y; int ...

ITC Infotech - .Net Full Stack 14 Year Exp Interview Questions - Jan 2025

  I am sharing interview details those I encountered few days back. Photo by  Walls.io  on  Unsplash Basic Details. a.  Company URL  :  ITC Infotech — Business Solutions | Technology & IT Services b.  Headcount - approx. 17000 c.  Parent Company : ITC LTD (BSE / NSE Listed) d.  Location : Gurugram (India) — Work from Office 3 days in week e.  Salary offered : 35 Lac per annum f.  Expected period to join : 45 days max f.  Position : .NET Full stack Lead. Now days I found most of IT companies are going with online interviews. Here they are using dedicated platforms those are helpful in managing and assuring integrity of candidates during online interview. Integrity is very important because, nowadays, the concept of proxy support for interviews is flourishing. In this practice, the candidate only needs to appear online, while someone else speaks on their behalf. Since interviews are conducted online, it becomes very diff...