Skip to content

Cognizant .NET Full Stack Interview Questions & Answers

Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.

About Cognizant hiring for .NET Full Stack roles

Cognizant is a US-headquartered IT services and consulting company with most of its workforce based in India. It provides application development, testing, cloud, digital engineering and data analytics services, with strong practices in healthcare, insurance and banking. In India it hires for programmer analyst, quality engineer and data roles through campus and off-campus programmes such as GenC.

For .NET Full Stack roles, this Cognizant practice set focuses most on OOP in C# (5), LINQ, Collections and Generics (5), C# Fundamentals (4), Angular and React Front End (4). It has 19 easy, 11 medium questions, so you can start easy and work up to the harder ones.

Company type
IT services
Headquarters
Teaneck, New Jersey, USA
Main India offices
Chennai, Bengaluru, Pune, Hyderabad, Kolkata

Cognizant .NET Full Stack interview process

  1. Online assessment (aptitude + reasoning)
  2. Coding assessment
  3. Technical interview
  4. HR round

Typical pattern based on public candidate experiences. Rounds vary by role, team and year.

Solved for CognizantStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

Which HTTP status codes and methods should a REST API use, and what is the difference between PUT and PATCH?

Save to ▾
Show answer
GET reads, POST creates, PUT replaces, PATCH partially updates and DELETE removes. Return 200 OK for success with a body, 201 Created with a Location header after POST, 204 No Content after delete, 400 for invalid input, 401 unauthenticated, 403 forbidden, 404 not found, 409 conflict and 500 for server errors. PUT sends the full resource and is idempotent; PATCH sends only changed fields.
02

Explain value types and reference types in C#.

Save to ▾
Show answer
Value types such as int, double, bool, enums and structs hold their data directly, and assigning one copies the value. Reference types such as classes, arrays, strings and delegates hold a reference to an object on the managed heap, so assigning copies only the reference. Changing a copied struct does not affect the original, but changing an object through a copied reference changes what both variables see.
03

What is the middleware pipeline in ASP.NET Core?

Save to ▾
Show answer
Every HTTP request passes through a chain of middleware components configured in Program.cs. Each component can inspect or modify the request, call the next one, and then work on the response on the way back. Order matters: exception handling first, then HTTPS redirection, static files, routing, CORS, authentication, authorization and finally endpoints. For example, putting UseAuthorization before UseAuthentication means users never appear logged in.
04

Write a stored procedure that transfers money between accounts with TRY-CATCH and a transaction.

Save to ▾
Show answer
CREATE OR ALTER PROCEDURE usp_Transfer @From INT, @To INT, @Amt DECIMAL(18,2) AS BEGIN SET NOCOUNT ON; SET XACT_ABORT ON; BEGIN TRY BEGIN TRAN; UPDATE Accounts SET Balance = Balance - @Amt WHERE Id = @From AND Balance >= @Amt; IF @@ROWCOUNT = 0 THROW 50001, 'Insufficient balance', 1; UPDATE Accounts SET Balance = Balance + @Amt WHERE Id = @To; COMMIT; END TRY BEGIN CATCH IF @@TRANCOUNT > 0 ROLLBACK; THROW; END CATCH END
05

What is the difference between method overloading and method overriding?

Save to ▾
Show answer
Overloading means several methods with the same name but different parameter lists in the same class, resolved at compile time, for example Add(int, int) and Add(double, double). Overriding means a derived class provides a new implementation of a virtual or abstract base method with the same signature, resolved at runtime based on the actual object type. Overloading is compile-time polymorphism; overriding is runtime polymorphism.
06

Tell me about a time you had to learn a new C# or .NET feature quickly.

Save to ▾
Show answer
In my final-year project (Situation) our team needed async file uploads, but I only knew synchronous code. My task was to build the upload API within a week. I read the official async/await docs, built a small console demo, then refactored our controller to use async methods and IFormFile streaming. The result was uploads that no longer blocked requests, and I shared a short note with my team.
07

What do async and await do in C#?

Save to ▾
Show answer
async marks a method that can contain await, and the compiler turns it into a state machine. await pauses the method until a Task finishes without blocking the thread; the thread returns to the pool to do other work and the method resumes later, often on another thread. It is ideal for I/O such as database calls, HTTP requests and file reads. An async method returns Task, Task<T> or ValueTask.
08

Using LINQ, group employees by department and get the count and average salary.

Save to ▾
Show answer
var report = employees .GroupBy(e => e.Department) .Select(g => new { Department = g.Key, Count = g.Count(), AvgSalary = g.Average(e => e.Salary) }) .OrderByDescending(x => x.AvgSalary) .ToList(); GroupBy returns groups with a Key, and aggregate methods run per group. With EF Core this translates to SQL GROUP BY.
09

How would you deploy an Angular or React front end together with an ASP.NET Core API?

Save to ▾
Show answer
Two common options exist. Build the SPA with ng build or npm run build and serve the static files from the API's wwwroot with UseStaticFiles and MapFallbackToFile, giving one deployment and no CORS. Or host the SPA separately on a CDN or static hosting such as Azure Static Web Apps and the API on App Service or containers, which scales independently. Use environment config for API URLs and a CI/CD pipeline for both.
10

What is the difference between const, readonly and static readonly?

Save to ▾
Show answer
const is a compile-time constant, implicitly static, and its value is copied into calling assemblies, so changing it requires recompiling them. readonly fields are set at declaration or in the constructor and can differ per instance. static readonly is set once per type at runtime, so it can hold values like DateTime.Now or a new object. Use const only for values that will never change, such as Math.PI.
11

What is the difference between compile-time and runtime polymorphism?

Save to ▾
Show answer
Compile-time, or static, polymorphism is resolved by the compiler, mainly through method overloading and operator overloading, and through generics. Runtime, or dynamic, polymorphism is resolved when the program runs, through virtual methods and interfaces: a Shape reference may call Circle.Area or Square.Area depending on the actual object. Runtime polymorphism is what makes plugin designs and dependency injection possible.
12

What is the difference between concurrency and parallelism?

Save to ▾
Show answer
Concurrency means dealing with many tasks at once by interleaving them, for example a web server handling thousands of requests that mostly wait on I/O. Parallelism means doing many computations at the same instant on multiple cores, such as processing an image in four chunks. async/await gives concurrency; Parallel.For and PLINQ give parallelism. A program can be concurrent on a single core but parallel only with multiple cores.
13

What is LINQ and why is it useful?

Save to ▾
Show answer
LINQ, Language Integrated Query, lets you query collections, databases, XML and other sources with the same C# syntax using methods like Where, Select, OrderBy and GroupBy. Queries are type-checked at compile time and read close to the intent, for example orders.Where(o => o.Total > 500).OrderBy(o => o.Date). With EF Core, the same LINQ expression is translated into SQL, so you rarely write raw SQL strings.
14

What is Entity Framework Core?

Save to ▾
Show answer
EF Core is Microsoft's object-relational mapper for .NET. It maps C# classes to database tables, translates LINQ queries into SQL, tracks changes to loaded objects and saves them with SaveChanges. It supports SQL Server, PostgreSQL, MySQL, SQLite, Cosmos DB and more through providers. It removes most hand-written data access code, while still allowing raw SQL when needed. EF Core 10 ships with .NET 10.
15

What is the difference between DELETE, TRUNCATE and DROP?

Save to ▾
Show answer
DELETE removes rows one by one, supports WHERE, fires triggers and is fully logged, so it is slower on big tables. TRUNCATE removes all rows by deallocating pages, is minimally logged, resets identity values and cannot have WHERE; it fails if foreign keys reference the table. DROP removes the whole table including structure, indexes and permissions. In SQL Server, both DELETE and TRUNCATE can be rolled back inside a transaction.
16

Show the useState and useEffect hooks in a React component.

Save to ▾
Show answer
import { useState, useEffect } from 'react'; export function Timer() { const [seconds, setSeconds] = useState(0); useEffect(() => { const id = setInterval(() => setSeconds(s => s + 1), 1000); return () => clearInterval(id); // cleanup on unmount }, []); // empty array: run once return <p>Elapsed: {seconds}s</p>; } useState stores state that triggers re-render; useEffect runs side effects after render, and its dependency array controls when it re-runs.
17

What are the four pillars of object-oriented programming?

Save to ▾
Show answer
Encapsulation hides internal state behind methods and properties. Abstraction exposes only what the caller needs, using abstract classes and interfaces. Inheritance lets a class reuse and extend another class. Polymorphism lets one interface have many implementations, so code calls Pay() without knowing whether it is a card or UPI payment. Together they make code easier to change, test and reuse.
18

Explain the access modifiers in C#, including protected internal and private protected.

Save to ▾
Show answer
public is accessible everywhere, private only inside the type, protected inside the type and derived types, and internal anywhere in the same assembly. protected internal means accessible from the same assembly or from derived types in any assembly. private protected is stricter: only derived types inside the same assembly. Class members default to private and top-level types default to internal. Use the narrowest modifier that works.
19

Show encapsulation using properties, including init-only and validation.

Save to ▾
Show answer
public class BankAccount { public string AccountNo { get; init; } = ""; public decimal Balance { get; private set; } public void Deposit(decimal amount) { if (amount <= 0) throw new ArgumentOutOfRangeException(nameof(amount)); Balance += amount; } } var acc = new BankAccount { AccountNo = "SB1001" }; Balance can only change through Deposit, and AccountNo can be set only during object creation.
20

What is the difference between props and state in React?

Save to ▾
Show answer
Props are inputs passed from a parent component to a child, like function arguments, and the child must not modify them. State is data owned and managed inside a component with useState or useReducer, and changing it re-renders the component. For example, a ProductCard receives product details as props, while a Cart component keeps the quantity in state. Shared state is lifted up to a common parent or moved into a store.
21

What is the difference between a clustered and a non-clustered index?

Save to ▾
Show answer
A clustered index defines the physical order of the table's data, so the leaf level is the data itself, and a table can have only one. A non-clustered index is a separate structure with key values and a pointer back to the row, and a table can have many. Range queries on the clustered key are fast. Non-clustered indexes speed up searches on other columns but add cost to inserts and updates.
22

What is deferred execution in LINQ?

Save to ▾
Show answer
Most LINQ operators such as Where and Select do not run when you write them; they build a query that executes only when you enumerate it with foreach, ToList, Count or First. This means the query sees the latest data at enumeration time and can be composed step by step. The catch is that enumerating the same query twice runs it twice, which can mean two database calls. Call ToList to materialise once.
23

Tell me about a time you improved the performance of slow code.

Save to ▾
Show answer
In my previous role (Situation) a daily reconciliation job took 40 minutes and sometimes missed its window. My task was to bring it under 10 minutes. I profiled it and found nested loops over two large lists and one database call per row. I replaced the inner loop with a Dictionary lookup and batched the database reads. Result: the job ran in about 4 minutes, and I documented the approach for the team.
24

When would you use a HashSet<T>?

Save to ▾
Show answer
HashSet<T> stores unique values with O(1) average lookup, add and remove. Use it when you need fast membership checks, such as checking if an email already exists in a batch of 1 lakh records, or to remove duplicates. It also supports set operations like UnionWith, IntersectWith and ExceptWith. It does not keep insertion order or allow index access; use SortedSet<T> if you need sorted unique values.
25

Explain the types of data binding in Angular.

Save to ▾
Show answer
Interpolation {{ value }} shows component data in the template. Property binding [src]="imageUrl" sets an element or child property. Event binding (click)="save()" calls a component method on a DOM event. Two-way binding [(ngModel)]="name" combines property and event binding so the input and the field stay in sync. The first two flow from component to view, event binding flows from view to component.
26

What is the difference between code-first and database-first approaches?

Save to ▾
Show answer
In code-first, you write entity classes and a DbContext, and EF Core migrations create and evolve the database schema from code; it suits new projects and keeps schema in source control. In database-first, the database already exists and you scaffold entities with dotnet ef dbcontext scaffold. It suits legacy databases managed by a DBA team. Many teams scaffold once and then continue code-first.
27

What is the difference between .NET Framework, .NET Core and modern .NET?

Save to ▾
Show answer
.NET Framework is the original Windows-only runtime, now in maintenance mode at version 4.8.1. .NET Core was the cross-platform, open-source rewrite. From .NET 5 onwards the name became just .NET, and it runs on Windows, Linux and macOS. In 2026, .NET 10 is the current LTS release. New projects should use modern .NET; Framework is kept only for legacy apps such as old Web Forms or WCF services.
28

Configure a one-to-many relationship between Customer and Order using the Fluent API.

Save to ▾
Show answer
public class Customer { public int Id { get; set; } public List<Order> Orders { get; set; } = []; } public class Order { public int Id { get; set; } public int CustomerId { get; set; } public Customer Customer { get; set; } = null!; } protected override void OnModelCreating(ModelBuilder mb) { mb.Entity<Order>() .HasOne(o => o.Customer) .WithMany(c => c.Orders) .HasForeignKey(o => o.CustomerId) .OnDelete(DeleteBehavior.Restrict); mb.Entity<Order>().Property(o => o.Total).HasPrecision(18, 2); } Restrict prevents deleting a customer who still has orders.
29

How do model binding and validation work in ASP.NET Core Web API?

Save to ▾
Show answer
Model binding maps request data into action parameters from the route, query string, headers or body, using [FromRoute], [FromQuery] and [FromBody]. Validation uses data annotations like [Required], [StringLength] and [Range] on DTOs. With [ApiController], invalid models automatically return 400 Bad Request with ProblemDetails listing the errors, so you do not need to check ModelState manually. FluentValidation is popular for complex rules.
30

A page listing 100 orders with customer names runs 101 SQL queries. What is the problem and how do you fix it?

Save to ▾
Show answer
This is the N+1 problem: one query loads the orders, then lazy loading fires a separate query for each order's Customer. Fix it by loading everything in one query, either with Include(o => o.Customer) or better with a projection: Select(o => new OrderListDto(o.Id, o.Total, o.Customer.Name)), which fetches only needed columns via a join. Turn on EF Core logging to spot such patterns early.

Tips to crack the Cognizant .NET Full Stack interview

  • Understand the GenC, GenC Next and GenC Elevate tracks so you know which skills and coding level each role expects.
  • Revise SQL queries, OOP concepts and basic testing terminology since many freshers are placed in development or QA projects.
  • Read about Cognizant's healthcare and life sciences domain work, which is a large part of its client base.
  • Keep a one-minute story ready for every project on your CV: problem, your part, tools, result.
  • Practise the hard questions on this page aloud; Cognizant interviewers usually ask follow-ups on your first answer.

Frequently asked questions

How many rounds are there in the Cognizant .NET Full Stack interview?

Candidates usually go through 4 stages: Online assessment (aptitude + reasoning); Coding assessment; Technical interview; HR round. The exact rounds change with the role, team, location and your experience, so confirm the process with the recruiter.

Which topics should I prepare for the Cognizant .NET Full Stack interview?

This practice set leans on OOP in C# (5), LINQ, Collections and Generics (5), C# Fundamentals (4), Angular and React Front End (4). Revise those first, then practise explaining one or two of your own projects end to end, because most Cognizant interviewers ask you to walk through real work.

Are these the exact questions asked at Cognizant?

No. These are curated practice questions that match the skills and difficulty usually tested in it services interviews like Cognizant's. They are not a leaked or verified list of past questions.

Where does Cognizant hire .NET Full Stack professionals in India?

Cognizant has large teams in Chennai, Bengaluru, Pune, Hyderabad, Kolkata. Openings and locations change often, so check the Cognizant careers page and filter by city and experience.

.NET Full Stack questions for similar companies