PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Intuit

Format VARCHAR amounts into $ with M/B suffix

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to perform SQL data manipulation tasks such as string-to-number conversion, conditional scaling and suffixing, numeric rounding, and formatting for presentation.

  • medium
  • Intuit
  • Software Engineering Fundamentals
  • Software Engineer

Format VARCHAR amounts into $ with M/B suffix

Company: Intuit

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Take-home Project

You are given a table `transactions` with: - `id` (primary key) - `amount_str` (VARCHAR): a numeric string representing an amount in dollars (e.g., `'950'`, `'2500000'`, `'9876543210'`). **Task (SQL):** Write a query that outputs `id` and a formatted amount string: - If amount `< 1,000,000`: output like `$950` (no suffix). - If `1,000,000 <= amount < 1,000,000,000`: output as dollars in millions with suffix `M`, rounded to **1 decimal** (e.g., `2500000 -> $2.5M`). - If `>= 1,000,000,000`: output as dollars in billions with suffix `B`, rounded to **1 decimal** (e.g., `9876543210 -> $9.9B`). Assume `amount_str` may contain leading/trailing spaces; you should convert it to a numeric type before comparing/dividing.

Quick Answer: This question evaluates a candidate's ability to perform SQL data manipulation tasks such as string-to-number conversion, conditional scaling and suffixing, numeric rounding, and formatting for presentation.

Related Interview Questions

  • Find largest file in a directory using Bash - Intuit (medium)
  • Aggregate transactions by status and failure reasons (SQL) - Intuit (medium)
|Home/Software Engineering Fundamentals/Intuit

Format VARCHAR amounts into $ with M/B suffix

Intuit logo
Intuit
Feb 11, 2026, 12:00 AM
mediumSoftware EngineerTake-home ProjectSoftware Engineering Fundamentals
6
0
Loading...

You are given a table transactions with:

  • id (primary key)
  • amount_str (VARCHAR): a numeric string representing an amount in dollars (e.g., '950' , '2500000' , '9876543210' ).

Task (SQL): Write a query that outputs id and a formatted amount string:

  • If amount < 1,000,000 : output like $950 (no suffix).
  • If 1,000,000 <= amount < 1,000,000,000 : output as dollars in millions with suffix M , rounded to 1 decimal (e.g., 2500000 -> $2.5M ).
  • If >= 1,000,000,000 : output as dollars in billions with suffix B , rounded to 1 decimal (e.g., 9876543210 -> $9.9B ).

Assume amount_str may contain leading/trailing spaces; you should convert it to a numeric type before comparing/dividing.

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Intuit•More Software Engineer•Intuit Software Engineer•Intuit Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,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
  • AI Coding 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.