FastPrepBuild a Profile Sentence from CSV
Problems/Build a Profile Sentence from CSV

Build a Profile Sentence from CSV

Airbnb logoAirbnb● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report describes a parser for CSV lines with seven fields. Quoted fields may contain commas, and doubled quotes turn into one quote. Then you build a sentence from firstname, interests, city and age. We chose the exact wording of the sentence and what counts as valid input.

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

You are given one profile as one valid CSV record. It has exactly seven fields, in this order: firstname, lastname, email, interests, notes, city, and age.

Fields are separated by commas that are not inside quotes. A field wrapped in double quotes may contain commas. Inside a quoted field, two double quotes in a row decode to one double quote.

Read the record and return exactly this sentence:

<firstname> is <age> years old, lives in <city>, and is interested in <interests>.

Use the decoded values as they are. Do not add or remove any characters.

Function

profileSentence(row: String) → String

Examples

Example 1

row = "Ada,Lovelace,ada@example.com,mathematics,first programmer,London,36"return = "Ada is 36 years old, lives in London, and is interested in mathematics."

No field is quoted, so the six commas split the record into the seven fields. The first name is Ada, the interests are mathematics, and the city is London. The age is the last field, copied exactly as it is written there. So the answer is the sentence with Ada, that age, London, and mathematics filled in.

Example 2

row = "Ada,Lovelace,ada@example.com,\"math, poetry\",first programmer,London,36"return = "Ada is 36 years old, lives in London, and is interested in math, poetry."

The interests field is wrapped in quotes, so the comma inside it is part of the value, not a field break. Its value is math, poetry. The first name is Ada and the city is London. The age is the last field, copied exactly as it is written there. So the answer is the sentence with Ada, that age, London, and math, poetry filled in.

Example 3

row = "Grace,Hopper,grace@example.com,\"compilers and \"\"debugging\"\"\",navy pioneer,Arlington,85"return = "Grace is 85 years old, lives in Arlington, and is interested in compilers and \"debugging\"."

The interests field is quoted. Inside it, each pair of double quotes decodes to one double quote. So its value is compilers and "debugging", with one quote on each side of debugging. The first name is Grace and the city is Arlington. The age is the last field, copied exactly as it is written there. So the answer is the sentence with Grace, that age, Arlington, and that interests value filled in.

Constraints

  • 7 <= row.length <= 10^5.
  • row is one valid single-line CSV record with exactly seven non-empty fields.
  • No whitespace appears outside a quoted field.
  • Double quotes appear only around a quoted field, or as doubled quotes inside one.
  • The decoded firstname, interests, city, and age fields are non-empty.

More Airbnb Online Assessment questions

  • Count Card Duel RoundsOA · Seen Nov 2026
  • Count Lamps Lighting Each PointOA · Seen Nov 2026
  • Simulate Orchard Rot SpreadOA · Seen Nov 2026
  • Sort Adjacent PairsOA · Seen Nov 2026
  • In-Memory File SystemOA · Seen Nov 2026
  • Task Management SystemOA · Seen Nov 2026
  • Recipe Management SystemOA · Seen Nov 2026
  • Progressive Banking SystemOA · Seen Nov 2026
  • Credit Accounts with Scheduled TransfersOA · Seen Oct 2026
  • Parcel Attribute Store with TTLOA · Seen Oct 2026

Similar questions at other companies

  • Correct Apartment Bedroom CountsRamp · OARamp interview questions
  • Hidden ArtifactsIMC Trading · OAIMC Trading interview questions
  • Incident MonitorStripe · OAStripe interview questions
  • Scale Ingredient QuantitiesUpstart · OAUpstart interview questions
  • IPv4 Address ClassificationRippling · OARippling interview questions
  • Generate Table of ContentsJP Morgan Chase · OAJP Morgan Chase interview questions
  • Query Log MatchDatadog · PHONE SCREEN · ONSITE INTERVIEWDatadog interview questions
  • CSV Row SerializerMercor · PHONE SCREENMercor interview questions
  • Host Log ParserVerkada · PHONE SCREENVerkada interview questions
  • Length-Prefixed String CodecSnowflake · PHONE SCREENSnowflake interview questions

Interview reports that mention this question

  • Airbnb Intern OA and Onsite Rounds: 16 Experiences (Part 5 of 7)

Airbnb interview experiences

  • Airbnb OA · November 2026
  • Airbnb Campus and Full-Time SWE OA / Interviews: 9 Experiences
  • Airbnb Intern Phone Interviews: 21 Experiences (Part 7 of 7)
  • Airbnb Intern OA and Phone Screens: 17 Experiences (Part 6 of 7)
  • Airbnb Intern OA, Diplomacy Game: 19 Experiences (Part 4 of 7)
All Airbnb interview questionsSee Airbnb hiring insights
Saved
class Solution {
    public String profileSentence(String row) {
        // Write your code here.
    }
}
Checking account…