Can you write a function to detect if two strings are anagrams (for example, SAVE and VASE)?
Submitted by: MuhammadThis is my go-to first interview question. It helps me gauge a candidate's ability to understand a problem and write an algorithm to solve it.
If someone has not solved the problem before, I expect to see some code with loops and if/then's. Maybe some HashMaps. The things I look for are ability to break down the problem to see what you need to check, what the edge cases are, and whether the code meets those criteria.
The naive solution is often to loop through the letters of the first string and see if they're all in the second string. The next thing to look for is, the candidate should also do that in reverse too (check string 1 for string 2's letters)? The next thing to look for is, what about strings with duplicate letters, like VASES?
Submitted by: Muhammad
If someone has not solved the problem before, I expect to see some code with loops and if/then's. Maybe some HashMaps. The things I look for are ability to break down the problem to see what you need to check, what the edge cases are, and whether the code meets those criteria.
The naive solution is often to loop through the letters of the first string and see if they're all in the second string. The next thing to look for is, the candidate should also do that in reverse too (check string 1 for string 2's letters)? The next thing to look for is, what about strings with duplicate letters, like VASES?
Submitted by: Muhammad
Read Online Full Stack Developer (Java) Job Interview Questions And Answers
Top Full Stack Developer (Java) Questions
☺ | Tell me what is Bridge pattern? |
☺ | Can you please explain what is CORS? How does it work? |
☺ | Tell me what is your favorite language and why? |
☺ | Tell us are you aware of design patterns? |
☺ | Explain me what Are The Latest Trends In Full Stack Web Development? |
Top Java Programming Language Categories
☺ | Core Java Interview Questions. |
☺ | Hibernate Interview Questions. |
☺ | Advanced Java Interview Questions. |
☺ | IBM WebSphere Interview Questions. |
☺ | Spring Framework Interview Questions. |