← Walleye Capital Interview Insights

Walleye Capital·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Technical screen at Walleye Capital where they handed me a few React files with bugs baked in and asked me to work through them live. Not a whiteboard algorithm session, more of a "read this broken code and tell me what's wrong" kind of deal.

Questions Asked (8)

Q1

Given a React component where a useEffect or useCallback isn't behaving as expected, how do you identify and fix a stale closure caused by missing dependencies?

Root Cause AnalysisTechnical Trade-offs
Author's notes

This one tripped me up more than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining how stale closures occur when a function captures variables from an outdated render, then walk through a systematic debugging process using React DevTools and console logs to confirm the issue. Finally, describe the fix by adding missing dependencies or using refs/functional updates, while discussing trade-offs like performance and correctness.

Pro tip: Mention that you can use the 'exhaustive-deps' ESLint rule to catch missing dependencies early, but also understand when to intentionally omit dependencies and use refs to avoid unnecessary re-renders. This shows you balance correctness with performance.

1. Reproduce and Identify the Stale Closure

Create a minimal reproduction and use console logs or breakpoints to observe that the effect/callback is using outdated state or props. Check if the function closes over variables from a previous render.

2. Analyze Dependencies and Render Cycles

Examine the dependency array of useEffect/useCallback and compare with the variables used inside. Use React DevTools to track renders and see when the effect runs versus when dependencies change.

3. Apply the Fix: Add Missing Dependencies or Use Refs

Add the missing dependencies to the array to ensure the closure is recreated when values change. If adding dependencies causes unwanted re-renders, consider using useRef to hold the latest value or functional updates for state.

4. Verify and Test the Solution

Confirm the fix by testing the component's behavior, ensuring the effect/callback now uses current values. Write unit tests or use React Testing Library to prevent regression.

5. Discuss Trade-offs and Best Practices

Explain the trade-offs between adding dependencies (more frequent re-renders) and using refs (more complex code). Mention linting rules and team conventions for maintaining code quality.

Key Points to Mention

  • Definition of stale closure: a function capturing variables from an outdated render scope.
  • Common causes: missing dependencies in useEffect/useCallback dependency arrays.
  • Debugging tools: React DevTools, console logs, and the exhaustive-deps ESLint rule.
  • Solutions: adding missing dependencies, using useRef for mutable values, or functional state updates.
  • Trade-offs: performance impact of extra re-renders vs. correctness and potential bugs.
  • Prevention: consistent use of ESLint rules and code reviews to catch dependency issues early.

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

Q2

A React component is directly mutating state instead of producing a new value. What symptom would you see at runtime, and what's the minimal fix?

Root Cause AnalysisTechnical Trade-offs
Author's notes

Pretty straightforward once you see it.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the runtime symptom: the UI won't re-render because React compares state references and sees no change. Then describe the minimal fix: replace the direct mutation with a call to the state setter using a new object or array (e.g., spread operator). Emphasize that this is a common pitfall and that the fix is straightforward once you understand React's reconciliation.

Pro tip: Mention that in development, React may not warn about this, so it's crucial to rely on immutable update patterns and tools like Immer or Redux Toolkit to prevent such bugs. Also, note that mutating state can cause subtle bugs in concurrent mode.

1. Identify the symptom

Explain that the component will not re-render when state is mutated directly, because React uses shallow comparison to detect changes. The UI may show stale data or not update at all.

2. Explain why it happens

Describe that React's state updates are triggered by calling the setter function, which schedules a re-render. Direct mutation bypasses this mechanism, so React doesn't know the state changed.

3. Provide the minimal fix

Show how to replace the mutation with an immutable update: use the state setter and create a new object/array (e.g., setState(prev => ({...prev, key: newValue}))).

4. Discuss potential pitfalls

Mention that nested objects require deep cloning or libraries like Immer, and that mutating state can cause issues with memoization and shouldComponentUpdate.

5. Conclude with best practices

Recommend always treating state as immutable, using functional updates when depending on previous state, and leveraging tools like ESLint plugins to catch mutations.

Key Points to Mention

  • React uses shallow comparison (Object.is) to detect state changes.
  • Direct mutation does not trigger re-render because the reference remains the same.
  • The minimal fix is to use the state setter with a new object/array (e.g., spread operator).
  • For nested state, use deep cloning or immutability helpers like Immer.
  • Mutating state can lead to bugs in concurrent mode and with memoization.
  • Always use functional updates when new state depends on previous state.

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

Q3

A list component is rendering incorrectly or losing state between updates. How do you diagnose whether the key prop is the culprit, and what makes a good key?

Root Cause AnalysisTechnical Trade-offs
Author's notes

I've seen this bug before in real code so I went straight to the key prop.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining how to isolate the key prop as the root cause: temporarily replace keys with array indices or remove them entirely to see if the issue persists. Then describe what makes a good key—stable, unique, and predictable—and tie it back to reconciliation and state preservation.

Pro tip: Mention that using array indices as keys is a common anti-pattern that causes state misalignment when the list is reordered or filtered. Also, note that keys should be derived from the data's identity, not its position.

1. Reproduce and isolate

Create a minimal reproduction of the bug, then toggle the key prop (e.g., switch to index or remove keys) to see if the issue changes.

2. Inspect reconciliation behavior

Use React DevTools to observe component instances and state during updates; check if components are being unmounted/remounted unexpectedly.

3. Evaluate key stability

Assess whether current keys are stable across renders—if they change (e.g., random values) or are based on index, they likely cause state loss.

4. Choose a proper key

Select a key that uniquely identifies each item, such as a database ID or a composite of stable fields, ensuring it persists across updates.

5. Verify the fix

After changing keys, re-test the scenario to confirm that state is preserved and rendering is correct.

Key Points to Mention

  • React's reconciliation algorithm uses keys to match elements between renders.
  • Unstable keys (e.g., Math.random()) cause unnecessary remounts and state loss.
  • Index as key is problematic when list order changes (sorting, filtering, insertion).
  • Good keys are unique, stable, and predictable—ideally from the data's identity.
  • Keys should not be used to force re-renders; that's an anti-pattern.
  • Diagnosing involves comparing behavior with and without keys, and using DevTools.

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

Q4

A component is re-rendering far more than expected. How would you track down unstable object or function references being passed as props or through context as the root cause?

Root Cause AnalysisSystem Design
Author's notes

This was the one I felt least confident on.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by using React DevTools Profiler to confirm the excessive re-renders and identify which components are re-rendering. Then, trace the props and context values passed to those components, looking for new object/array/function references created on each render. Finally, apply memoization techniques (useMemo, useCallback, React.memo) and stabilize context values to fix the issue.

Pro tip: Use the 'Highlight updates when components render' option in React DevTools to visually spot unnecessary re-renders, and pair it with the Profiler's 'Ranked' chart to pinpoint the most expensive components. Also, consider using why-did-you-render library to automatically detect and log unnecessary re-renders caused by unstable references.

1. Reproduce and Profile

Reproduce the excessive re-rendering scenario and use React DevTools Profiler to record and analyze render behavior. Identify which components re-render frequently and whether they are function or class components.

2. Inspect Props and Context

For the identified components, inspect the props they receive and the context values they consume. Check if any prop or context value is a new object, array, or function on each render, which would break memoization.

3. Trace Reference Creation

Trace back to where those unstable references are created. Look for inline object/array literals, inline function definitions, or context provider values that are recreated on every render.

4. Apply Stabilization Techniques

Use useMemo and useCallback to memoize objects, arrays, and functions. For context, ensure the provider's value is memoized. Wrap components with React.memo if they are pure and should not re-render when props are unchanged.

5. Verify and Prevent Regression

Re-profile to confirm the re-renders are reduced. Add tests or lint rules (e.g., eslint-plugin-react-hooks) to catch future unstable references. Consider using why-did-you-render in development to catch regressions.

Key Points to Mention

  • React DevTools Profiler and 'Highlight updates' feature
  • Unstable references: inline objects, arrays, and functions
  • useMemo, useCallback, and React.memo for memoization
  • Context value stability and memoizing provider values
  • why-did-you-render library for detecting unnecessary re-renders
  • Performance optimization trade-offs and avoiding premature optimization

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

Q5

A useEffect fires an async request but the component sometimes shows stale or out-of-order data. How do you identify and fix an async race condition in an effect?

Root Cause AnalysisAPI & Integrations
Author's notes

Cleanup function with a cancelled flag, or AbortController.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining how to reproduce and identify the race condition using logging or React DevTools, then describe the standard fix using an ignore flag or AbortController in the cleanup function. Emphasize that the core issue is out-of-order responses and that cleanup ensures only the latest effect's result is applied.

Pro tip: Mention that AbortController not only prevents state updates but also cancels the network request, saving bandwidth and server resources—a detail that shows you think about efficiency and not just correctness.

1. Reproduce and Identify

Create a scenario where multiple requests are fired in quick succession (e.g., rapid prop changes) and observe stale or out-of-order data. Use console logs or React DevTools to confirm that an older response resolves after a newer one.

2. Understand the Root Cause

Explain that useEffect runs after every render, and without cleanup, all responses update state regardless of order. The race occurs because network responses can arrive out of order, and the last response to resolve wins.

3. Implement Cleanup with Ignore Flag

Use a local variable (e.g., let isActive = true) in the effect and return a cleanup function that sets it to false. In the async callback, check isActive before updating state to ignore stale responses.

4. Use AbortController for Cancellation

For fetch requests, create an AbortController, pass its signal to fetch, and call abort() in the cleanup. This cancels the request entirely, preventing both state updates and unnecessary network work.

5. Test and Verify

Simulate rapid changes and confirm that only the latest request's data is displayed. Check that no warnings about setting state on unmounted components appear, and that the UI remains consistent.

Key Points to Mention

  • useEffect cleanup function runs before the next effect and on unmount, providing a place to cancel or ignore stale requests.
  • The ignore flag pattern (e.g., isActive) is a simple, library-agnostic solution for preventing state updates from outdated responses.
  • AbortController is the modern, standard way to cancel fetch requests and avoid both state updates and wasted network calls.
  • Out-of-order responses are the core problem; the fix ensures only the latest request's result is applied.
  • Race conditions can also be mitigated by using a ref to track the latest request ID or by leveraging libraries like React Query that handle caching and cancellation.
  • Always clean up side effects to avoid memory leaks and unexpected behavior, especially in components that mount/unmount frequently.

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

Q6

A text input is behaving inconsistently, sometimes controlled and sometimes not. How do you diagnose the controlled vs uncontrolled mismatch and fix it?

Root Cause AnalysisTechnical Trade-offs
Author's notes

Switching between undefined and a real value for the value prop is the classic trigger.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining that controlled vs uncontrolled mismatches typically stem from inconsistent state management or conditional rendering. Then outline a systematic debugging process: reproduce, inspect, trace, and fix. Emphasize the importance of consistent value handling and the role of React warnings.

Pro tip: Mention that React's dev warnings often pinpoint the exact component and line, so always check the console first. Also, consider using a controlled component pattern consistently across the app to avoid such issues.

1. Reproduce and Observe

Identify the exact steps to reproduce the inconsistency and note any console warnings or errors. Observe the component's behavior under different conditions.

2. Inspect State and Props

Check the component's state and props to see if the value is sometimes undefined or null, which can cause uncontrolled behavior. Verify that the value prop is always provided and consistent.

3. Trace Data Flow

Trace how the value is passed down and updated. Look for conditional rendering or asynchronous updates that might cause the value to be undefined initially.

4. Fix and Validate

Ensure the value prop is always defined (e.g., default to empty string) and that onChange handler is always provided. Validate the fix by testing all scenarios.

Key Points to Mention

  • React's controlled vs uncontrolled component warning and its causes
  • The importance of consistent value prop (never undefined) and onChange handler
  • Using default values (e.g., empty string) to avoid uncontrolled state
  • Debugging tools: React DevTools, console warnings, and breakpoints
  • Conditional rendering pitfalls that lead to undefined value
  • Best practices: always control the component or use uncontrolled with defaultValue

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

Q7

A conditional rendering block using the && operator is rendering a 0 on screen instead of nothing. Why does this happen and how do you fix it?

Root Cause AnalysisTechnical Trade-offs
Author's notes

I actually laughed when I saw this one in the code.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Explain that JavaScript's && operator returns the left operand if it's falsy, and since 0 is falsy, it gets rendered by React. Then describe the fix: use a ternary or explicit boolean check to ensure only true renders the element, and false/null/undefined render nothing.

Pro tip: Mention that this is a common pitfall and that using a ternary or converting the condition to a boolean (e.g., !!count) makes the intent clear and avoids rendering unexpected values like 0 or NaN.

1. Identify the root cause

Explain that in JavaScript, the && operator returns the first falsy operand, and 0 is falsy, so it gets rendered.

2. Show the problematic code

Provide a simple example like {count && <Component />} where count is 0, resulting in 0 being rendered.

3. Propose solutions

Suggest using a ternary operator (count ? <Component /> : null) or explicitly checking for truthiness (count > 0 && <Component />).

4. Discuss trade-offs

Compare readability and conciseness of each solution, and mention that ternaries are often preferred for clarity.

5. Prevent future issues

Recommend using TypeScript or PropTypes to enforce boolean conditions, or using a helper function to render conditionally.

Key Points to Mention

  • JavaScript's && operator returns the first falsy operand, not necessarily a boolean.
  • React renders falsy values like 0, NaN, and empty string, but not null, undefined, or false.
  • Using a ternary operator avoids the issue by explicitly returning null for falsy conditions.
  • Explicit boolean conversion (e.g., !!count) ensures the condition is a boolean.
  • TypeScript can catch this by enforcing boolean types for conditional rendering.
  • This is a common pitfall in React and can be avoided with linting rules or code reviews.

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

Q8

An event handler isn't firing correctly or a value is wrong when it does fire. How do you debug whether the issue is in how the handler is bound or how props are being passed down?

Root Cause AnalysisSystem Design
Author's notes

They showed me a component where the handler was being recreated on every render and passed down, causing child re-renders, but also a separate issue where the wrong prop was being forwarded.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by isolating whether the problem is in the binding or the props by adding targeted logging and using React DevTools to inspect the component hierarchy and props. Then systematically test each hypothesis: first verify the handler is bound correctly and receives the expected event, then trace the props down the tree to ensure they are passed and updated correctly. Finally, use breakpoints or a debugger to step through the code and confirm the flow.

Pro tip: Demonstrate a methodical approach by first reproducing the issue in a minimal example, which often reveals whether it's a binding or prop-drilling problem. Also, mention that you check the React DevTools 'Highlight Updates' feature to see which components re-render and with what props.

1. Reproduce and Isolate

Create a minimal reproduction of the issue, removing unrelated code to narrow down the cause. Confirm the exact conditions under which the handler fails or the value is wrong.

2. Inspect Binding

Check if the handler is correctly bound (e.g., using arrow functions or .bind in the constructor) and if it's attached to the right event. Add a console log at the start of the handler to see if it fires and what arguments it receives.

3. Trace Props

Use React DevTools to inspect the props being passed to the component and verify they contain the expected values. Trace the props back up the component tree to ensure they are not mutated or stale.

4. Test Hypotheses

Temporarily replace the handler with a simple function that logs the event, and pass hardcoded props to see if the issue persists. This helps determine whether the problem is in binding or props.

5. Debug with Breakpoints

Set breakpoints in the handler and in the parent component where props are defined to step through the code and observe the actual values and call stack.

Key Points to Mention

  • Use of React DevTools to inspect component props and state
  • Binding methods: arrow functions vs .bind in constructor vs class properties
  • Prop drilling and potential stale props due to closures or memoization
  • Event pooling in React (if applicable) and asynchronous event handling
  • Importance of minimal reproduction and systematic elimination
  • Debugging tools: console.log, debugger, breakpoints, and React DevTools

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