2 ms·
I like how the sample question on Triplebyte tests API memorization instead of algorithms knowledge. Of course, you can't win. At a whiteboarding session, ther
by Apocryphon 8y ago
I like how the sample question on Triplebyte tests API memorization instead of algorithms knowledge.
Of course, you can't win. At a whiteboarding session, there will always be applicants who give out the method from the library instead of providing an algorithmic solution.
- saagarjha 8y agoI found it to be an ok question; not at all an API one. The answers differ quite a bit, and by choosing one and explaining why you can show that you understand what you’re doing. For example, if you choose str.indexOf(‘ ‘) you clearly have no idea what you’re doing, and if you pick str.count(‘ ‘) - 1 you look like you saw the actual solution somewhere and are picking something that looks similar without really thinking about it (why are you subtracting one from something that seems like it returns the number of spaces in a string?). The last one would require the knowledge that “words” is not a common API that any language vends.
- Arnavion 8y agoI agree with you about A and C, but not your reason for discounting D. In particular, https://doc.rust-lang.org/1.0.0/unicode/str/trait.UnicodeStr.html#tymethod.words https://doc.rust-lang.org/1.0.0/unicode/str/trait.UnicodeStr... is an ancient counter-example (it was replaced by split_whitespace).
- true_religion 8y agoCounting words isnt strictly the same thing as counting spaces, so without knowing Javascript, you can still guess that it is wrong. Most of their questions are like SAT questions. They require you have some knowledge about the field in general, then place the answer within the wording of the question itself, or allow logic to determine the right answer.