Add office photos
Blackrock logo
Engaged Employer

Blackrock

Verified
3.8
based on 448 Reviews
Video summary
Filter interviews by
Software Developer
Clear (1)

Blackrock Software Developer Interview Questions and Answers

Updated 5 Feb 2024

Q1. Greatest Common Divisor Problem Statement

You are tasked with finding the greatest common divisor (GCD) of two given numbers 'X' and 'Y'. The GCD is defined as the largest integer that divides both of the given...read more

Ans.

Find the greatest common divisor (GCD) of two given numbers 'X' and 'Y'.

  • Iterate from 1 to the minimum of X and Y, check if both X and Y are divisible by the current number, update GCD if true

  • Use Euclidean algorithm to find GCD: GCD(X, Y) = GCD(Y, X % Y)

  • If one of the numbers is 0, the other number is the GCD

  • Handle edge cases like when one of the numbers is 0 or negative

View 1 answer
right arrow

Q2. Ninja And The Triangle Problem Statement

Ninja is provided with 'N' stars and the task is to construct a triangle such that the 'i'th level of the triangle uses 'i' number of stars. The goal is to make the tria...read more

Ans.

Given 'N' stars, construct a triangle with maximum height using 'i' stars in 'i'th level.

  • Calculate the maximum height of the triangle using the formula: height = floor((-1 + sqrt(1 + 8 * N)) / 2)

  • Iterate through each test case and calculate the maximum height for each 'N'.

  • Output the maximum height for each test case.

Add your answer
right arrow

Q3. Shortest Distance in a Binary Search Tree

Your task is to determine the shortest distance between two nodes with given keys in a Binary Search Tree (BST).

It is assured that both keys exist within the BST.

Inpu...read more

Ans.

Find the shortest distance between two nodes in a Binary Search Tree.

  • Traverse the BST to find the paths from the root to both nodes.

  • Compare the paths to find the common ancestor node.

  • Calculate the distance by adding the lengths of the paths from the common ancestor to both nodes.

  • Return the shortest distance as the result.

Add your answer
right arrow

Q4. Bridge in Graph Problem Statement

Given an undirected graph with V vertices and E edges, your task is to find all the bridges in this graph. A bridge is an edge that, when removed, increases the number of conne...read more

Ans.

Find all the bridges in an undirected graph.

  • Use Tarjan's algorithm to find bridges in the graph.

  • A bridge is an edge whose removal increases the number of connected components.

  • Check for bridges by removing each edge and running a DFS to see if the graph is still connected.

Add your answer
right arrow
Discover Blackrock interview dos and don'ts from real experiences

Q5. Binary to Decimal Conversion

Convert a given binary number, represented as a string 'S' of size 'N', into its decimal equivalent integer and output it.

Input:

The first line contains an integer 'T', denoting th...read more
Ans.

Convert a binary string to its decimal equivalent integer.

  • Iterate through the binary string from right to left, multiplying each digit by 2 raised to the power of its position.

  • Add the results of the multiplication to get the decimal equivalent.

  • Ensure the binary string consists only of '0' and '1' characters.

  • Handle multiple test cases by repeating the conversion process for each case.

Add your answer
right arrow

Q6. Validate Binary Search Tree Problem Statement

Your task is to determine if a given binary tree with 'N' nodes is a valid Binary Search Tree (BST). A BST is defined by the following properties:

  • The left subtree...read more
Ans.

Validate if a given binary tree is a valid Binary Search Tree (BST) based on its properties.

  • Check if the left subtree of a node has only nodes with data less than the node's data.

  • Verify if the right subtree of a node has only nodes with data greater than the node's data.

  • Ensure that both the left and right subtrees are also binary search trees.

  • Implement a validation function for a BST.

  • Output 'true' if the binary tree is a BST, otherwise output 'false'.

Add your answer
right arrow
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Blackrock Software Developer

based on 2 interviews
Interview experience
4.0
Good
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

Amazon Logo
4.1
 • 321 Interview Questions
Paytm Logo
3.3
 • 46 Interview Questions
Swiggy Logo
3.8
 • 17 Interview Questions
BNY Logo
3.9
 • 17 Interview Questions
View all
Recently Viewed
INTERVIEWS
Persistent Systems
No Interviews
INTERVIEWS
Intellect Design Arena
No Interviews
INTERVIEWS
Persistent Systems
No Interviews
SALARIES
Hindustan Construction Company
INTERVIEWS
Persistent Systems
No Interviews
LIST OF COMPANIES
Persistent Systems
Locations
SALARIES
Ahluwalia Contracts India
SALARIES
Intellect Design Arena
LIST OF COMPANIES
Intellect Design Arena
Locations
INTERVIEWS
Sanmina Sci
No Interviews
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter