← Boeing Interview Insights

Boeing·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

React hooks deep dive for a Full-stack Engineer role at Boeing. The whole session was discussion and short-answer style, no live coding, just them probing how well you actually understand what's happening under the hood with hooks.

Questions Asked (8)

Q1

How does useState work, and what happens to state across re-renders?

Technical Trade-offs
Author's notes

Felt fine on this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Explain that useState is a React Hook that lets you add state to functional components, and that state persists across re-renders because React stores it internally. Describe how React tracks state by the order of Hook calls and how updates trigger re-renders with the new state value.

Pro tip: Mention that state updates are asynchronous and batched, and that using the functional update form (e.g., setCount(prev => prev + 1)) ensures you work with the latest state, which is crucial in scenarios with rapid updates.

1. Define useState

Explain that useState is a Hook that returns a stateful value and a function to update it, enabling functional components to have local state.

2. State persistence across re-renders

Describe how React preserves state between re-renders by storing it in the component's fiber node, and that the state value is not reset unless the component unmounts or the Hook order changes.

3. How updates trigger re-renders

Explain that calling the setter function schedules a re-render, and React will re-render the component with the new state value, updating the UI accordingly.

4. Batching and asynchronous updates

Discuss that state updates may be batched for performance, and that the new state is not immediately available after calling the setter, so use the functional update form when relying on previous state.

5. Rules of Hooks and order

Emphasize that Hooks must be called in the same order on every render, as React relies on call order to associate state with the correct Hook.

Key Points to Mention

  • useState returns an array with the current state and a setter function.
  • State is preserved across re-renders as long as the component remains mounted.
  • React tracks state by the order of Hook calls, so Hooks must not be called conditionally.
  • Calling the setter function triggers a re-render with the updated state.
  • State updates are asynchronous and batched for performance.
  • Use the functional update form when the new state depends on the previous state.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Walk me through useEffect, including the dependency array and cleanup function. What are common mistakes people make?

Technical Trade-offsRoot Cause Analysis
Author's notes

This is where things got interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the purpose of useEffect (side effects in function components) and its basic syntax. Then, detail how the dependency array controls when the effect runs, and how the cleanup function prevents memory leaks. Finally, discuss common mistakes and how to avoid them, emphasizing best practices.

Pro tip: Emphasize that useEffect is not a lifecycle method replacement but a synchronization mechanism, and highlight the importance of correctly specifying dependencies to avoid stale closures and unnecessary re-renders.

1. Explain the Purpose of useEffect

Describe useEffect as a hook for performing side effects in function components, such as data fetching, subscriptions, or manual DOM manipulations. Mention that it runs after render.

2. Detail the Dependency Array

Explain that the dependency array determines when the effect re-runs: empty array means run once on mount, no array means run after every render, and with dependencies means run when any dependency changes.

3. Describe the Cleanup Function

Explain that the cleanup function is returned from the effect and runs before the component unmounts or before the next effect execution. It's used to cancel subscriptions, clear timers, etc.

4. Discuss Common Mistakes

List common pitfalls: missing dependencies causing stale data, over-specifying dependencies causing infinite loops, not cleaning up leading to memory leaks, and misunderstanding when effects run.

5. Provide Best Practices

Suggest using the exhaustive-deps ESLint rule, separating concerns into multiple effects, and using useCallback/useMemo for stable dependencies when needed.

Key Points to Mention

  • useEffect runs asynchronously after render, not blocking the browser.
  • The dependency array should include all values from the component scope that are used inside the effect.
  • Cleanup functions prevent memory leaks and are essential for subscriptions and timers.
  • Common mistakes: missing dependencies, infinite loops from incorrect dependencies, and not cleaning up.
  • Using multiple useEffect hooks to separate unrelated logic improves readability and maintainability.
  • The exhaustive-deps ESLint rule helps catch missing dependencies but may require refactoring to avoid unnecessary re-runs.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

When does useMemo or useCallback actually improve performance, and when does it make things worse?

Technical Trade-offs
Author's notes

Probably my weakest answer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining what useMemo and useCallback do—memoizing values and functions respectively—and clarify that they are performance optimizations, not semantic guarantees. Then explain the conditions under which they help (expensive computations, referential stability for memoized children) and when they hurt (trivial computations, added memory and comparison overhead). Conclude with a practical rule: measure first, optimize only when profiling shows a bottleneck.

Pro tip: Emphasize that premature memoization often adds complexity without measurable benefit, and that React's own docs recommend using them sparingly. Mention that in real-world apps, the cost of memoization can outweigh the savings for cheap computations, so always profile with React DevTools before adding them.

1. Define the hooks

Briefly explain that useMemo caches the result of a computation and useCallback caches a function instance, both to avoid unnecessary recalculations or re-renders.

2. When they improve performance

Describe scenarios: expensive calculations that run on every render, and passing stable references to memoized child components (React.memo) or as dependencies to other hooks.

3. When they make things worse

Explain that for cheap computations, the overhead of dependency comparison and memory allocation can be greater than just recomputing; also, overuse can lead to stale closures and bugs if dependencies are mismanaged.

4. Trade-offs and measurement

Highlight that memoization is a trade-off between CPU time and memory, and that you should profile first (e.g., with React DevTools Profiler) to confirm a bottleneck before optimizing.

5. Best practices

Conclude with guidelines: use them only when necessary, keep dependency arrays correct, and consider alternatives like moving state down or using useReducer for complex state.

Key Points to Mention

  • useMemo and useCallback are performance optimizations, not semantic guarantees—React may still re-run the computation.
  • They help when computations are expensive (e.g., large array sorting, complex calculations) or when referential equality is needed for memoized children.
  • They hurt when computations are cheap, because the overhead of dependency comparison and caching outweighs the savings.
  • Overuse can lead to memory bloat and stale closures if dependencies are not managed correctly.
  • Always profile first (React DevTools Profiler) to identify actual performance bottlenecks before adding memoization.
  • React.memo, useMemo, and useCallback work together; using them incorrectly can break memoization benefits.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

What is useRef used for beyond just DOM references?

Technical Trade-offs
Author's notes

Short answer, went fine.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the common use of useRef for DOM access, then pivot to its broader purpose as a mutable container that persists across renders without causing re-renders. Use concrete examples like storing timer IDs, previous values, or instance variables to illustrate its versatility, and tie it back to performance and trade-offs.

Pro tip: Emphasize that useRef is not just for DOM but for any value that needs to persist without triggering re-renders, and mention that overusing it can lead to stale or unmanaged state, so it's important to know when to use useState instead.

1. Acknowledge common use

Briefly mention that useRef is commonly used for DOM references, but that's just one application.

2. Explain core purpose

Describe useRef as a way to store mutable values that persist across renders without causing re-renders.

3. Provide examples

Give concrete examples such as storing timer IDs, previous state/props, or any instance-like variable.

4. Discuss trade-offs

Highlight that useRef doesn't trigger re-renders, which is both an advantage and a potential pitfall if used for state that should update the UI.

5. Relate to performance

Explain how avoiding unnecessary re-renders can improve performance, especially in complex components.

Key Points to Mention

  • useRef returns a mutable object with a .current property that persists for the full lifetime of the component.
  • It does not cause re-renders when .current changes, unlike useState.
  • Common non-DOM uses: storing timer IDs, previous values, or any mutable instance variable.
  • It can be used to access the latest value in callbacks without re-subscribing (e.g., in useEffect).
  • Trade-off: using useRef for state that should trigger UI updates can lead to bugs; useState is better for that.
  • Performance benefit: avoids unnecessary re-renders when you need to track a value but don't need to display it.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q5

How does useContext work and what are its limitations for state management?

Technical Trade-offsSystem Design
Author's notes

I mentioned the re-render problem where any context consumer re-renders when the value changes, even if the part they care about didn't.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining how useContext enables sharing state across components without prop drilling, then discuss its limitations such as performance issues and lack of built-in state management features. Finally, relate this to system design trade-offs, especially in large-scale applications like those at Boeing.

Pro tip: Emphasize that useContext is not a state management solution by itself but a dependency injection mechanism; combining it with useReducer or external libraries like Redux is often necessary for complex state. This shows you understand the nuances and can make informed architectural decisions.

1. Explain useContext

Describe how useContext allows components to consume values from a React context without prop drilling, and how it works with a Provider to supply the value.

2. Discuss Benefits

Highlight advantages such as simplified component hierarchy, avoidance of prop drilling, and ease of sharing global data like themes or user authentication.

3. Identify Limitations

Cover limitations: performance issues due to re-renders on context changes, lack of built-in state management features (e.g., middleware, dev tools), and difficulty in scaling for complex state.

4. Compare with Alternatives

Mention alternatives like Redux, Zustand, or Recoil that offer more robust state management, and discuss when to use useContext versus these solutions.

5. Relate to System Design

Connect the discussion to system design trade-offs, especially in large-scale applications, emphasizing the need to balance simplicity with scalability and maintainability.

Key Points to Mention

  • How useContext avoids prop drilling by providing a way to pass data through the component tree.
  • Performance implications: any change in context value triggers re-render of all consuming components.
  • Lack of built-in mechanisms for complex state logic, side effects, or middleware.
  • When to use useContext: for low-frequency updates or simple global state like theme or locale.
  • Alternatives like Redux, MobX, or Zustand for complex state management with dev tools and middleware.
  • The importance of memoization and splitting contexts to mitigate performance issues.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q6

How do you build a custom hook, and what makes something worth extracting into one?

Technical Trade-offsAPI & Integrations
Author's notes

Easy to talk about in theory but they asked me to give a real example from something I'd built.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining what a custom hook is and its purpose in React: to extract reusable stateful logic. Then, walk through the process of building one, emphasizing the rules of hooks and how to identify duplication or complexity that warrants extraction. Finally, discuss trade-offs and when extraction might be overkill.

Pro tip: Emphasize that custom hooks are about reusing logic, not state. Also, mention that at a company like Boeing, where code maintainability and testing are critical, extracting hooks can improve testability and separation of concerns, but be cautious about premature abstraction.

1. Define Custom Hooks

Explain that a custom hook is a JavaScript function whose name starts with 'use' and that can call other hooks. It allows you to extract component logic into reusable functions.

2. Building a Custom Hook

Describe the process: identify repeated logic across components, create a function with 'use' prefix, move the logic inside, and return the necessary values. Ensure it follows the rules of hooks.

3. Criteria for Extraction

Discuss when to extract: when logic is duplicated, complex, or mixes concerns. Consider if the hook can be tested independently and if it improves readability and maintainability.

4. Trade-offs and Considerations

Mention potential downsides: over-abstraction, increased indirection, and difficulty in debugging. Emphasize the need to balance reuse with simplicity.

Key Points to Mention

  • Rules of hooks: only call hooks at the top level and from React functions.
  • Naming convention: always prefix with 'use' to signal it's a hook.
  • Reusability: custom hooks allow sharing logic without changing component hierarchy.
  • Testing: extracted hooks can be tested in isolation, improving test coverage.
  • Performance: custom hooks can encapsulate performance optimizations like memoization.
  • Trade-offs: avoid premature abstraction; only extract when there's clear benefit.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q7

What are the rules of hooks and why do they exist?

Technical Trade-offs
Author's notes

Answered this one cleanly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly stating the two core rules of hooks: only call hooks at the top level and only call them from React function components or custom hooks. Then explain the underlying reasons: hooks rely on a consistent call order to manage state and side effects, and they need to be associated with a component instance. Finally, connect this to the trade-offs in React's design, such as enabling reusable logic without classes while imposing constraints for predictability.

Pro tip: Mention that the rules are enforced by the ESLint plugin `eslint-plugin-react-hooks` and that violating them often leads to subtle bugs like state mismatches. This shows you understand the practical implications and tooling, not just the theory.

1. State the rules

Clearly list the two rules: call hooks only at the top level (not inside loops, conditions, or nested functions) and call them only from React function components or custom hooks.

2. Explain the rationale

Describe how React relies on the order of hook calls to associate state and effects with the correct component instance. Changing the order would break this association.

3. Discuss the trade-offs

Highlight that these rules enable simpler, more reusable logic compared to class components, but require developers to follow strict conventions to avoid bugs.

4. Mention enforcement and consequences

Note that the rules are enforced by linting tools and that violating them can cause unpredictable behavior, such as state being assigned to the wrong hook.

Key Points to Mention

  • Only call hooks at the top level (not inside loops, conditions, or nested functions).
  • Only call hooks from React function components or custom hooks.
  • React relies on the order of hook calls to manage state and effects.
  • The rules ensure predictable behavior and prevent bugs like state mismatches.
  • The rules are enforced by the eslint-plugin-react-hooks lint rule.
  • These rules enable reusable stateful logic without the complexity of class components.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q8

Given a component that's re-rendering more than expected, how would you debug it?

Root Cause AnalysisTechnical Trade-offs
Author's notes

They framed this as a concrete scenario which I liked.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the problem and outlining a systematic debugging process: first confirm the re-rendering issue using profiling tools, then identify the cause (e.g., state changes, parent re-renders, context updates), and finally apply targeted optimizations. Emphasize measuring before and after to validate fixes and discuss trade-offs of each solution.

Pro tip: Use React DevTools Profiler to record interactions and pinpoint exactly which components re-render and why; this data-driven approach prevents premature optimization and shows you value evidence over guesswork.

1. Reproduce and Measure

Use React DevTools Profiler or similar tools to record the component's render behavior and confirm excessive re-renders. Quantify the frequency and identify which props/state changes trigger them.

2. Identify the Cause

Determine why re-renders occur: parent re-renders, context changes, state updates, or prop changes. Check if props are being recreated unnecessarily (e.g., new object/array literals).

3. Apply Targeted Fixes

Implement optimizations such as React.memo, useMemo, useCallback, or moving state down. For context, consider splitting contexts or using selectors.

4. Validate and Measure Again

Re-run the profiler to ensure the fix reduces re-renders without breaking functionality. Compare before/after metrics to confirm improvement.

5. Discuss Trade-offs

Explain the trade-offs of each optimization (e.g., memoization adds complexity and memory overhead) and when it's appropriate to apply them.

Key Points to Mention

  • React DevTools Profiler for identifying re-renders
  • Common causes: parent re-renders, context updates, state changes, inline object/function props
  • Optimization techniques: React.memo, useMemo, useCallback, shouldComponentUpdate
  • Context optimization: splitting contexts, using useMemo for context value
  • Trade-offs: memoization overhead, code complexity, potential for stale closures
  • Importance of measuring before and after to avoid premature optimization

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.