DEV Community

Dave
Dave

Posted on

We're hiring! New Junior test - thoughts?

Introduction

My employer is hiring, at all levels, and I've been asked to do the technical side of the interviews. We have a pretty decent test for Senior's already, but I'm aware that it's a little too much to ask of a junior without freaking them out.

Not a job advert, but reach out if you're interested!

Incidentally, this isn't a recruitment advert, but if you're inside a commutable range of large cities in North West UK, or prepared to move there, and looking for work... feel free to get in touch with me. I can tell you a little about what we do, and tell you where to send a CV. Hell, even if you're a recruiter reading this, get in touch, and I'll happily point you at HR.

Again, we're looking at multiple levels (Junior, Mid & Senior), so if you're not a Junior, don't let that put you off!

The nuts & bolts of it

So I've come up with a new litmus test for Junior Java developers that we might talk to. Note, for the purposes of this article, this isn't the test we would give to a Junior, this is just a close approximation, just in case someone I'm interviewing happens to have read this post.

My thought process: For a Junior, be passionate about learning, know some basics about the language (I'm not a University lecturer...) and fail-fast (i.e., tell me if you're out of your depth & need a helping hand).

The code:

package com.junior.test;

public class Main {

    public static void main(String[] args) {
        System.out.println("1: " + taskOne());
        System.out.println("2: " + taskTwo());
    }

    /**
     * Task: Fix the bug(s).
     * @return The sum of all even integers between 1-10
     */
    public static final int taskOne() {
        int sum = 0;
        for (int i=0; i<10; i++) {
            if (i % 2 == 0); sum = sum + i;
        }
        return sum;
    }

    /**
     * Fix the bug(s), and optimise the solution.
     * @return sum(N) where N is between 1-1000, a perfect square, and sqr(N)<1000
     */
    public static final int taskTwo() {
        int sum = 0;
        for (int i=0; i<1000; i++) {
            boolean isPerfect = false;
            int j;
            for (j=0; j<i; j++) {
                if (j * j == i) {
                    isPerfect = true;
                    break;
                }
            }
            if (isPerfect && j<1000) sum = sum + j;
        }
        return sum;
    }
}

Summary

The intent here, is that during the interview, I'll share my screen/hand my laptop over & ask them to walk me through what they would do to solve these tasks. There will be nothing in the project other than this one class (and the IDE pre-configured to run the code).

Please note, if you're a Junior looking at taskTwo wondering what the hell a "perfect prime" is - see my point on fail-fast. Task two uses perfect primes because, in part, I'm looking at how quickly you raise the fact that you don't understand something. If you know what a perfect prime is, fine, I have other ways to find out that bit of your personality.

Also of note, I don't care if my laptop keyboard layout is strange for you. I don't care if you don't understand the IDE (I have 3 installed, take your pick, I literally don't care if you don't understand how any of those 3 work). I don't care if you actually complete each task. I'll make allowances for you stumbling with my keyboard/IDE etc, don't worry about it.

I do care about your approach, and how well you communicate (without giving spoilers, yet).

Your comments

So, what do you think?

Juniors reading this, would it scare you? Would you be able to confidently tackle the tasks? (NB, I do not expect you to actually attempt tackling the tasks).

Seniors reading this, would you be looking for something different from a Junior? Do you think these questions would generally help get the information I'm after?

Top comments (1)

Collapse
 
bigboybamo profile image
Olabamiji Oyetubo

Hi Dave, Junior dev here( at least I think I am 😂), I would definitely attempt the test, doesn't look like it would scare me too much as I've seen similar questions while practicing on Codewars.