Interview Question


Country: India
Interview Type: Written Test




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

Assuming the numbers are positive, doesn't it only depend on oddness/evenness of A[x]?

If numbers can contain zero, then you need to worry about whether we can get a 0.

If numbers can be negative, then question is not well formed.

- Anonymous June 17, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

numbers are not negative,numbers in array ranging from 1<=n<=9

- karthikkamal666 June 17, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 4 vote

The quesion is ongoing contest on hackerrank so don not give any answer for this quesion... please

- dharmeshjogadia June 17, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think is even number has appeared at least once in [x,y) then mumber will be even.

- glebstepanov1992 June 17, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I believe pow(a,b) = ab is a typo and he actually means a to the power of b. (if it was multiplication, why even bother defining pow and call it pow?)

a<sup>b</sup>

- Anonymous June 17, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

As x is acting as an index in the array and y is just there to reach the base case in recursion so given x you have to just multiply the numbers in the range from x to y. Because y will also be included as base case is to return 1 when x is greater than y. So if an array is
arr[]={3 5 6 7 8 9} and x is 2 and y is 4
So ans=arr[2]*arr[3]*arr[4]=6*7*8

- vgeek June 18, 2014 | 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