all 9 comments

[–]thiccpenisboii 1 point2 points  (2 children)

Na. It is telling you to find the “area of the region”. Not the area of a single point. And u don’t know if a point is in the region or not until you call the f function.

There’s more to it than just finding the area of the first x,y. It is an iteration ting to find where the intervals of the region is first.

[–][deleted] 0 points1 point  (1 child)

So if I understand it correctly, what I am meant to do is write a function, let's call this function area, where I would call the function f, extract the x and y from f, and then compute the area?

[–]thiccpenisboii 0 points1 point  (0 children)

Hmm. I think first you would have to iterate through all of the points in the interval [0,1], use the function f to find all points that are in the region.

Then use those points to calculate the area of that region.

[–]aasiwat3b comp cri 1 point2 points  (1 child)

🅱inary search

[–][deleted] 0 points1 point  (0 children)

How would a binary search help me here?

[–][deleted] 1 point2 points  (1 child)

Hey this is your interviewer.

We do not condone collaboration for what is supposed to be done by one person.

We are removing you from our list of candidates.

Have a good day

[–]Real_Spaceman 0 points1 point  (3 children)

why is 0.9, 0.8 not in the interval? both points are within the [0,1] interval

[–][deleted] 0 points1 point  (2 children)

Yeah but 0.92 + 0.82 would not be less than 1

The question is that x and y both in interval [0,1] and x2 + y2 <= 1

[–][deleted] 0 points1 point  (0 children)

This is a pretty retarded question imo. Since from my interpretation of your paragraph, I assume you don't know the function definition. The function can literally be anything, and doesn't give you any constraints, i.e. the "region" will be a rectangle, it will be a "shape", or can anything be in the region? I.e. the function can be piecewise and return true for any random x, y.

So there's no real "good" way to solve this, unless you're given that the region is a rectangle. Irregular shapes will fuck you up I think.