Interview Question


Country: India
Interview Type: Written Test




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

c=((a)+(b)*(a*b-a))-((b-a*a)*(b)+(a));

Yeah this is the answer... it is 15

- Anonymous September 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
2
of 2 vote

c=((a)+(b)*(a*b-a))-((b-a*a)*(b)+(a));
c =((2)+(3)*(2*3-2))-((3-2*2)*(3)+(2))
c=((2)+(3)*(4))-((-1)*(3)+(2))
c=((2)+12)-(-3+(2))
c=14-(-1)=15
SUM(X,Y) (X*Y) just means (x*y) and that is why the difference when applied by reverse, there are no brackets for x and y like ((x)*(y)) and MULT(X,Y) (X)+(Y) just adds x and y after calculating them. You should know that macro only replaces the code with the thing we tell it to replace it with. Its not a function which will calculate a value and return a solution which will takes its place. So simply replace your code with what is written in the macro exactly and the calculate

- vabhdman September 16, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

c=0 is wrong... I sorry actually i forgot to multiply before...
15 is correct..
i checked it

- accessdenied September 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

yeh, c=15 is correct answer

- kamal September 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

EXPLAIN with working

- Anonymous September 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

c=SUM(MULT(a,b),SUM(a,b-a))-SUM(SUM(b-a,a),MULT(b,a))
c=SUM((a)+(b), a*(b-a))-SUM((b-a)*a, (b)+(a))
c= SUM(5,2)-SUM(2,5)
c=10-10
c=0..


sorry it is 0 i think

- Anonymous September 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

yeh, answer c=15 is correct .
but can anyone explain the answer...

- Anonymous September 15, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

answer should be zero

- raam September 16, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Output: Kick the ass of the one who wrote those macros! Never ever write code that is doing like this (e.g. the name does not reflect what the function does).

- Selmeczy, Péter September 18, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.


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