Adobe Interview Question for Software Engineer / Developers






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

Lets assume the radius of circle is 'r' and centre of circle is the origin.
So the coordinate of top right vertex of the enclosing square will be (r,r).
now the co-ordinate of the rectangle falling on the circle will be
(r-7, r-14) or (r-14, r-7).
Since this point is falling on the circle it has to follow the circle equation i.e
x^2 + y^2 = r^2
putting the values of x and y
(r-7)^2 + (r-14)^2 = r^2
=> r^2 - 42r + 245 = 0
=> (r-7)*(r-35) = 0
so r = 7 or r = 35
now r ca not be 7
so r = 35

- Paras March 19, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

You are assuming that the centre, the square top-left of the square and the small rectangle bottom right fall in the straight line. How can you be sure of that?

- CuriousMe March 19, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@CuriousMe : I did not get you. Can you please explain?

- Paras March 19, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@CuriousMe : The only thing I am assuming here is that the center of the circle is the origin. The answer doesn't change if the center is anywhere else also.

- Paras March 19, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

hi paras,
which points cordinte is r-7, r-14 can u plz explian clearly ..i think its shoud be either r-7,14 or 7,r-14

plz correct me m missing sumthing..here..plz specfiy the points fro cordinate u have calculated

- Algoseekar March 21, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@Algoseekar : (r-7, r-14) is the vertex of the rectangle that is falling on the circle.
As I said the top-right vertex of the square will be (r,r) and assuming the rectangle is along the top-right vertex.

So the top-right vertex of the rectangle will be (r,r). since the length and width of rectangle is 7, 14 so the diagonally opposite vertex of the rectangle (the one that is falling on the circle) will be (r-7, r-14) or (r-14, r-7).

This can be explained in a bttr way thru diagram (but I can't draw it here)

- Paras March 22, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@ Paras, Very good answer.

- siva.sai.2020 March 26, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@paras: very clean & neat approach.

- Anonymous July 06, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@paras: id circle is enclosed in the square and touching all four sides of the square then don't you think that circle's center and square's center are one and the same. and in this case id you place this center at origin, i think top right vertex of the square will be (r*sqrt(2),r*sqrt(2)) not (r,r)....
correct me if i m wrong.....

- abc April 09, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

But the answer is correct and it is true that the point where rectangle touches the circle will be (r-7,r-14) and with the trigonometry its simply gives the answer by (r-7)^2+(r-14)^2=r^2 which is 35.
My doubt was which vertex you are talking about, the vertex where circle touches the square or the top right square vertex?

Maybe some misunderstanding in the nomenclature.... but approach is excellent.....

- abc April 09, 2012 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Let the center of the circle be O and the point on the circumference of the circle where the rectangle touches the circle be A. Now draw a line from O to the top most point of the circle, and draw a line perpendicular to this line from A. Lets call the point where these two lines meet B. Now OA = r, AB = r-14 and OB = r-7. Since, the triangle OBA is a right angled triangle:
r*r = (r-7)*(r-7) + (r-14)*(r-14)
Solve this equation and you have the radius of the circle!
r = 21 + sqrt(406)

- rAx March 24, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Awesome paras...!!

- PKT March 19, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

assuming that r is the radius of the circle

Diagonal of the main square = r* sqrt(2);
Diagonal of the rectangle= sqrt(14*14 + 7*7);

hence we just need to solve the following
r*sqrt(2) - r = sqrt(14*14 + 7*7)

- anon March 19, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@anon : The diagonals of bigger square and smaller rectangle will not be the same line always , So I believe you can't just subtract them to get the radius of the circle. Correct me if I am wrong.

- Paras March 19, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

@Paras true, my bad.

- anon March 19, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Aren't the circle is enclosed in a square? Hence, the top-left corner of the square is {r*sqr(2),r*sqr(2)} not (r,r)

- Saimok March 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

You are talking about the case in which the square is inside the circle, but the question here is circle inside the square.
here all sides of the square will be tangents to the circle.
The equation of these tangents will be (assuming center as origin) :
1. x = r
2. x = -r
3. y = r
4. y = -r
when you solve this u get (r,r), (r,-r), (-r,r), (-r,-r)

- Paras March 20, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

r=35 is correct ans

- Anonymous May 04, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@paras: Nice approach. 35 is the correct ans

- Shivendra Tiwari July 22, 2011 | 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