PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Bank of America

Convert number words to integer

Last updated: Mar 29, 2026

Quick Overview

This question evaluates textual number parsing, tokenization, and numeric mapping skills, testing string manipulation and lexical interpretation within the Coding & Algorithms domain for a Data Scientist role and emphasizing practical application rather than pure theoretical concepts.

  • Medium
  • Bank of America
  • Coding & Algorithms
  • Data Scientist

Convert number words to integer

Company: Bank of America

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

Given a line containing an English phrase representing a number in the range −999,999,999 to 999,999,999, convert it to its integer value. Supported words: negative, zero, one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety, hundred, thousand, million. Negative numbers are prefixed with "negative". The word "hundred" is not used when "thousand" could be (e.g., 1500 is "one thousand five hundred"). Print the decimal representation for each input line. Examples: "fifteen" → 15; "negative six hundred thirty eight" → -638.

Quick Answer: This question evaluates textual number parsing, tokenization, and numeric mapping skills, testing string manipulation and lexical interpretation within the Coding & Algorithms domain for a Data Scientist role and emphasizing practical application rather than pure theoretical concepts.

Related Interview Questions

  • Compute maximum beauty of a string - Bank of America (Medium)
  • Explain coding solution and alternatives - Bank of America (Medium)
Bank of America logo
Bank of America
Aug 11, 2025, 12:00 AM
Data Scientist
Take-home Project
Coding & Algorithms
3
0

Given a line containing an English phrase representing a number in the range −999,999,999 to 999,999,999, convert it to its integer value. Supported words: negative, zero, one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, thirty, forty, fifty, sixty, seventy, eighty, ninety, hundred, thousand, million. Negative numbers are prefixed with "negative". The word "hundred" is not used when "thousand" could be (e.g., 1500 is "one thousand five hundred"). Print the decimal representation for each input line. Examples: "fifteen" → 15; "negative six hundred thirty eight" → -638.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Bank of America•More Data Scientist•Bank of America Data Scientist•Bank of America Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.