Fix wrong defaults in normalizeSettings

easy
By FrontendAtlas Editorial · Updated Oct 23, 2026
A teammate used || while hydrating UI settings, and the bug stayed invisible until real saved values showed up. Now 0, an intentionally blank subtitle, and false keep getting overwritten by defaults. Fix the helper so only truly missing values fall back.
Examples
normalizeSettings({ retryCount: 0, subtitle: '', emailOptIn: false }) // { retryCount: 0, subtitle: '', emailOptIn: false }

normalizeSettings({ retryCount: undefined, subtitle: null, emailOptIn: undefined }) // { retryCount: 3, subtitle: 'Untitled', emailOptIn: true }

Public interview reports

These public, self-reported interview accounts informed this practice version. The exercise is modelled on reported rounds, not copied from them, and the reports are not verified official questions or endorsements.

  • Taro: Capital One senior frontend engineer interview, 2024 · Taro, July 2024

    The case round asked to find a bug in a budgeting program written by an intern, in Java, C++, Node.js or Python, without coding the fix. This drill practises finding a defaults bug in a teammate's helper; it is not the reported code.

Reported in a public Capital One interview account. Capital One frontend interview questions