Problem · String

Business Account KYC Verification — Parts 1–3

Learn this problem
MediumStripe logoStripeINTERNFULLTIMEPHONE SCREEN
See Stripe hiring insights

Problem statement

Validate each business account using the first three KYC checks reported by the interview author.

Input

csvData contains a header followed by business rows. Each row has these six comma-separated fields in order:

  1. business_name
  2. business_profile_name
  3. full_statement_descriptor
  4. short_statement_descriptor
  5. url
  6. product_description

Trim surrounding whitespace from every field.

Verification rules

  1. All six fields must be present and non-empty.
  2. full_statement_descriptor must contain between 5 and 31 characters inclusive after trimming.
  3. The full descriptor must not equal any of these generic descriptors, compared case-insensitively: ONLINE STORE, ECOMMERCE, RETAIL, SHOP, GENERAL MERCHANDISE.

Return one result per business in input order: "VERIFIED: <business_name>" when every rule passes, otherwise "NOT VERIFIED: <business_name>".

Function

validateBusinesses(csvData: String) → String[]

Examples

Example 1

csvData = "business_name,business_profile_name,full_statement_descriptor,short_statement_descriptor,url,product_description\nPawsome Pets Inc.,Pawsome Pets,PAWSOME PETS,Pawsome,pawsome.example,Pet supplies\nBean Bliss Coffee Company,Bean Bliss,,Bean,bean.example,Coffee beans\nGlobal Goods Marketplace Inc.,Global Goods,RETAIL,Global,goods.example,General products"return = ["VERIFIED: Pawsome Pets Inc.", "NOT VERIFIED: Bean Bliss Coffee Company", "NOT VERIFIED: Global Goods Marketplace Inc."]
Pawsome passes all three parts. Bean Bliss has an empty full descriptor. Global Goods uses the exact blocked descriptor RETAIL.

Example 2

csvData = "business_name,business_profile_name,full_statement_descriptor,short_statement_descriptor,url,product_description\nInformation Technology Consulting Solutions Inc.,ITCS,ITCS,ITCS,itcs.example,Consulting\nOm Yoga and Wellness Center,Om Yoga,OM YOGA AND WELLNESS,Om Yoga,omyoga.example,Yoga classes"return = ["NOT VERIFIED: Information Technology Consulting Solutions Inc.", "VERIFIED: Om Yoga and Wellness Center"]
ITCS is only four characters, below the inclusive minimum of five. Om Yoga supplies every field, has a valid descriptor length, and does not use a blocked descriptor.

Constraints

  • The first line is a header and is not validated.
  • Each data row is a simple six-field CSV row with no embedded commas.
  • All fields are trimmed; an empty trimmed value fails verification.
  • The full descriptor length is inclusive in [5, 31].
  • Blocked descriptors use case-insensitive exact equality, not substring matching.
  • Return results in input order.

More Stripe problems

drafts saved locally
public String[] validateBusinesses(String csvData) {
  // write your code here
}
csvData"business_name,business_profile_name,full_statement_descriptor,short_statement_descriptor,url,product_description\nPawsome Pets Inc.,Pawsome Pets,PAWSOME PETS,Pawsome,pawsome.example,Pet supplies\nBean Bliss Coffee Company,Bean Bliss,,Bean,bean.example,Coffee beans\nGlobal Goods Marketplace Inc.,Global Goods,RETAIL,Global,goods.example,General products"
expected["VERIFIED: Pawsome Pets Inc.", "NOT VERIFIED: Bean Bliss Coffee Company", "NOT VERIFIED: Global Goods Marketplace Inc."]
checking account