Goldman Sachs Interview Question for Analysts






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

Any Line passing the centers of the two squares will cut them in halves

- mkk4u December 08, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Absolutely Correct answer.

- Pankaj April 28, 2008 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

find the centers of the squres and draw a line joining them .

- Ravi Kant Pandey April 10, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

then second square will have to be aligned with the diagonal of the first one. best is line through centers of both the squares.

- ak April 11, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Yup! That's the answer.

- vodangkhoa December 08, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

for squares in 2d plane u would require a plane 2 cut the squares in 2 halves

- Anonymous August 24, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

incorrect...
for a square in 3d( a cube) a plane would split them. for a 2d square. u need a line!

- optimus August 25, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

how about line passing through the diagonals of both the squares?

- rage October 27, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

can anybody comment

- hello123 December 24, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Yes?

- anybody December 24, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

may be this shud do ..

consider if sq1 is in 1st quad and sq2 is in 3rd quad ..

now reflect the sq2 on x axis so that it falls on 2nd quad... now reflect it again on 1st quad ... so now both squares will be in 1st quad ..now adjust them so that they both lie on each other ,, using rotations ,, displacements .. now draw a line at n/2 .. after cutting .. reverse the process to bring back to quad3..

- shar February 11, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public class Square {
       public double left;
       public double top;
       public double bottom;
       public double right;
       public Square(double left, double top, double size) {
              this.left = left;
              this.top = top;
              this.bottom = top + size;
              this.right = left + size;
       }

       public Point middle() {
              return new Point((this.left + this.right) / 2,
                                           (this.top + this.bottom) / 2);
       }

       public Line cut(Square other) {
              Point middle_s = this.middle();
              Point middle_t = other.middle();
              if (middle_s == middle_t) {
                     return new Line(new Point(left, top),
                     new Point(right, bottom));
              } else {
                     return new Line(middle_s, middle_t);
              }
       }
}

- Pavithra V(Igate) September 03, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

code

- Anonymous June 16, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think it would make sense for these geometrical tasks to have some drawing. A drawing is worth hundred words.

- lpappyt October 20, 2021 | Flag Reply


Add a Comment
Name:

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

Books

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

Videos

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