BlackRock Interview Questions
50 real interview questions for Software Engineer roles at BlackRock.
Showing 1–30 of 50 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.
1) Find the nth node from the end of a linked list. 2) Find the second largest number in an array.
Given a binary search tree (BST) and a target value, write an algorithm to determine if the value exists in the BST.
Write an algorithm that returns the Nth number in the Fibonacci sequence.
Write a function that returns the median value from a given list of numbers.
Reverse the nodes of a linked list.
Arrange an array so that all zeros are on one side and all ones are on the other side.
Write a function that reverses a string.
Explain the use of the static keyword in the context of Java. What does it mean when a variable or method is declared static?
What is the difference between an interface and an abstract class in Java? How does method overloading differ from method overriding? Can you explain the concept of encapsulation? What is the purpose of the 'final' keyword in Java?
Write the bubble sort algorithm.
Implement an isEqual function to compare two objects and determine if they are equal.
What data structure would you use to build a parking lot, and why?
Sort a stack using only one additional stack and a single variable.
Find the first common ancestor of two given nodes in a tree.
How does a HashMap work internally?
Describe how a HashMap works.
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?
How does a HashMap find an entry, and what is the runtime complexity of that search operation?
Why is multiple inheritance not supported in Java?
Given an array of integers (both positive and negative), find the maximum sum of consecutive integers.
Implement a resizable stack data structure in your preferred programming language.
Write a function that takes a string and an integer as inputs. The integer specifies the maximum number of consecutive repeated letters to allow in the returned string. For example: ('aab', 1) -> 'ab'; ('aaabba', 2) -> 'aabba'.
Write a method to perform binary search on a sorted array.
How do you convert an expression in infix (prefix) notation to postfix notation?
Find the least common ancestor of two given nodes in an N-ary tree.
Want the full solutions?
Get detailed walkthroughs for all 104+ BlackRock questions with Quant Blueprint.
Get Started