3 ms·
"Write a function that takes three measurements in centimeters as input and returns a the volume over a litre" I have a hard time understanding what this us su
by Narretz 11y ago
"Write a function that takes three measurements in centimeters as input and returns a the volume over a litre"
I have a hard time understanding what this us supposed to mean. Is there a typo somewhere? "returns a the volume over a litre" sounds like gibberish, but then I am not a native speaker.
- ajkjk 11y agoYeah, it's gibberish. I'm not sure what was intended either. Something like "return how much the volume goes over a litre".
- lanreezy 11y agoNot gibberish per se. 1000 centimeters cubed = 1 L So if you have 3 measurements in cm, you would multiply them all together and divide by 1,000 to get an answer in Liters. [Edit for typo]
- asQuirreL 11y agoThe question is probably more aptly written as "Take the width, height and depth of a cuboid in centimetres, and return its volume in litres".
- avinassh 11y agoNon native speaker here. Does this above question mean, calculate volume with the three measurements and convert that from centimeter to litre? (thousand cubic centimeters make a litre)
- afandian 11y agoNative British English speaker here. The question is not at all clear. It might be a test to see if the candidate says "can you rephrase the question?".
- JDDunn9 11y agoIt means the volume in excess of 1 litre, since it talks about returning a negative number if it is less than that.
- kbart 11y agoThis. But as for non-native English speaker, that "over a litre" part is easy to miss. Special care should be taken when interviewing candidates not in their mother tongue and such single word catch should be emphasized more.
- usea 11y agoI am a native English speaker, and I've never seen that. I was very confused, and I would have had to ask many questions to figure out what "the volume over a litre" meant.
- gnur 11y agoThe "a" is superfluous. >> and returns the volume over a litre
- solaris999 11y agoFrom the description of the problem immediately afterwards, they're looking for you to return "a" (a variable name) which is the magnitude of the volume given less the volume of 1 litre (i.e "a" cm^3 - 1000 cm^3)
- 4ydx 11y agoThe questioner really meant to say "Return as the volume exceeding a litre." Even saying "over a litre" will probably make anybody familiar with physics wonder just exactly what they are asking. "Volume over litres" is what it made me think initially which is very confusing as I don't know what that would actually be in the physical world (other than a nonsensical scalar).
- gliese1337 11y agoIt's a common idiom to use "over" as an equivalent for "divided by". I'm not certain that's what's meant here, now that you question it, but I assume it means "give the volume in fractional liters". EDIT: Actually, looking at the context again, I'm quite certain that's not what is meant at all. They must want the part of the volume exceeding a liter, as mentioned in other comments. But that was definitely not my first interpretation, due to the idiom I just described.
- wtbob 11y agoIt sounds gibberish to a native speaker too, but from context what he meant was, 'take three measurements in centimetres, calculate the volume and return the amount in excess of one litre.'