Data Intern Interview Questions

7,482 data intern interview questions shared by candidates

Write a function that takes in a string S, a character C1, and another character C2, and switches occurrences of C1 in the first half of string S with occurrences of C2 in the second half of string S. The function should only switch these characters until one of the sides runs out of their respective character. The switching should be done from the outsides of the strings inward; in other words, it should always replace outermost characters first.
avatar

Investment Analytics & Data Intern

Interviewed at Acadian Asset Management

4.5
Jan 28, 2023

Write a function that takes in a string S, a character C1, and another character C2, and switches occurrences of C1 in the first half of string S with occurrences of C2 in the second half of string S. The function should only switch these characters until one of the sides runs out of their respective character. The switching should be done from the outsides of the strings inward; in other words, it should always replace outermost characters first.

Viewing 6611 - 6620 interview questions

Glassdoor has 7,482 interview questions and reports from Data intern interviews. Prepare for your interview. Get hired. Love your job.