17

I have a first job interview for a software engineer position but in the email they state that I will have to write out a program at the interview stage. Does everyone do this?

What kind of program might it be for a graduate?

The job is for a .NET developer, but I can use any language, so I will stick with C#. I'm actually S**Ting it; I have no clue what they are going to ask me to do.

Michael Currie
  • 13,721
  • 9
  • 42
  • 58
G Gr
  • 6,030
  • 20
  • 91
  • 184
  • 7
    I am not sure about program, but employers also like online skills tests. Try to pass some of them. This one http://tests4geeks.com/test/c-sharp could be very helpful to verify your C# skills. – iammilind Jun 17 '13 at 09:24

6 Answers6

31

Many companies will spend much of the interview time asking candidates to write actual code (usually on a whiteboard or piece of paper though sometimes on a real computer) as this is a great way to see if they will be successful in the job. Some things to keep in mind:

  1. Talk out loud. Often interviewers care about your thought process and approach to the problem as much or more than they care about the actual code you write.
  2. Ask questions. Interviewers will often intentionally make a problem ambiguous just to see if you'll notice and seek clarification. Ask things like: "Who is the audience?" "Should I include exception handling?" "Shall I optimize for performance or just make sure it works?"
  3. Don't get flustered if you're struggling. Tell the interview what you're thinking and they'll often point you in the right direction. Partial credit counts.
  4. Get a good night's sleep before your interview. Lots of whiteboard coding and related discussion can be surprisingly grueling.

Good interviewers will be able to extract what you've learned over the course of your lifetime, so don't worry too much about last minute study sessions. It's too late. That said, it's not a bad idea to brush up on basic language syntax and core data structures and algorithms.

Here are some sample problems you may want to practice writing out on paper:

  1. Write a function to calculate the nth number in the Fibonacci sequence.
  2. Write a function to sort 2 arrays of numbers (without using existing libraries).
  3. Design a Deck class and a Card class and write a function to shuffle a deck of cards.
  4. Design a Circle class and write a function to determine if 2 circles intersect.
  5. Design a LinkedList class and write a function to reverse the elements in the list.
C. Dragon 76
  • 9,882
  • 9
  • 34
  • 41
  • 3
    Don't cancel. Not all companies will be this difficult. Worst case, you will get some good interviewing experience. Good luck! – C. Dragon 76 Apr 15 '11 at 22:41
  • 2
    Problems 1 and 4 are only fair if a) you're willing to explain to the interviewee what the Fibonacci sequence is, and b) you're willing to define what a "circle" is and what "intersecting" necessitates. These are textbook problems that any seasoned developer should be able to rehash had they seen common solutions, but might not be able to "invent" on the spot. These types of interviews are unnecessary and typically don't reveal whether or not a candidate can/will be able to do the job they're interviewing for. Anyone can go online and find a card-shuffling algorithm. – Christine Jun 06 '16 at 21:15
  • 3
    I think it makes more sense to bring a solution to one of these problems and ask the interviewee to analyse it for you... better yet, sabotage the algorithm and ask the interviewee to diagnose it. – Christine Jun 06 '16 at 21:20
  • @Hill That's one of the methods we use. When hiring a developer, we sabotage our system in a couple of key ways to make sure they can navigate user controls (ASP.NET Web Forms) and make sure they can use the debugger. Then we make them write a simple form that stores input into a database table. Overall, it's proven quite effective. – ahwm Jun 15 '17 at 14:04
  • 1
    @ahwm - Out of curiosity... assuming you don't hire the developers who fail your screening, meaning you don't have a sample to compare against, how do you know how effective it is? – Christine Jun 16 '17 at 15:00
  • @Hill Fair point. We have had a few who failed it. But those that have passed and ended up being hired have been great additions with one or two exceptions who didn't work out for other reasons. So we consider it effective. The thing is, though, if they can't pass then they're not where we need a developer to be for the position. So even if they had potential, they didn't have the experience we needed at that time. – ahwm Jun 16 '17 at 18:28
  • I may also add that we have simpler tests for lower-level positions that still deal with development. Such as for a support position where they won't be a full developer. – ahwm Jun 16 '17 at 18:30
11

At least be able to do this FizzBuzz

By the time the interview is scheduled, there's probably not too much you can do in the order of preparation.

Just remember, they want to know about your problem solving process. Just try to think out loud as much as possible and if you truly don't know something just say so.

No matter what type of question they ask, just go with the flow and do your best on it. The last thing any interviewer wants to see is someone who gets flustered or upset due to a particular question. I'll be the first to admit that some of the questions asked in an interview may be lame and unnecessary, but you are trying to get a job from these people and you will just have to humor them.

When you have more time to study, you should probably start looking at Questions every good .NET developer should be able to answer.

Community
  • 1
  • 1
Robert Greiner
  • 29,049
  • 9
  • 65
  • 85
3

We issue programming tests all the time. There are many reasons for doing this, over and above the obvious one of testing coding ability. We look for

a) Coding style
b) Ability to develop and implement algorithms
c) Ability to follow instructions
d) Ability to communicate what has been done

But by far and away the most valuable thing about a programming test is discussing with the candidate why they did what they did. In this discussion it becomes obvious rather quickly how much the candidate really understood the test and their own design and implementation. It also roots out plagiarism very quickly.

  • so does this mean the onsite coding (on a laptop) generally tries to assess your algorithm/data structure skills while looking for some clean code? I wonder whether sometimes they will give a few close to real business problems and asked you to code them up on a laptop? – dragonfly02 Jul 09 '15 at 09:16
2

Usually software development jobs give simple tests. I've never once interviewed for a job that required any more than a simple implementation of a function.

Her'es a few simple tests I know of:

  • FizzBuzz: http://www.geekschool.org/programming/fizzbuzz/
  • For a job at MS, I was asked to write a function to reverse the words in a string.
  • At a different job, I was asked to write an implementation of the Join function in c++.
  • A friend of mine got this one for game development: Write a function to test simple rectangle collision
ChrisG
  • 1,403
  • 13
  • 22
1

More than likely it's something simple like FizzBuzz, just meant to weed out the totally unqualified people.

Brook
  • 5,949
  • 3
  • 31
  • 45
1

If the company don't ask for you to write code in the interview, that's really, really bad. Go for another company.

The type of test depends. I've done test that i had to write small C code, with pointers or recursive functions.

But generally, they ask for a basic asp.net application (I'm also C# developer), like just one form, inserting and reading from the DB.

Ortiga
  • 8,455
  • 5
  • 42
  • 71
  • either really bad, or really good:) – eiran Sep 29 '14 at 11:03
  • How could it be really good? The only time I got hired without writing code, I was the first IT employee in a non-IT company. So they had no idea. I accepted the job because I would be able to assemble my own team. – Ortiga Sep 29 '14 at 11:53
  • I interview a lot, and I don't seek people that know how to write code, I want people that can think, design and execute a plan + work in a team and communicate their ideas... learning a language is not that hard, 12 year old kids do that daily! that said, I do use coding task, but i don't care if the candidate write pseudo code, or even just create a good design that makes it easy to implement. today we write C++ and tomorrow Rust, who knows maybe we run PythonRT (<= Not a real thing, yet). – Tomer W Aug 21 '20 at 07:43