Pergunta de entrevista da empresa Tata Consultancy Services

They asked me to write a small program logic where, given an HTML form that takes a contact number and a country code (IN or USA), I had to validate that the contact number: • Is exactly 10 digits long • Contains only numbers • Then append the country code prefix: +91 for India or +1 for USA This tested basic string handling and logic-building skills.