FastPrepPrice Check
Problems/Price Check

Price Check

Blue Origin logoBlue Origin● EasyINTERNPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Blue Origin intern phone screen. The task was to count the sales whose typed-in price does not match the product's listed price.

The report says it was the same question we already have from another company, but gives no wording, examples or limits, so we based ours on that version: the task, the first example and most of the limits come from it, and examples 2 and 3 are new. That version's limits say there are never more sales than products, but its own example has more sales than products. Here, there can be up to 10^5 sales, product names do not repeat, and every sold item is on the product list.

Our version is about 95% the same as the reported question.

Special thanks: 🌷 A special thank you to a lovely, amazing fren for sharing that this question appeared in an interview on November 23, 2026! ( ˶ˆᗜˆ˵ ) 💜

Given a shop's price list and its sales record, return the number of sales whose recorded price is wrong.

The shop uses old-style cash registers. Instead of scanning items and pulling the price from a database, the cashier types in the price of each item by hand, which sometimes leads to errors.

  • products[i] is the name of an item for sale, and productPrices[i] is its correct price.
  • productSold[j] is the name of the item in sale j, and soldPrice[j] is the price typed in for that sale.

A sale is an error when soldPrice[j] is not equal to the correct price of productSold[j].

Function

priceCheck(products: String[], productPrices: float[], productSold: String[], soldPrice: float[]) → int

Examples

Example 1

products = ["eggs", "milk", "cheese"]productPrices = [2.89, 3.29, 5.79]productSold = ["eggs", "eggs", "cheese", "milk"]soldPrice = [2.89, 2.99, 5.97, 3.29]return = 2
ProductTyped priceCorrect priceError
eggs2.892.89No
eggs2.992.89Yes
cheese5.975.79Yes
milk3.293.29No

The second sale of eggs has a wrong price, as does the sale of cheese. There are 2 errors in pricing.

Example 2

products = ["apple", "bread", "juice"]productPrices = [1.25, 3.50, 4.00]productSold = ["bread", "bread", "apple"]soldPrice = [3.50, 3.50, 1.25]return = 0

Both bread sales were typed in as 3.50 and the apple sale as 1.25. Each matches the correct price, so there are 0 errors.

Example 3

products = ["tea", "rice"]productPrices = [100000.00, 1.00]productSold = ["rice", "tea"]soldPrice = [1.01, 99999.99]return = 2

Rice was typed in as 1.01 instead of 1.00, and tea as 99999.99 instead of 100000.00. A difference of one cent still counts, so there are 2 errors.

Constraints

  • 1 <= n <= 10^5, where n is the length of products and productPrices
  • 1 <= m <= 10^5, where m is the length of productSold and soldPrice
  • 1.00 <= productPrices[i], soldPrice[j] <= 100000.00
  • Every price has at most two digits after the decimal point.
  • All names in products are different.
  • Every name in productSold appears in products.

Similar questions at other companies

  • Majority ElementByteDance · PHONE SCREENByteDance interview questions
  • Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
  • Recommend Films from Viewers Who Watched Everything You DidBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • Find Unique ElementsCisco · PHONE SCREENCisco interview questions
  • Shared Courses for Every Pair of StudentsCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Two SumAmazon · OA · PHONE SCREEN
  • Employee Count Median, Mean and ModeClay · PHONE SCREEN
  • Two SumBNSF Railway · PHONE SCREENBNSF Railway interview questions
  • Single-Condition Product FilterCrowdstrike · PHONE SCREENCrowdstrike interview questions
  • Cross-Day User Trust ScoresAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
See Blue Origin hiring insights
Saved
class Solution {
    public int priceCheck(String[] products, float[] productPrices, String[] productSold, float[] soldPrice) {
        // Write your code here.
    }
}
Checking account…