Stripe Software Engineer Interview Experience — Passport Validation Form Coding Exercise

Stripe·Software Engineer·Aug 2025
Technical Screenmedium

This problem is basically a passport number validation form.

You're given an object that looks something like this:

{ USA: "LLDDDD", Canada: "AALLDDDD" }

Where L means letters only, D means digits only, and A means alphanumeric (letters or digits).

Part 1 – Create a layout. Add a selector with the countries (from the object) as options; add a passport number input field; add a validate button.

Part 2 – Create a validate function that takes a country and a passport number string as input. If the input matches that country's format, return true, otherwise return false.

Write some console.logs and test different scenarios to make sure your function works as expected.

Part 3 – Hook everything up. If the entered number is invalid, show an error message; otherwise do nothing. You need to handle edge cases, and reset the form when a new country is selected, and reset the error when the passport number changes.

Finally, explain how you would improve accessibility, and what changes you would make to get this to a production-ready state.

Published

Curated and edited by PracHub

Practice the questions from this interview

Discussion

Sign in to join the discussion. The author is notified of every comment.

Loading comments…

Interview at a glance

Company
Stripe
Role
Software Engineer
Rounds
Technical Screen
Difficulty
medium
Interview date
Aug 2025
Questions from this interview
1 question

Real Stripe interview experiences

First-hand reports from Stripe candidates — the rounds, the questions they were asked, and how it went.

All 46 Stripe interview experiences