BlackRockSoftware EngineerSoftware EngineerQuestion #43
1. Reverse a string in place. 2. Write a method that converts a decimal number to binary. 3. What is a Singleton? 4. What are the differences between Array and ArrayList in Java? 5. If you were 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 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 a number greater than 9, write a program that repeatedly sums its digits until the result is less than 10 (e.g., 38 → 3+8=11, then 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.
More BlackRock Software Engineer Questions
Write an algorithm that sorts a hashmap.Given a string, determine if it is a palindrome, ignoring any characters that are not alphabetic.1) Reverse a number: Given an integer input, output its digits in reverse order. For example, input: 9966, output: 6699.
2) Word count in a string: Given a string, return the count of each unique word. For example, input: 'The lovely lady is looking lovely as all lady look lovely' output: The: 1, lovely: 3, lady: 2, is: 1, looking: 1, as: 1, all: 1, look: 1.
3) Swap two numbers without using a temporary variable: Given two numbers, swap their values without using a third variable. For example, input: a = 10, b = 20. Output: a = 20, b = 10.Solve the intersection of two linked lists from scratch, including implementing the linked list data structure. Start with a brute-force approach and optimize it. Also, explain the difference between arrays and linked lists.Given a singly linked list, find and return the value of the middle node.
Get All 104+ BlackRock Questions with Solutions
Plus 16+ hours of video lectures, resume tailoring, and 1:1 mentorship from quants.
Schedule a Call