DEV Community

Stacy Roll
Stacy Roll

Posted on

Technical test for rust junior dev 🤔

A week ago, I gave a technical test to a junior candidate who was applying to our company as a rust junior dev. I presented the following statement and asked them to solve it within 30 minutes.

Develop a dynamic Fibonacci algorithm so that when the user presses 7, it prints the Fibonacci of 7, when they press 9, it prints the Fibonacci of 9, and when they press q, the process terminates.

I provided them with a keyboard input handling code template to save time on that.

cargo add k_board

fn main() {
    for key in k_board::Keyboard::new() {
        match key {
            k_board::Keys::Letter('q') => break,
            k_board::Keys::Number(7) => //fi7,
            k_board::Keys::Number(9) => //fi9,
            _ => (),
        }
    }
}
Enter fullscreen mode Exit fullscreen mode

Unfortunately, the code he provided was failing to print the Fibonacci sequence, and it was also not clearing the console.

Question: Can a junior developer solve the problem I provided in 30 minutes? Or has it only been a developer with little skill?

I'm reading your comments and receiving your own code perspective!

Top comments (2)

Collapse
 
davidedelpapa profile image
Davide Del Papa

In my own view, one should be off the hook for not clearing the console. It is a plus, for sure, but it is not something related really to the task at hand.
On the other hand, if you are already giving them code to read the keyboard, the problem really is a step removed from the keyboard realm. What I mean to say is to focus on what you want to test more than just one scenario I have thought of beforehand. Do you need from a candidate mere basic Rust skills? Knowledge of basic algorithms like Fibonacci's? The ability to perform a given task? Sometimes one does not need an accurate answer to recognize if a candidate is suitable. Choose what you need to test (more than one thing, of course) and make for yourself a checklist. Even copying from stack overflow is a skill, because one has to know the good answer to copy, and not the first one (or the most starred)

In any case, if someone would answer to me: we can optimize the calls in the match, like so:

match key {
            k_board::Keys::Letter('q') => break,
            k_board::Keys::Number(n) => fi(n),
            _ => (),
}
Enter fullscreen mode Exit fullscreen mode

For me that answer alone is more valuable than clearing the console.

What I mean is: make a list of things you are searching for in a candidate, over and beyond the mere technicalities, and check out for them.

Of course, this is my own perspective. I am a solo coder, so far, but if I would need to hire someone in the future, that is what I would do to screen the candidates.

Collapse
 
stacy-roll profile image
Stacy Roll

awesome point, I agree with that