36 practice questions with answers for MEAN Stack interviews in Nagpur.
MEAN Stack jobs in Nagpur
Nagpur's MIHAN SEZ hosts IT-services and BFSI delivery centres, giving central India a steady market for data and QA roles. Interviews are usually service-company style, with aptitude, technical and HR rounds.
Below are 36 questions that match the mix of service, product and domain employers hiring mean stack developers in Nagpur.
Solved for NagpurStart 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
Create a child component with a signal input and an output that emits when a button is clicked.
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().
03
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.
04
What is the difference between a monolith and microservices for a Node.js backend?
A monolith is one deployable API containing all modules, which is simpler to build, test and deploy, and is right for most early-stage products. Microservices split domains like orders, payments and notifications into separate services communicating over HTTP or message queues, allowing independent scaling and deployments, but adding network failures, distributed data and operational complexity. Many teams start with a modular monolith and split later.
05
How do you serve an Angular build and an Express API from the same Node server?
Build Angular with ng build, which outputs static files to dist/project/browser. In Express, register API routes under /api first, then serve the static files with express.static, and finally add a catch-all GET route that returns index.html so Angular routing works on refresh. In larger deployments, Nginx or a CDN usually serves the Angular files while Express handles only the API.
06
A list API that uses Mongoose populate on three references has become slow. How would you improve it?
Check how many queries populate triggers and how much data each returns. Select only needed fields in populate, use lean(), and add indexes on the referenced fields. If the list always needs a customer name, store it with the extended reference pattern to avoid the join entirely. For complex filtering on related data, switch to one aggregation with $lookup and $project, and paginate.
07
Write a custom type guard to check whether an API response is an error.
A type predicate narrows the union.
type ApiError = { error: true; message: string };
type ApiSuccess<T> = { error: false; data: T };
type ApiResult<T> = ApiError | ApiSuccess<T>;
function isApiError<T>(res: ApiResult<T>): res is ApiError {
return res.error === true;
}
if (isApiError(result)) {
console.error(result.message);
} else {
render(result.data);
}
Inside each branch TypeScript knows exactly which fields exist.
08
What does providedIn: 'root' mean and what are other ways to provide a service?
providedIn: 'root' registers the service with the application's root injector, so one shared instance exists and it is tree-shakable, meaning it is removed from the bundle if unused. You can also provide services in a component's providers array, giving each component instance its own copy, in a route's providers for a lazy feature, or in app.config.ts. The provider location decides scope and lifetime.
09
Write a functional HTTP interceptor that adds a JWT and handles 401 errors.
A regex without an anchored prefix cannot use a normal index efficiently and scans the collection. For simple word search, create a text index and use $text with a relevance score. For a better search experience with typo tolerance, autocomplete and facets, use Atlas Search or a dedicated search engine. Paginate results, limit fields with projection and debounce requests from the Angular search box.
11
Tell me about a time strong typing helped you catch a bug before it reached production.
Situation: we renamed the field amount to totalAmount in the orders API. Task: update the Angular app before release. Action: because our shared Order interface was typed and strict templates were on, the build failed in eleven places, including a payment summary I would have missed. I fixed each usage and added the change to the API changelog. Result: the release went out with no broken screens.
12
Two components on different pages need to share the selected city filter. How would you implement it?
Create a root-provided FilterService holding the city in a signal, with methods to update it, and inject the service into both components so they share the same instance. For persistence across reloads or shareable links, sync the value to a query parameter or local storage. If many features need shared state with complex updates, consider NgRx SignalStore or NgRx Store.
13
What are read concern and write concern in MongoDB?
Write concern controls how many replica set members must acknowledge a write before it is considered successful; w: 'majority' protects against losing data on failover, while w: 1 is faster but riskier. Read concern controls the consistency of data read, such as local for the latest on one node or majority for data acknowledged by most members. Choose stronger settings for payments and orders.
14
Tell me about a complex form you built and the challenges you solved.
Situation: I built a loan application form with five steps and over sixty fields. Task: make it reliable and user friendly. Action: I used typed reactive forms split into step groups, cross-field validators for income rules, a FormArray for co-applicants, auto-saved drafts every thirty seconds and mapped server validation errors back to fields. Result: drop-offs reduced noticeably and QA found very few form bugs.
15
What is an Angular component and what are its main parts?
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.
16
How does change detection work in Angular, and what does OnPush do?
Change detection checks component bindings and updates the DOM when data changes. Traditionally Zone.js patched async APIs and triggered a check of the whole tree after events, timers and HTTP calls. With ChangeDetectionStrategy.OnPush, a component is checked only when an input reference changes, an event fires inside it, an async pipe emits or a signal it reads changes. OnPush with immutable data greatly reduces work.
17
Write a generic TypeScript function that groups an array of items by a key.
Use timer(0, 5000) piped into switchMap to call the status API, then takeWhile(status => status !== 'delivered', true) to stop after the final status, including it. Add takeUntilDestroyed so polling stops if the user leaves, and retry with a delay for transient errors. For long waits, server-sent events or websockets are more efficient than polling, which wastes requests.
19
What testing tools are used in Angular projects today?
Angular's CLI has moved to Vitest as the default unit test runner for new projects, replacing the deprecated Karma, while many existing projects still run Karma with Jasmine or have switched to Jest. TestBed configures components and services for tests, HttpTestingController mocks HTTP calls, and component harnesses from the CDK simplify interaction tests. Playwright or Cypress handle end-to-end tests.
20
Tell me about a time you improved the structure of an Angular application.
Situation: our app had one huge shared module and every page loaded everything, so the first load was slow. Task: I proposed restructuring as part of a performance goal. Action: I converted features to standalone components, split them into lazy routes with canMatch guards, moved shared logic into root services and removed dead code. Result: the initial bundle shrank by about 45 percent and new developers found features faster.
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.
22
How does the Node.js event loop affect the way you write Express route handlers?
Every request handler runs on the same main thread, so any synchronous heavy work, such as a large loop, JSON parsing of huge payloads, sync file reads or bcrypt with sync methods, blocks all other requests. Write handlers with async I/O, keep CPU work small, stream large data, and offload heavy jobs to worker threads or a queue. Monitor event-loop lag in production to catch blocking code.
23
What is the difference between valueChanges and statusChanges, and what does updateOn do?
valueChanges is an Observable that emits the new value whenever a control or group changes, useful for dependent fields or type-ahead search. statusChanges emits when validation status changes between VALID, INVALID, PENDING and DISABLED. The updateOn option controls when value and validation update: change by default, blur to validate when the field loses focus, or submit to validate only on form submission.
24
Write an Express JWT verification middleware in TypeScript.
Situation: I joined a project with over 300 components and a bug fix due in three days. Task: understand the order module fast. Action: I read the routing configuration to map features, used Angular DevTools to inspect the component tree and state, traced the service calls with network logs, and asked a teammate for a thirty-minute walkthrough. Result: I fixed the bug in two days and wrote a short module guide.
26
The security team asks you to move JWTs out of localStorage in the Angular app. What design would you propose?
Issue a short-lived access token kept only in memory in an Angular auth service, and a refresh token in an httpOnly, Secure, SameSite cookie scoped to the refresh path. On page load, call the refresh endpoint to get a new access token. An interceptor attaches the access token and refreshes on 401. Rotate refresh tokens and store their hashes server-side so they can be revoked.
27
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.
28
After a new release, a bug affects many users. How do you respond and prevent a repeat?
First limit the impact: roll back to the previous version or disable the feature with a flag, and communicate status to support. Then reproduce the bug, fix it with a test that covers the case, and redeploy through the normal pipeline. Afterwards, run a blameless post-mortem to find gaps, such as missing tests, review or monitoring, and add the actions to the backlog.
29
A penetration test report says your API returns other users' invoices when the invoice id is changed. How do you fix it?
This is broken object-level authorization, the top API risk in the OWASP list. Fix every query to scope by the authenticated user, for example Invoice.findOne({ _id: id, userId: req.user.id }), and return 404 when not found. Centralise ownership checks in services or middleware, add tests that try cross-user access, and review similar endpoints. Avoid relying on unguessable ids as protection.
30
What are databases, collections and documents in MongoDB?
A MongoDB deployment holds multiple databases, each database contains collections, and each collection contains documents. A document is a BSON object with fields, arrays and nested sub-documents, identified by a unique _id. Collections are roughly like tables but do not force all documents to share the same fields, although schema validation can enforce rules. A single document can be up to 16 MB in size.
31
Angular calls the Express API on a different port during development and gets CORS errors. What are your options?
In development, the cleanest fix is an Angular dev server proxy: a proxy.conf.json mapping /api to http://localhost:3000, so the browser sees same-origin requests. Alternatively enable the cors middleware in Express with the Angular origin allowed. In production, serve both under one domain through Nginx or configure CORS with an explicit allowlist, enabling credentials only when cookies are used.
32
What are standalone components and why are they now the default?
Standalone components declare their own dependencies in an imports array instead of belonging to an NgModule. Since Angular 19 they are the default, and the CLI generates them without NgModules. They reduce boilerplate, make lazy loading simpler with loadComponent, improve tree shaking and make components easier to understand and test. Applications bootstrap with bootstrapApplication and configure providers in app.config.ts.
33
The same card layout with an image, title and actions is copied across ten pages. How would you refactor it?
Create a reusable standalone card component with inputs for title, image and data, and use content projection with ng-content and named slots, like select='[card-actions]', so each page can pass its own buttons. Put shared styles in the component. Add a directive or pipe for repeated formatting. This reduces duplication, keeps styling consistent and makes future design changes a one-place edit.
34
Users double-click the Pay button and two payment requests are sent. How would you prevent it on the frontend?
Disable the button while the request is pending, using an isSubmitting signal. In RxJS, model clicks as a stream and use exhaustMap, which ignores new clicks until the current payment request completes. Show a loading state and handle errors so the button re-enables. The backend must still use idempotency keys, because frontend protection alone cannot stop network retries or duplicate tabs.
35
What are directives in Angular and what types exist?
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.
36
How does Angular protect against cross-site scripting?
Angular treats all values as untrusted by default and sanitises them before inserting into the DOM: interpolation escapes HTML, and binding to innerHTML, styles or URLs is sanitised to strip dangerous content. Bypass methods in DomSanitizer, like bypassSecurityTrustHtml, should be used only for trusted content. Avoid direct DOM manipulation through ElementRef with user data, and add a Content Security Policy for defence in depth.
Which companies hire MEAN Stack professionals in Nagpur?
Companies with large offices in Nagpur include Persistent Systems. Use their company pages below to practise employer-specific sets.
Are MEAN Stack interviews in Nagpur different from other cities?
The questions depend more on the company than the city. Nagpur's mix of employers decides the style: Interviews are usually service-company style, with aptitude, technical and HR rounds
How do I find MEAN Stack jobs in Nagpur?
Shortlist companies with Nagpur offices, keep your CV focused on MEAN Stack projects, apply on company career pages and job portals with the Nagpur filter, and practise the questions on this page before each interview.