UST interview question

1 coding question based on collection String, Springboot Java oops