Company Prep
React interview prep for company screening rounds. · 82 Q&A · click a card to expand
Name: Sawata Gore Location: Pune, Maharashtra Experience: ~3 years professional (Sep 2023 – Present) Designation: ReactJS Developer — Frontend Lead responsibilities (official payslip title: ReactJS Developer) Employers: Learnasyougo (Sep 2023 – Jul 2024) → DTSkill Services (Jul 2024 – Present) — same promoters, continuous career Leadership: Lead 6–8 frontend developers across concurrent projects; architecture, sprint planning, code reviews Recognition: Employee of the Month ×2 at DTSkill Stack: React 18/19, TypeScript, Redux Toolkit, TanStack Query, REST APIs, HTML/CSS, Git
Key Projects:
- Asset360Hub — Next.js 16 enterprise IT asset management; primary frontend owner; 16+ RBAC modules
- TimeLens — TechM workforce time-tracking; WebSockets; 6 role dashboards; primary contributor
- TRIEC — Mentoring intake portal (React SPA); OTP auth; multi-step forms; Vite migration
- GenE — In-house AI platform; SSE streaming; custom agent UI integration
Interview: Infosys ReactJS Developer · Pune · Sep 5, 2026 · Screening shortlisted Rounds: Technical (~60 min) → Managerial (~30–45 min) → HR (~20 min) Difficulty: Easy to medium — interviewers focus on how you think, clean code, and fundamentals
15 Must-Know Topics (study first):
- Build n×n React Grid Matrix with dynamic state
- Implement debounce from scratch
setState/useStatecalled 4 times — batching behavior- useEffect + dependency array pitfalls + cleanup
- Closures in JavaScript
- Event bubbling vs capturing vs delegation
- interface vs type in TypeScript
- Redux unidirectional data flow
- How to optimize a Redux / React app
- Controlled vs uncontrolled components
- Higher-Order Component — what and why
- Promise syntax + async/await error handling
- Semantic HTML + basic a11y
- devDependencies vs dependencies
- Scenario: last-minute UAT change from client
Self Introduction
1 item01Tell me about yourself.Must know
JavaScript Fundamentals & Live Coding
20 items02What are closures in JavaScript?Infosys
function createCounter() {
let count = 0;
return () => ++count;
}
const counter = createCounter();
console.log(counter()); // 1
console.log(counter()); // 203Implement debounce from scratch.Infosys
function debounce(fn, delay) {
let timerId;
return function (...args) {
clearTimeout(timerId);
timerId = setTimeout(() => fn.apply(this, args), delay);
};
}
const handleSearch = debounce((query) => fetchResults(query), 300);04Implement throttle from scratch.Infosys
limit milliseconds.function throttle(fn, limit) {
let inThrottle = false;
return function (...args) {
if (!inThrottle) {
fn.apply(this, args);
inThrottle = true;
setTimeout(() => (inThrottle = false), limit);
}
};
}05Event bubbling, capturing, and delegation.Infosys
event.target to handle child events — efficient for dynamic lists. Infosys often asks about all three phases and may follow up with double-click implementation.document.getElementById("list").addEventListener("click", (e) => {
if (e.target.matches("li")) console.log("Clicked:", e.target.textContent);
});dblclick or track click count with a 300ms reset timer.06Arrow functions vs normal functions.Infosys
this binding and hoisting behavior.this determined by the caller; arrow functions inherit this lexically from the enclosing scope. Arrow functions cannot be used as constructors, lack the arguments object, and are not hoisted like function declarations. In React class components this binding mattered; in functional components arrow functions in callbacks avoid binding issues but shouldn't be used as object methods when you need dynamic this.const obj = {
name: "Test",
regular: function () { return this.name; },
arrow: () => this?.name, // `this` is NOT obj
};07What are Promises? Write the syntax.Infosys
.then(), .catch(), and .finally(). Async/await is syntactic sugar on top of Promises with cleaner try/catch error handling. At Infosys you should be able to write both styles and explain error propagation. Always handle rejections to avoid unhandled promise errors in production.async function load() {
try {
const data = await fetchData();
console.log(data);
} catch (err) {
console.error(err);
}
}all fails fast on first rejection; allSettled waits for all and returns each status.08Explain call, apply, and bind.
this context of a function.call invokes immediately with comma-separated arguments. apply invokes immediately with an array of arguments. bind returns a new function with bound this without invoking it. These are foundational for understanding how JavaScript handles context and are occasionally tested in mid-level interviews. In modern React you encounter them less directly but they explain how callbacks and partial application work.function greet(greeting) { return `${greeting}, ${this.name}`; }
const user = { name: "Sawata" };
greet.call(user, "Hello"); // "Hello, Sawata"this.handleClick = this.handleClick.bind(this).09What is currying?
multiplyBy(2) returning a doubler. While not daily React work, it demonstrates functional programming understanding that Infosys interviewers appreciate in JS rounds.const add = (a) => (b) => (c) => a + b + c;
const multiplyBy = (n) => (x) => x * n;
const double = multiplyBy(2);10Explain the JavaScript event loop.Infosys
console.log("1");
setTimeout(() => console.log("2"), 0);
Promise.resolve().then(() => console.log("3"));
console.log("4");
// Output: 1, 4, 3, 211Difference between let, var, and const.
var is function-scoped, hoisted with undefined initialization, and can be redeclared. let is block-scoped, hoisted but in the Temporal Dead Zone until declared, and cannot be redeclared in the same scope. const is block-scoped, must be initialized, and cannot be reassigned — though object contents can still mutate. Modern code prefers const by default and let when reassignment is needed.12What is hoisting?
var are hoisted and can be referenced before their line (var as undefined). let and const are hoisted but not initialized — accessing them before declaration throws a ReferenceError. Understanding hoisting prevents bugs with function order and explains why var in loops caused classic closure issues.13What is the DOM tree?Infosys
14Remove elements from first array present in second array.Infosys
function removeFromSource(source, toRemove) {
const removeSet = new Set(toRemove);
return source.filter((item) => !removeSet.has(item));
}
removeFromSource([1, 2, 3, 4, 5], [2, 4]); // [1, 3, 5]15Shallow copy vs deep copy.
[...arr], {...obj}) duplicates top-level references — nested objects still share memory. Deep copy clones all levels independently. Use structuredClone() for plain data or JSON parse/stringify for simple JSON-safe objects. In React state updates, shallow copies at each level you mutate are usually sufficient and preferred for performance.16What are polyfills and why do they matter?Infosys
core-js add Array.prototype.includes, Promise, or fetch to older browsers. They let you write modern JavaScript while maintaining cross-browser compatibility. Build tools often inject polyfills based on browserslist config. Mention you check Can I Use and target supported browser matrix from the project.17== vs ===
=== compares value and type without coercion — always prefer it. == coerces types before comparing, leading to surprising results like "5" == 5 being true and null == undefined being true. Strict equality makes code predictable and is the standard in TypeScript and modern JavaScript codebases.18What are higher-order functions?
map, filter, and reduce are built-in higher-order functions. Custom examples include debounce, throttle, and currying. They enable functional composition and reusable abstractions. In React, HOCs follow the same pattern at the component level.const evens = [1, 2, 3, 4].filter((n) => n % 2 === 0);
const sum = [1, 2, 3].reduce((acc, n) => acc + n, 0);19Build an n×n React Grid Matrix with dynamic state.Infosys
size × size. Toggle cells with immutable updates using the functional setter pattern. Use CSS Grid with gridTemplateColumns: repeat(n, 40px) driven by state. Add aria-pressed for accessibility. This task tests state management, dynamic rendering, and clean React patterns.const [size, setSize] = useState(3);
const [cells, setCells] = useState<boolean[]>(() => Array(9).fill(false));
const toggle = (index: number) => {
setCells((prev) => {
const next = [...prev];
next[index] = !next[index];
return next;
});
};20Build a Counter with increment, decrement, and initial value.Infosys
(c) => c + 1 to avoid stale closure bugs. This is a warm-up coding task that leads into batching questions.const [count, setCount] = useState(0);
<button onClick={() => setCount((c) => c + 1)}>+</button>
<button onClick={() => setCount((c) => c - 1)}>-</button>21Write a custom useFetch hook.Infosys
{ data, loading, error }. Use AbortController in useEffect cleanup to cancel in-flight requests on unmount or URL change. Handle non-OK HTTP responses explicitly. This demonstrates hooks mastery beyond basic useState/useEffect.export function useFetch<T>(url: string) {
const [data, setData] = useState<T | null>(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
const controller = new AbortController();
fetch(url, { signal: controller.signal })
.then((res) => { if (!res.ok) throw new Error(`HTTP ${res.status}`); return res.json(); })
.then(setData)
.catch((err) => { if (err.name !== "AbortError") setError(err.message); })
.finally(() => setLoading(false));
return () => controller.abort();
}, [url]);
return { data, loading, error };
}React & TypeScript
23 items22interface vs type in TypeScript.Infosys
extends for inheritance. Types support unions, intersections, and primitive aliases. Both work for React props; interfaces are the common convention for component props, while types excel at union states like "idle" | "loading" | "error". At Infosys this is a must-know comparison — give examples of both.interface User { id: number; name: string; email?: string; }
type Status = "idle" | "loading" | "success" | "error";
type ApiResponse<T> = { data: T } | { error: string };23When to use any vs unknown?Infosys
any disables type checking; unknown requires narrowing before use.any in production — it defeats TypeScript's purpose and hides bugs. Use unknown for values from external sources (API responses, JSON.parse) and narrow with typeof, instanceof, or type guards before accessing properties. This is the type-safe alternative when you genuinely don't know the shape at compile time.function process(value: unknown) {
if (typeof value === "string") console.log(value.toUpperCase());
}value is Type that narrows the type in conditional blocks.24Explain generics with a React example.
T[] options and typed onChange callbacks. Without generics you'd use any and lose autocomplete and compile-time checks.interface SelectProps<T> {
options: T[];
value: T;
onChange: (value: T) => void;
getLabel: (item: T) => string;
}
function Select<T>({ options, value, onChange, getLabel }: SelectProps<T>) { /* ... */ }<T extends { id: number }> limits T to types with an id field.25Utility types: Pick, Omit, Partial.Infosys
Pick<User, "id" | "name"> selects specific fields. Omit<User, "password"> excludes fields — common for API responses. Partial<User> makes all fields optional — useful for update forms. These reduce duplication and keep types in sync with a single source interface.type PublicUser = Omit<User, "password">;
type UserUpdate = Partial<Omit<User, "id">>;
type UserPreview = Pick<User, "id" | "name">;Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onClick">.26How do you type React component props and events?
?. Use React.ReactNode for children. Type events with React.ChangeEvent<HTMLInputElement>, React.FormEvent<HTMLFormElement>, and React.MouseEvent<HTMLButtonElement>. TypeScript catches missing props and wrong event usage at compile time.type ButtonProps = {
label: string;
variant?: "primary" | "secondary";
onClick: () => void;
};
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => setValue(e.target.value);27What is React and its advantages?
28Props vs State.
29Explain useState and useEffect.Infosys
useState adds local state to functional components; the setter triggers re-renders. useEffect runs side effects after render — API calls, subscriptions, DOM updates — with an optional cleanup function and dependency array. Map useEffect to lifecycle: empty deps = mount, deps = update, cleanup = unmount. Missing deps cause stale closures; extra deps cause infinite loops.useEffect(() => {
document.title = `Count: ${count}`;
return () => { /* cleanup */ };
}, [count]);30setState(count+1) called 4 times — what happens?Infosys
setCount(count + 1) calls batch into one re-render. Each reads the same stale count, so the result is +1, not +4. Use the functional updater setCount(c => c + 1) four times to get +4. This is one of the top Infosys React questions — explain batching clearly.// Wrong — only +1
setCount(count + 1); setCount(count + 1); setCount(count + 1); setCount(count + 1);
// Correct — +4
setCount((c) => c + 1); setCount((c) => c + 1); setCount((c) => c + 1); setCount((c) => c + 1);31Controlled vs uncontrolled components.Must know
value={state} and onChange — React is the single source of truth. Uncontrolled components use refs to read DOM values directly. Prefer controlled for validation, dynamic UI, and form libraries. Uncontrolled suits simple forms or integrating non-React widgets. Infosys expects you to explain both with a quick example.// Controlled
<input value={name} onChange={(e) => setName(e.target.value)} />
// Uncontrolled
const ref = useRef<HTMLInputElement>(null);
<input ref={ref} defaultValue="hello" />32What are React keys and why do they matter?
33Explain useMemo and useCallback.
useMemo caches a computed result until dependencies change — use for expensive calculations. useCallback caches a function reference — use when passing callbacks to memoized children. Don't apply everywhere; premature optimization adds complexity. Profile first, then memoize bottlenecks.const sorted = useMemo(() => expensiveSort(items), [items]);
const handleClick = useCallback(() => doSomething(id), [id]);34What is React Router? How to handle 404?Infosys
BrowserRouter, Routes, and Route for path matching. The catch-all route path="*" renders a NotFound component for unmatched URLs. Protected routes wrap components with auth checks or use loader patterns in React Router v6.4+.<Routes>
<Route path="/" element={<Home />} />
<Route path="/about" element={<About />} />
<Route path="*" element={<NotFound />} />
</Routes># for static hosting without server config.35What are Higher-Order Components (HOC)?Infosys
withAuth(Dashboard) redirects unauthenticated users. Advantages include reusability and separation of concerns. Modern React prefers custom hooks over HOCs for similar patterns, but Infosys still asks about HOCs explicitly.function withAuth<P extends object>(Component: React.ComponentType<P>) {
return function Authenticated(props: P) {
const isLoggedIn = Boolean(localStorage.getItem("token"));
if (!isLoggedIn) return <p>Please log in</p>;
return <Component {...props} />;
};
}36React.lazy and Suspense.Infosys
React.lazy(() => import('./Dashboard')) creates a dynamically imported component. Wrap it in <Suspense fallback={<Spinner />}> to show loading UI while the chunk downloads. This reduces initial bundle size and improves Time to Interactive. Route-based splitting is the most common pattern.const Dashboard = React.lazy(() => import("./Dashboard"));
<Suspense fallback={<Spinner />}><Dashboard /></Suspense>37Error Boundaries.
getDerivedStateFromError and log via componentDidCatch. They do NOT catch event handler errors, async errors, or SSR errors. Place them around route segments or feature modules.38Presentation vs Container components.Infosys
39How to prevent unnecessary re-renders?
40Semantic HTML and basic accessibility.Infosys
<header>, <nav>, <main>, <article>, <section>, <footer> instead of div soup. Add alt text to images, keyboard navigation support, ARIA labels where semantic HTML isn't enough, and sufficient color contrast (WCAG AA). Test with Lighthouse accessibility audit and keyboard-only navigation.<br>, <img>, <input>, <meta>, <link>, <hr>.41Create a React datalist autocomplete.Infosys
list="id" pointing to a <datalist> containing <option> elements. The user can type freely or pick from suggestions. Simple, accessible, and a known Infosys coding/UI task.<input list="fruits" value={fruit} onChange={(e) => setFruit(e.target.value)} />
<datalist id="fruits">
{FRUITS.map((item) => <option key={item} value={item} />)}
</datalist>42HTTP methods — GET, POST, PUT, PATCH, DELETE.Infosys
43devDependencies vs dependencies.Infosys
dependencies are required at runtime in production — react, axios, redux. devDependencies are only needed for development and build — typescript, eslint, jest, webpack. Installing a build tool as a dependency bloats production bundles if not tree-shaken properly. CI installs both; production deploy may use npm ci --omit=dev.^1.2.3 allows minor/patch updates; ~1.2.3 allows patch only.44What is type inference in TypeScript?Infosys
"hello" becomes string. Function return types are inferred from return statements. Inference reduces boilerplate while maintaining safety. Explicit annotations are still needed for function parameters and complex public APIs.let name = "Sawata"; // string
const nums = [1, 2, 3]; // number[]
function add(a: number, b: number) { return a + b; } // return: numberRedux
8 items45Explain Redux data flow.Infosys
UI → dispatch(action) → reducer → new state → UI updates46What is Redux? When to use vs avoid?Infosys
47Redux Toolkit (RTK) advantages.
createSlice generates actions and reducers together. Immer allows mutable-looking syntax with immutable updates. createAsyncThunk handles async flows. Built-in DevTools integration and sensible defaults. Always recommend RTK over legacy hand-written Redux in interviews.const counterSlice = createSlice({
name: "counter",
initialState: { value: 0 },
reducers: { increment: (state) => { state.value += 1; } },
});state.value += 1 while producing immutable updates.48How to optimize a Redux application?Infosys
createSelector from reselect for memoized derived data. Select only needed slices in useSelector to avoid unnecessary re-renders. Wrap connected components in React.memo. Use RTK Query for server cache. Code-split reducers in large apps. These techniques prevent the common "everything re-renders on every dispatch" problem.49Redux middleware — thunk vs saga.
{ dispatch, getState } store methods, allowing chained dispatch and state reads.50useReducer vs useState.
(state, action) => newState. Use it when state has multiple sub-values, next state depends on previous, or logic is complex enough to extract a reducer function. useState is simpler for independent scalar values.51What is prop drilling and how to solve it?
<Layout sidebar={<Sidebar user={user} />}> instead of passing user through Layout.52Context API vs Redux — when to pick which?
Git Basics (Top 20)
20 items53What is Git and why use it?
54git clone vs git fork?
git clone downloads a repository to your machine with remote tracking configured. Forking (on GitHub/GitLab) creates a personal copy under your account, then you clone your fork to contribute via pull requests. In enterprise Infosys projects you typically clone the company remote directly.55Explain git status, add, commit, push workflow.
git status shows modified, staged, and untracked files. git add stages changes for the next commit. git commit -m "message" saves a snapshot locally. git push uploads commits to the remote. Always write meaningful commit messages describing why, not just what. Run status before and after each step to stay oriented.. stages everything; -p interactively stages hunks for granular commits.56What is git diff?
git diff shows unstaged changes. git diff --staged shows what's ready to commit. git diff main..feature compares branches. Use diff during code review and before committing to catch accidental changes. It's one of the most-used debugging tools in daily Git workflow.git diff path/to/file.tsx57git branch, checkout, and switch.
git branch feature/x creates a branch. git checkout feature/x or git switch feature/x moves to it. git switch -c feature/x creates and switches in one step. Branch per feature or bugfix keeps main stable. Delete merged branches to keep the repo clean.58git merge vs git rebase.Infosys
git add, then commit or continue rebase.59What is git stash?
git stash push -m "WIP feature" saves working directory changes. git stash pop restores them. Useful when you need to switch branches urgently but aren't ready to commit. Stash is local — not pushed to remote by default.apply keeps stash entry; pop applies and removes it.60git pull vs git fetch?
git fetch updates remote-tracking branches without touching your working tree — safe to inspect first. git pull is fetch + merge (or rebase with --rebase). Prefer fetch + review + merge for team workflows to avoid surprise conflicts.61What is git log and how to read it?
git log --oneline --graph --all gives a compact visual history. git log -p file.tsx shows commits affecting a file. git blame file.tsx shows who last modified each line. These help trace when bugs were introduced and understand feature evolution.62What is a pull request (PR)?
63What is .gitignore?
node_modules/, .env, dist/, IDE configs, and OS files. Prevents secrets and generated artifacts from entering version control. If something was committed before ignoring, use git rm --cached to untrack without deleting locally.git rm --cached filename.64git reset vs git revert?
git reset --soft HEAD~1 undoes last commit keeping changes staged. --hard discards changes entirely — dangerous on shared branches. git revert creates a new commit that negates a previous one — safe for public history. Use revert in production hotfix rollbacks on shared repos.65What is git cherry-pick?
git cherry-pick <commit-sha> copies that commit's changes to your current branch. Useful for hotfixing production without merging an entire feature branch. Resolve conflicts if the patch doesn't apply cleanly.66What is git tag?
git tag v1.2.0 creates a lightweight tag. Annotated tags include message and signer info. Tags mark release points for deployment. git push --tags publishes tags to remote. Infosys release pipelines often trigger on tag push.67Explain git remote and origin.
origin is the default remote name for the cloned repository. git remote -v lists fetch/push URLs. Add upstream with git remote add upstream <url> when working from a fork. Push to specific remote/branch with git push origin feature/x.68What is a merge conflict and how to resolve it?
<<<<<<<, =======, >>>>>>> in affected files. Manually choose the correct code, remove markers, stage resolved files, and complete merge/rebase. Communicate with the other developer if logic conflicts. Prevention: pull frequently and keep branches short-lived.69git bisect for finding bugs.
git bisect start, mark current as bad, mark known good commit, Git checks out middle commits for you to test. Repeat until the first bad commit is found. Invaluable for regressions where you know it worked two weeks ago but fails now.git bisect run npm test auto-skips based on test pass/fail.70Conventional commits and good commit messages.
feat:, fix:, refactor:, chore:, docs:. Write imperative mood: "Add login form" not "Added login form". First line under 72 chars; body explains why if needed. Good commits make code review and rollback easier for the whole Infosys team.! indicates breaking change in conventional commits spec.71Does Webpack bundle CSS and images?Infosys
css-loader + style-loader or MiniCssExtractPlugin for production. Images and fonts use asset modules or file-loader. Customize via module.rules in webpack config. Create React App and Vite abstract this, but Infosys may ask about the underlying bundler behavior.