BlackRockSoftware EngineerSoftware EngineerQuestion #96

1. Reverse a string in place. 2. Write a method to convert a decimal number to binary. 3. What is the Singleton pattern? 4. What are the differences between Array and ArrayList in Java? 5. If you are going to design a phone directory, what data structure would you use? 6. Calculate Fibonacci numbers with and without recursion. For example, given an array [3, 5, 4], return the 3rd, 5th, and 4th Fibonacci numbers and store them in an array. What is the complexity of your algorithm? 7. Return the length of the last word in a sentence. For example: String s = 'Hello Wang' should return 4; String s2 = 'Hello ' should return 5; String s3 = '' should return 0. 8. Given an input number greater than 9, write a program that repeatedly sums all its digits until the sum is less than 10. For example, given 38: 3+8=11, 1+1=2, stop. 9. What are the differences between String, StringBuilder, and StringBuffer in Java?

Unlock the Full Solution

Enter your email to get the detailed step-by-step solution to this BlackRock interview question, plus access to free interview prep resources.

We'll also send you a free HFT mock interview video.

Get All 104+ BlackRock Questions with Solutions

Plus 16+ hours of video lectures, resume tailoring, and 1:1 mentorship from quants.

Schedule a Call