.NET Interview Questions Asked in Cognizant Walk-in Drive, Indore 2025
.NET Interview Questions Asked in Cognizant Walk-in Drive, Indore 2025
I am talking about my interview experience during the Cognizant walk-in drive for .NET Developer and Lead positions in Indore.
Interview Process:
-
Entry and Token System:
- Upon arrival, we were given tokens at the campus and directed to get coupon codes from a designated place.
- These coupon codes included the URL for the registration form, which was a Microsoft-based survey form. We needed to scan and fill out this form to apply for the positions.
-
Waiting Area:
- After filling out the form, we entered the office with our coupon codes.
- There were around 500 candidates present, and we continuously monitored announcements for our names to be called for the interview.
-
Interview Rounds:
- There were two interview rounds conducted on the company premises.
- Some candidates had face-to-face interviews, while others participated in virtual interviews.
- During the virtual interviews, we were provided with laptops on-site.
Interview Questions and Answers:
- Introduction: The first question was to introduce ourselves, considering our background and technical skills.
- Technical Questions:
- Difference between
varanddynamic
// var: The type is determined at compile time var number = 10; // 'number' is of type int // dynamic: The type is determined at runtime dynamic obj = 10; obj = "Hello"; // 'obj' is now of type string - Difference between
- Explanation of
refandoutkeywords
void SampleRef(ref int x)
{
x = 20;
}
void SampleOut(out int x)
{
x = 30;
}
int a = 10;
SampleRef(ref a); // a is now 20
int b;
SampleOut(out b); // b is now 30
public delegate void DisplayMessage(string message);
public class Program
{
public static void Main()
{
DisplayMessage dm = ShowMessage;
dm("Hello, Delegate!");
}
public static void ShowMessage(string message)
{
Console.WriteLine(message);
}
}
// SOLID Principles:
// S: Single Responsibility Principle
// O: Open/Closed Principle
// L: Liskov Substitution Principle
// I: Interface Segregation Principle
// D: Dependency Inversion Principle
public class Bird
{
public virtual void Fly() { Console.WriteLine("Flying"); }
}
public class Sparrow : Bird { }
public class Ostrich : Bird
{
public override void Fly()
{
throw new InvalidOperationException("Ostriches cannot fly");
}
}
varchar and char data types in SQL// varchar: Variable-length character data
// char: Fixed-length character data
// Default constructor
MyClass obj1 = new MyClass();
// Parameterized constructor
// Parameterized constructor
MyClass obj2 = new MyClass(10);
// Singleton pattern
public sealed class Singleton
{
private static readonly Singleton instance = new Singleton();
private Singleton() { }
public static Singleton Instance
{
get { return instance; }
}
}
// Singleton Pattern Example
public sealed class Singleton
{
private static readonly Singleton instance = new Singleton();
private Singleton() { }
public static Singleton Instance
{
get { return instance; }
}
}
public class Program
{
public static void Main()
{
string str = "Hello, World!";
string reversedStr = ReverseString(str);
Console.WriteLine(reversedStr);
}
public static string ReverseString(string str)
{
char[] charArray = str.ToCharArray();
Array.Reverse(charArray);
return new string(charArray);
}
}
public class Program
{
public static void Main()
{
int[] numbers = { 1, 2, 2, 3, 4, 4, 5 };
int[] distinctNumbers = RemoveDuplicates(numbers);
Console.WriteLine(string.Join(", ", distinctNumbers));
}
public static int[] RemoveDuplicates(int[] numbers)
{
return numbers.Distinct().ToArray();
}
}
Feedback:
The interview went well, but I haven't received any feedback yet. They mentioned that feedback would be shared in the upcoming days, and I am still waiting for it.
Thanks, everyone, for reading about my interview experience and the process involved.
You may also like: RM CAT6A Cable Box Dealers Available in India
Likes 0 · Dislikes 0
Log in to like or dislike this
post.
Leave a Reply
Please log in to comment on this post.