Databricks公司在程序员界几乎无人不知,总部在旧金山,旨在帮助企业通过大数据+机器学习技术来管理数据,提升效能,著名的开源大数据处理工具Spark就是该公司的明星产品。 Databricks OA 是在Codesignal平台上完成,70分钟共4个题目,全程录像监控,语言不限。时间还是比较紧张。
Databrick Intern OA 1 (Difficulty Easy)
The question requires us to give an integer n and use this integer to create a square of size n. The sides of the square should be * It consists of characters, and the inside of the square is composed of spaces.
We need to construct an N × N matrix, the bounds of the square are * Characters, and there are spaces inside the squares.
The Python code and explanation are given below:

Illustrate:In code create_square_frame The function first checks whether n is legal, and then uses * Construct the upper and lower boundaries, and the two sides of the middle row are *, filled with spaces in between. The overall time complexity is O(n).
Databrick Intern OA 2 (Difficulty Easy)
Given a size of N × M matrix. Define a "bouncing diagonal" as: start from the leftmost cell, move along the diagonal (up-right), and when it encounters the upper and lower boundaries of the matrix, bounce back vertically to continue. For each cell on the leftmost side, calculate the sum of the elements on the bouncing diagonal as weights.
The Python code and explanation are given below:

Calculate the weights:For row i in the left column, traverse along the bounce diagonal and accumulate all elements to obtain the weights.
Sort:Form a tuple (weight, value) of each element and its weight, sort by weight in ascending order; if the weights are the same, then by value in ascending order, and finally return the sorted array of values in the left column.
Overall, the first two Databrick OA questions are not too difficult, and you can quickly write your thoughts by reading the question stems carefully.
Contact Us
After our powerfulInterview assistance, OA ghostwriters, Candidates have demonstrated not only programming skills but also clear thinking and effective communication skills by parsing and communicating on these topics. These experiences are not only applicable to Databricks interviews, but also enhance the ability to solve actual programming problems. I wish you all good luck in your interviews!