Stripe full-time frontend one-hour phone interview, the task is to create an input field for entering a phone number, without requiring any CSS, just the functionality.
Requirements:
- Only allow input of numbers, no symbols or letters.
- Format should be: (123)456-7890, automatically adding parentheses after the third digit, and a dash after the sixth digit. After entering 10 digits, no more can be added.
- Allow copy-paste, but filter the content. For example, copying “234qwer56,&&&78916” should paste “234567891” into the input field.
- Implement using React.