3 ms·
>"To me a decent junior should be able to build a basic Hacker News" In what time period? With what features? With what non functional requirements? Show me a
by fridif 5y ago
>"To me a decent junior should be able to build a basic Hacker News"
In what time period? With what features? With what non functional requirements? Show me a senior who can!
I have a better test for evaluating anyone's skills:
Write a function that puts Strings in an array. Then write another function that goes searching for a string in an array.
Write a unit test to confirm your code is working. Explain what happens to the performance of our code if we can guarantee our array is sorted.
If they can past this test, you're already better than most candidates in my eyes, and it takes about 10 mins to find out.
- MattGaiser 5y agoI would be satisfied with anything approaching a forum, with wide flexibility in specific features. If you know enough about a web framework to get it going, use it to complete a specific set of tasks, and get it deployed with a database, it would put you ahead of a heck of a lot of grads that I know. I wasn't suggesting this as an interview question, but more a self check for juniors. Can you actually bring something end to end? Yours works better in an interview setting, although it seems fairly trivial.
- umanwizard 5y agofn put_string(array: &mut Vec<String>, input: String) { array.push(input) } fn find_string(array: &[String], input: &str) -> Option<usize> { for i in 0..array.len() { if &array[i] == input { return Some(i); } } None // or perhaps more idiomatically: // array.iter().position(|s| s.as_str() == input) } #[test] fn test_find_string() { let mut array = vec![]; put_string(&mut array, “foo”.to_string()); put_string(&mut array, “bar”.to_string()); assert_eq!(find_string(&array, “foo”), Some(0)); assert_eq!(find_string(&array, “bar”), Some(1)); assert_eq!(find_string(&array, “quux”), None); } If our array is sorted, the performance of the function should improve due to better branch prediction. But we’d be better of rewriting it as binary search in that case. What kind of salary are you offering?
- fridif 5y agoIn the USA you're worth at least 100k. However, like many others who conduct interviews, I'm not the one who signs the paycheck :)