Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About Virtusa hiring for MEAN Stack roles
Virtusa is a digital engineering and IT services company providing application development, testing, cloud and data services. It has a strong client base in banking, financial services, healthcare and telecom. Its India centres in Hyderabad, Chennai and Bengaluru hire for software engineers, test engineers and data professionals.
For MEAN Stack roles, this Virtusa practice set focuses most on Services, Dependency Injection and Routing (6), Angular Components and Templates (5), Node.js and Express APIs (5), MongoDB Data Modelling and Queries (4). It has 10 easy, 16 medium, 4 hard questions, so you can start easy and work up to the harder ones.
Company type
IT services
Headquarters
Southborough, Massachusetts, USA
Main India offices
Hyderabad, Chennai, Bengaluru
Virtusa MEAN Stack interview process
Online assessment (aptitude + reasoning)
Coding test
Technical interview
HR round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for VirtusaStart 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
How do you test an Angular service that makes HTTP calls?
Provide provideHttpClient() and provideHttpClientTesting() in TestBed, then inject the service and HttpTestingController. Call the service method and subscribe, use httpMock.expectOne('/api/products') to capture the request, assert its method and body, and flush a fake response. Finally call httpMock.verify() to ensure no unexpected requests remain. This tests the service logic without a real backend.
02
Write a debounced search helper in TypeScript using a closure.
A typed debounce keeps argument types.
function debounce<A extends unknown[]>(fn: (...args: A) => void, ms = 300) {
let timer: ReturnType<typeof setTimeout> | undefined;
return (...args: A) => {
clearTimeout(timer);
timer = setTimeout(() => fn(...args), ms);
};
}
const search = debounce((term: string) => console.log('search', term), 400);
search('ang');
In Angular you would usually use the RxJS debounceTime operator instead.
03
Write a custom pure pipe that shortens long text with an ellipsis.
Directives add behaviour to elements. Components are directives with templates. Attribute directives change appearance or behaviour of an existing element, such as ngClass, ngStyle or a custom appHighlight using host bindings. Structural directives change the DOM layout by adding or removing elements, like the older *ngIf and *ngFor, now largely replaced by built-in control flow. Custom directives keep repeated DOM logic out of components.
05
Wallet balance updates sometimes produce wrong totals when two purchases happen at the same time. How do you fix this?
Reading the balance, changing it in code and saving it creates a lost-update race. Use an atomic update instead: updateOne({ _id: userId, balance: { $gte: amount } }, { $inc: { balance: -amount } }) and check modifiedCount to confirm funds were sufficient. If the operation also writes a transaction record, wrap both in a multi-document transaction. Optimistic concurrency with a version field is another option.
06
Serve the built Angular app and the API from one Express server.
@defer lets you lazy load part of a template and its dependencies only when a trigger occurs, such as on viewport, on interaction, on hover, on idle, on timer or a custom condition with when. Angular automatically splits that code into a separate chunk. You can show @placeholder, @loading and @error blocks. It is ideal for heavy below-the-fold widgets like charts, comments and maps.
08
Explain the four types of data binding in Angular.
Interpolation, {{ value }}, displays component data as text. Property binding, [src]='imageUrl', sets a DOM or component property. Event binding, (click)='save()', calls a method when an event fires. Two-way binding, [(ngModel)]='name' or [(value)] with a model input, combines property and event binding so the view and component stay in sync. Data flows one way by default, which keeps changes predictable.
09
Write an injectable service that fetches and caches a list of categories.
inject() retrieves a dependency inside an injection context, such as a field initialiser, constructor, factory or functional guard. It removes long constructor parameter lists, works in plain functions like functional guards, interceptors and resolvers, and makes inheritance simpler because subclasses do not need to pass dependencies to super. Constructor injection still works, but modern Angular code and CLI templates favour inject().
11
What are injection tokens and when do you need them?
An InjectionToken is a unique key for providing values that are not classes, such as configuration objects, API base URLs or feature flags. You create it with new InjectionToken<AppConfig>('APP_CONFIG'), provide it with { provide: APP_CONFIG, useValue: config }, and read it with inject(APP_CONFIG). Other provider types include useClass to swap implementations, useFactory for computed values and useExisting for aliases.
12
Write a resolver that loads a product before the detail page opens.
MongoDB Atlas is the fully managed cloud service for MongoDB on AWS, Azure and Google Cloud. It handles provisioning, replica sets, automated backups, scaling, monitoring, security features like network access lists and encryption, and performance advice such as index suggestions. It also offers Atlas Search, Vector Search and data federation. A free tier makes it popular for learning projects and MEAN prototypes.
14
What are HTTP interceptors and what are common use cases?
Interceptors sit between HttpClient and the server and can modify every request and response. Modern Angular uses functional interceptors of type HttpInterceptorFn registered through withInterceptors. Common uses are attaching an Authorization header, adding a base URL, showing a global loading indicator, logging, retrying failed requests, refreshing expired tokens and mapping errors to user-friendly messages. Interceptors run in the order they are listed.
15
What are the main steps to deploy a MEAN application to production?
Build Angular with ng build to produce optimised static files and compile the TypeScript API. Host the Angular files on a CDN, static host or Nginx, and run the API on a VM, container service or Kubernetes with environment variables. Use MongoDB Atlas or a managed replica set. Configure HTTPS, domain DNS, CORS, logging and monitoring, and automate everything through a CI/CD pipeline.
16
Create a counter component with signal, computed and effect.
A component controls a piece of the screen. It is a TypeScript class decorated with @Component, which provides a selector used as an HTML tag, a template or templateUrl for the view, styles or styleUrl for scoped CSS, and imports for other standalone components, directives and pipes it uses. The class holds data and event handlers, and the template binds to them.
18
How do you handle disagreements with a UI designer about how a form should behave?
Situation: a designer wanted validation errors only after submit, but users were missing errors on long forms. Task: reach an agreement quickly. Action: I shared quick screen recordings comparing both approaches and pointed to accessibility guidelines, then proposed validation on blur with a summary at the top on submit. Result: the designer agreed, we tested it with users and the pattern became part of our design system.
19
Your Express API is used by thousands of users and occasionally crashes due to an unhandled promise rejection. How do you make it more resilient?
Find the root cause from logs and fix missing await or catch blocks. Use Express 5, which forwards async errors to error middleware, or an async wrapper in Express 4. Add a central error handler, log unhandledRejection and uncaughtException and then exit cleanly. Run under PM2 or a container orchestrator with multiple instances and health checks so a crash restarts one instance while others keep serving.
Narrowing is TypeScript refining a broad type to a more specific one inside a code block based on checks. typeof, instanceof, the in operator, equality checks and discriminated union tags all narrow types. A custom type guard is a function returning a predicate like value is Admin, which tells the compiler the type after the check. This makes handling union types, such as API success or error responses, safe.
21
Explain the difference between switchMap, mergeMap, concatMap and exhaustMap.
All map each source value to an inner Observable but differ in concurrency. switchMap cancels the previous inner Observable, ideal for search. mergeMap runs all inner Observables in parallel, good for independent uploads. concatMap queues them and runs one at a time in order, good for sequential saves. exhaustMap ignores new values while one is active, ideal for preventing duplicate login or submit clicks.
22
Show the tsconfig settings you would enable for a strict Node.js Express API.
Do not make the user wait for third-party providers. After saving the user, publish an event or add jobs to a queue and return the response immediately. Workers send the email and SMS with retries and backoff, and failures are logged without affecting signup. An EventEmitter is enough for a quick in-process version, but a persistent queue survives restarts and scales across instances.
25
How do you set up an Express project with TypeScript?
Install express and types with npm i express and npm i -D typescript @types/express @types/node. Create a tsconfig with strict mode and a module setting like NodeNext, write code in src and compile to dist with tsc. For development, run TypeScript directly with tsx watch, and use node dist/server.js in production. Type request bodies, params and responses with Request and Response generics or validated schemas.
26
What is middleware in Express, and what kinds of middleware are there?
Middleware is a function with access to req, res and next that runs in order for matching requests. Kinds include application-level middleware registered with app.use, router-level middleware on an express.Router, built-in middleware like express.json and express.static, third-party middleware such as cors, helmet and morgan, and error-handling middleware with four arguments. Middleware can end the response or pass control with next().
27
What is TestBed and how is it used to test an Angular component?
TestBed is Angular's testing utility that creates a test environment similar to the application's. You call TestBed.configureTestingModule with the standalone component in imports and any mock providers, then createComponent to get a ComponentFixture. The fixture gives access to the component instance and its rendered DOM. Call fixture.detectChanges() or await fixture.whenStable() to update the view, then assert on the DOM or component state.
Define a TypeScript interface for the document, then create a Schema typed with that interface and a model with model<IUser>('User', userSchema). Mongoose infers types for queries, so findById returns a typed document. For lean queries, results are plain typed objects. Schema options like timestamps add createdAt and updatedAt, and you can type instance methods, statics and virtuals through additional generic parameters.
29
How do you read route parameters and query parameters in an Angular component?
Inject ActivatedRoute and read paramMap or queryParamMap, which are Observables, for example route.paramMap.pipe(map(p => p.get('id'))), so the component updates when the same route is reused with a new id. A snapshot gives a one-time value. With withComponentInputBinding enabled in provideRouter, route params, query params and resolver data can bind directly to component inputs, which is the simplest modern approach.
30
Your MongoDB collection of sensor readings is growing by millions of documents per day. How would you design for it?
Use a time series collection, which stores readings efficiently in compressed buckets with a timeField and metaField such as deviceId. Set expireAfterSeconds to drop old raw data, and keep hourly or daily aggregates in a separate collection for dashboards. Index on metaField and time, write in batches with insertMany, and plan sharding by device or a hashed key if a single replica set cannot keep up.
Tips to crack the Virtusa MEAN Stack interview
Revise banking and healthcare domain basics, which are important industries in Virtusa's client portfolio.
Practise coding questions and SQL queries for both the online test and technical interview.
Learn about its engineering-first positioning and be ready to describe how you approach learning new tools.
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; Virtusa interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the Virtusa MEAN Stack interview?
Candidates usually go through 4 stages: Online assessment (aptitude + reasoning); Coding test; 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 Virtusa MEAN Stack interview?
This practice set leans on Services, Dependency Injection and Routing (6), Angular Components and Templates (5), Node.js and Express APIs (5), MongoDB Data Modelling and Queries (4). Revise those first, then practise explaining one or two of your own projects end to end, because most Virtusa interviewers ask you to walk through real work.
Are these the exact questions asked at Virtusa?
No. These are curated practice questions that match the skills and difficulty usually tested in it services interviews like Virtusa's. They are not a leaked or verified list of past questions.
Where does Virtusa hire MEAN Stack professionals in India?
Virtusa has large teams in Hyderabad, Chennai, Bengaluru. Openings and locations change often, so check the Virtusa careers page and filter by city and experience.