Tableau Interview Question for Software Engineer / Developers

Country: United States
Interview Type: In-Person

Comment hidden because of low score. Click to expand.
of 0 vote

How are the buildings represented? 3d binary matrix or actual geometry?

- keenox September 25, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
of 0 vote

1. Assume the buildings are represented as the triplets of coordinates {(xb, xe) (yb, ye) (zb, ze)}
2. Assume also that we can ignore Z axis ie all the buildings are far enough from us and their width is not important
3. Sort in ascending order by the smallest x coordinate (xb) for each building
4. Pseudo code for the skyline length computation. Note that it is not important
which building is higher, if there is an overlap between two.

length = x0e - x0b /*set initial skyline length to the length of the leftomost building*/
end = x0e
for (int i = 1, i < num_of_buildings; i++) {
	if (Xib < end) {
		if (Xie < end) /*the next building is totally contained in the prev*/
			length += Xie - end; /* partially contained , add the relevant part*/
	else /*not contained */
		length += Xie - Xib;
	/* advance the rightmost end of the skyline*/
	end = Xie; 

- Igor August 01, 2017 | Flag Reply

Add a Comment

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.


is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More


CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More