Validate Timestamped Message Records
Updated
Problem statement
Validate records read from a message file. Each line begins with a datetime prefix followed by exactly five record fields.
Fields are separated by tab characters. The first field is the datetime prefix and is removed before validating the record. A line is valid when exactly five record fields remain and every one is non-empty after trimming; the first record field is the name.
Return one boolean per input line in the same order.
Function
validateMessageRecords(lines: String[]) → boolean[]Examples
Example 1
lines = ["2026-01-17T10:00:00Z\talice\tmessage\tfile-1\tready\thello","2026-01-17T10:01:00Z\t\tmessage\tfile-2\tready\thi","2026-01-17T10:02:00Z\tbob\tmessage\tfile-3\tready"]return = [true,false,false]The first line has five non-empty record fields. The second has an empty name, and the third has only four record fields.
Example 2
lines = ["ignored\tann\ttype\tpath\tok\tnote","ignored\tann\ttype\tpath\t \tnote"]return = [true,false]The datetime text is ignored. A whitespace-only record field is empty.
Constraints
1 <= lines.length <= 10000.- Each line has at most
10000characters. - The datetime prefix itself is opaque and is not validated.
- Only the five record fields must be non-empty after trimming spaces.
- Tabs are the only field separators.
More Stripe Phone Screen questions
- Business Account KYC Verification — Parts 1–5PHONE SCREEN · Seen Nov 2026
- Financial Account LedgerOA · PHONE SCREEN · Seen Nov 2026
- Merchant Matching, Parts 1–2: Shared Fields and Weighted ThresholdsPHONE SCREEN · Seen Nov 2026
- Parse Boolean Rule ExpressionsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Merchant Payout Scheduler, Part 2: Per-Merchant SchedulesPHONE SCREEN · Seen Nov 2026
- Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesPHONE SCREEN · Seen Nov 2026
- Render a Task Tree from CSV RowsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Invoice / Payment ReconciliationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Linked Merchants Within Two HopsPHONE SCREEN · Seen Nov 2026
- Portfolio Valuation, Part 1PHONE SCREEN · Seen Nov 2026
Similar questions at other companies
- Restricted Decimal Number ValidatorLinkedIn · PHONE SCREENLinkedIn interview questions
- Extensible Grep Line FilterBloomberg LP · PHONE SCREENBloomberg LP interview questions
- Format CSV Rows as an ASCII TableAmazon · PHONE SCREEN
- Compare Calendar DatesWells Fargo · PHONE SCREENWells Fargo interview questions
- CSV Row SerializerMercor · PHONE SCREENMercor interview questions
- Host Log ParserVerkada · PHONE SCREENVerkada interview questions
- Length-Prefixed String CodecSnowflake · PHONE SCREENSnowflake interview questions
- Query Log MatchDatadog · PHONE SCREEN · ONSITE INTERVIEWDatadog interview questions
- Machine Message RouterOpenAI · PHONE SCREENOpenAI interview questions
- Parse and Query Server LogsKikoff · PHONE SCREENKikoff interview questions