How to deal with a failed programming test?

  • (2 Pages)
  • +
  • 1
  • 2

23 Replies - 10646 Views - Last Post: 03 August 2014 - 08:20 AM

#1 kutuup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 01-August 14

How to deal with a failed programming test?

Posted 01 August 2014 - 06:14 PM

I'm new here so I don't know if this is the right place to ask this question, but I need help with how to deal with failing a programming test during a job application.

I'm quite a sensitive person, not in a bad tempered sort of way, in the way that I beat myself up when I fail.

I had to take a Codility test for a job application a few days ago, I knew I didn't do particularly well as I often choke when asked to write code against the clock knowing I only have one shot. The thing is, I KNOW I can code to a good level, the problem is, I'm not a fantastic mathematician and I sometimes need a little time to work out the maths required to solve a problem or create a working algorithm. I have a degree in software engineering and got a good grade, one classification below the highest. The problem is, I'm very used to coding in my own time, when I'm against the clock, I often choke, my head gets all fuzzy and I don't perform as well as I could.

I'm aware of my flaws and accept them, but I can't help but beat myself up when I fail a programming test.

I scored a 17/100 on the Codility test, which is an awful grade.

I've taken challenges on there before and scored 100% on correctness, but I usually get very low performance marks, which puts a big hit on your grade.

How do you deal with a failure that severe and embarrassing? This is something I spent three years studying and have done for four years since graduating despite being unable to find employment doing it, yet that result says to me that I suck at it, the one thing that's supposed to be my "thing". It made me feel like a stupid, useless sack of crap. I know it was a fair assessment of how I performed in that test, but that just made it worse somehow, like it was proof that I'm a failure.

I WANT to be good at this, I make every effort I can to learn and improve at every opportunity, but when you get that horrendous a score, it makes you wonder whether you are just too stupid to do this, and that REALLY hurts when you're already a self critical person.

How do you deal with a failure like that? Any advice would be appreciated.

As an example of the standard of my coding, here's the code I wrote for a Codility challenge I took earlier today, it scored 100% for correctness, but 0% for performance since it must not be well optimized. What it does is takes in an array of integers describing the heights of a set of plots of land in a straight row on an island (A), and an array describing the height of the water around that island on a given day (B). What you have to do is write a function that outputs how many islands there will be on a given day due to the height of the water on said day, where an island is defined as a set of one or more adjacent plots that are above the water level.

using System;

class Solution {
    public int[] solution(int[] A, int[] B)/> {
        int[] numberOfIslands = new int[B.Length];
        int[] plotStates = new int[A.Length+1]; 
        
        plotStates[plotStates.Length-1] = 0;
        
        for(int x = 0; x<= B.Length-1; x++)
        {
            for(int y = 0; y<= A.Length-1; y++)
            {
                if(A[y] > B[x])
                {
                plotStates[y] = 1;
                }
                else
                {
                plotStates[y] = 0;
                }
            }
            
            for(int z =0; z<= plotStates.Length-1; z++)
            {
                if(plotStates[z] == 1 && plotStates[z+1] ==0)
                {
                       numberOfIslands[x]++;
                }  
            }    
        } 
        return numberOfIslands;
    }
}



What do you think?

Is This A Good Question/Topic? 0
  • +

Replies To: How to deal with a failed programming test?

#2 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2330
  • View blog
  • Posts: 9,378
  • Joined: 03-December 12

Re: How to deal with a failed programming test?

Posted 01 August 2014 - 07:05 PM

Well, no use in crying over spilt milk. Is one thing I would say.


Then, you have to get used to being on the clock. Deadlines are clocks that are measured in days, weeks, months. But, still a clock. I worked for a company that everyone on your team should know if it took you more than 15 minutes to create a function, the department should know if still stuck after 45 minutes.

Next is to work efficiently and effectively with the clock. If you can take your time and still not create efficient code, what would it look like in a code crunch with a fast deadline coming?
Was This Post Helpful? 0
  • +
  • -

#3 kutuup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 01-August 14

Re: How to deal with a failed programming test?

Posted 01 August 2014 - 07:52 PM

View Postastonecipher, on 01 August 2014 - 07:05 PM, said:

Well, no use in crying over spilt milk. Is one thing I would say.


Then, you have to get used to being on the clock. Deadlines are clocks that are measured in days, weeks, months. But, still a clock. I worked for a company that everyone on your team should know if it took you more than 15 minutes to create a function, the department should know if still stuck after 45 minutes.

Next is to work efficiently and effectively with the clock. If you can take your time and still not create efficient code, what would it look like in a code crunch with a fast deadline coming?


Thanks for your reply, I know I need to work on my speed, that's my biggest flaw. I've been working on taking and retaking the Codility challenges and improving my efficiency wherever I can find a spot where I can improve upon the last attempt.

The thing that makes it difficult is that I suffer from Major Depressive Disorder, which runs in my family. As a result, I choke easily, and that's a thing I want to work out. I'm better than I was, but there is still room for improvement. What I'm hoping for is some advice on building some confidence in your ability that will prevent you from choking under pressure.

The pressures upon graduates in this field are very evident to me, my best friend whom I went to university, high school and elementary school with took his own life a couple of years ago due to the pressure on him (at least that's what he said in his note). The thing that scared me was that he was FAR better than me at coding. I don't have any plans to follow the same path he did, but I understand how he felt.

It's like you are expected to be flawless right out of university. What I need is a job where a company is willing to take me for what I am, a person who can code, but needs a push in the right direction. I want to learn, I want to gain experience, but I feel like most companies want you to come with pre-loaded experience.

I just want a chance, I'll do the rest. I know that training a person is a big drain on a company's resources, but it's like I'm not even worth considering. It feels like there is no entry level. I can try my best and take any training they want me to take, but I still won't be good enough.

How do you deal with those kinds of feelings?
Was This Post Helpful? 0
  • +
  • -

#4 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2330
  • View blog
  • Posts: 9,378
  • Joined: 03-December 12

Re: How to deal with a failed programming test?

Posted 01 August 2014 - 08:26 PM

Practice and complacency are what makes things normal. There is no such thing as flawless and companies know that you likely don't know anything coming from school. But, you should be able to understand what you're doing and be able to learn quickly to survive. Everyone.e has feelings of inadequacy, there is a link to a simular thread postin the cubicle corner now(one of modi's posts).

Other than that, seek medical and psychological help. If you mind isn't right, anything can make you snap. Outside of that, relax, take up a fitness program, run. Physical activity calms the mind!
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6507
  • View blog
  • Posts: 14,372
  • Joined: 02-June 10

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 06:31 AM

First: Consider the source. I'm a direct, frank hard ass. I will tell a person what I think they need to hear, not always what they want to hear. And I will say it 'man-to-man', not blowing sunshine and rainbow up their kilt. So here is my bits of wisdom (each is a link to an article):


Was This Post Helpful? 0
  • +
  • -

#6 kutuup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 01-August 14

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 07:16 AM

View PosttlhIn`toq, on 02 August 2014 - 06:31 AM, said:

First: Consider the source. I'm a direct, frank hard ass. I will tell a person what I think they need to hear, not always what they want to hear. And I will say it 'man-to-man', not blowing sunshine and rainbow up their kilt. So here is my bits of wisdom (each is a link to an article):



I get where you're coming from, and thanks for the links, but I don't think you're completely right that being blunt with someone is always the best course of action. I disagree with the idea that young people can't handle criticism, we can, we just get frustrated by non constructive criticism. For example, if I submit code to someone to assess, and they come back with "that's wrong." or "that sucks.", that doesn't help at all. I'm not looking to be told that it's right or it's amazing, I'm looking to be told WHY it's wrong or WHY it sucks. If I'm not told why, I don't learn anything and I don't progress. I'm not even looking for an in depth breakdown of the problems, a little hint would be enough, something as small as "look at that line and think about what's going wrong there." would be enough.

I think a lot of young/inexperienced developers get frustrated when people make assumptions about what they expect, too. No young developer expects to get a degree and then walk into a job. They expect to have to work for it, but the frustration comes when people who HAVE worked in development for a long time aren't willing to offer helpful advice. Telling them that the only problem is themselves and that maybe they simply aren't cut out to work in the industry isn't helpful, WHY aren't they cut out to work in the industry? Telling them they must not be trying hard enough or putting in enough effort when they're trying and making efforts to the point of driving themselves to tears is also unhelpful, all it leaves them thinking is "what do these people want from me???"

Think of it this way, young developers are inherently inexperienced, pointing out that they are inexperienced as a reason for them failing to make headway is just stating the obvious. It's the classic cycle of "I can't get a job because I don't have experience because I can't get a job". Of course there are other ways to get experience, but you can't pay the bills while doing them and most companies won't accept non-employment experience.

The reason people get frustrated is that being honest or blunt doesn't help by itself, being constructive does.

We're not looking to be told we're perfect, we're looking to be told why we're NOT perfect. Not everyone is born with tons of confidence in their own ability, that's not a reason to write them off, though.
Was This Post Helpful? 0
  • +
  • -

#7 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon

Reputation: 2298
  • View blog
  • Posts: 9,535
  • Joined: 29-May 08

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 07:38 AM

The Island problem can be done within an upper-bound of O(n) (all of the poiunts greater that sea-level.

Iterator (pointheigh() , SeaLevel ) As IEnumerable()
 
Dim sx=0
Dim ex=0
For x=0 To pointheight.count-1
If pointheight.count-(x) <= SeaLevel Then 
   if x-ex then
      Yield {sx,ex}
      sx=x
      ex=x
   end if
Else
  ex=x
End If
ex=pointheight.count-.count-1
if pointheight.count-(ex)>SeaLevel Then  Yield {sx,ex}

End Function



If the data structure was different, theoretically in O(log n)
Was This Post Helpful? 0
  • +
  • -

#8 kutuup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 01-August 14

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 08:53 AM

That's definitely more efficient than my method, thanks!

One way I could optimize the method I used would be to cut out the second pass over the array of islands that are above water and just nest that check inside the initial loop by checking the next data point against the current one at the point when the current data point is found to be above water. That would cut the number of operations by 50%.
Was This Post Helpful? 0
  • +
  • -

#9 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon

Reputation: 2298
  • View blog
  • Posts: 9,535
  • Joined: 29-May 08

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 12:56 PM

You could also utilise Memorization, if the island points don't change.


Iterator Function IslandCounts( Points() AS Integer, SeaLevels As Integer) As IEnumerable(Of Integer)
  Dim cache As New Dictionary(Of Integer, integer)
  For Each SeaLevel In SeaLevels
    If Not cache.ContainsKeu(SeaLevel) Then cache.Add(SeaLevel, IslandCount(Points, SeaLevel) 
    Yield cache(SeaLevel)
  Next
End Function

Function IslandCount ( Points() As Integer , SeaLevel As Integer ) As Integer
  Dim Islands = 0
  Dim Above = False
  For Each Point In Points
    Dim Alt = Point > SeaLevel
    If Above AndAlso Alt Then Continue For
    Island +=1
    Above = Alt
  Next
  Return Islands
End Function


This post has been edited by AdamSpeight2008: 02 August 2014 - 01:02 PM

Was This Post Helpful? 0
  • +
  • -

#10 kutuup  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 01-August 14

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 01:53 PM

View PostAdamSpeight2008, on 02 August 2014 - 12:56 PM, said:

You could also utilise Memorization, if the island points don't change.


Iterator Function IslandCounts( Points() AS Integer, SeaLevels As Integer) As IEnumerable(Of Integer)
  Dim cache As New Dictionary(Of Integer, integer)
  For Each SeaLevel In SeaLevels
    If Not cache.ContainsKeu(SeaLevel) Then cache.Add(SeaLevel, IslandCount(Points, SeaLevel) 
    Yield cache(SeaLevel)
  Next
End Function

Function IslandCount ( Points() As Integer , SeaLevel As Integer ) As Integer
  Dim Islands = 0
  Dim Above = False
  For Each Point In Points
    Dim Alt = Point > SeaLevel
    If Above AndAlso Alt Then Continue For
    Island +=1
    Above = Alt
  Next
  Return Islands
End Function




At line 4 there should that not be "If Not cache.ContainsKey(SeaLevel) Then cache.Add(SeaLevel, IslandCount(Points, SeaLevel)?

Maybe I'm just misunderstanding your code? Embarrassingly I'm not sure what language it is :S
Was This Post Helpful? 0
  • +
  • -

#11 jon.kiparsky  Icon User is online

  • Chinga la migra
  • member icon


Reputation: 10681
  • View blog
  • Posts: 18,294
  • Joined: 19-March 11

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 02:34 PM

View PostAdamSpeight2008, on 02 August 2014 - 02:56 PM, said:

You could also utilise Memorization, if the island points don't change.


Usually referred to as "memoization" in the literature, in case you want to search for it. "Memorization" is committing something to memory, "memoization" is making a note (a 'memo') of something for later reference.
Was This Post Helpful? 0
  • +
  • -

#12 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2330
  • View blog
  • Posts: 9,378
  • Joined: 03-December 12

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 02:39 PM

Quote

Maybe I'm just misunderstanding your code? Embarrassingly I'm not sure what language it is :S


Looks to be VB.NET. I take it the position you applied for was junior Java developer?

This post has been edited by astonecipher: 02 August 2014 - 02:39 PM

Was This Post Helpful? 0
  • +
  • -

#13 tlhIn`toq  Icon User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6507
  • View blog
  • Posts: 14,372
  • Joined: 02-June 10

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 02:41 PM

View Postkutuup, on 02 August 2014 - 08:16 AM, said:

View PosttlhIn`toq, on 02 August 2014 - 06:31 AM, said:

First: Consider the source. I'm a direct, frank hard ass. I will tell a person what I think they need to hear, not always what they want to hear. And I will say it 'man-to-man', not blowing sunshine and rainbow up their kilt. So here is my bits of wisdom (each is a link to an article):



I get where you're coming from, and thanks for the links, but I don't think you're completely right that being blunt with someone is always the best course of action. I disagree with the idea that young people can't handle criticism, we can, we just get frustrated by non constructive criticism. For example, if I submit code to someone to assess, and they come back with "that's wrong." or "that sucks.", that doesn't help at all. I'm not looking to be told that it's right or it's amazing, I'm looking to be told WHY it's wrong or WHY it sucks. If I'm not told why, I don't learn anything and I don't progress. I'm not even looking for an in depth breakdown of the problems, a little hint would be enough, something as small as "look at that line and think about what's going wrong there." would be enough.

I think a lot of young/inexperienced developers get frustrated when people make assumptions about what they expect, too. No young developer expects to get a degree and then walk into a job. They expect to have to work for it, but the frustration comes when people who HAVE worked in development for a long time aren't willing to offer helpful advice. Telling them that the only problem is themselves and that maybe they simply aren't cut out to work in the industry isn't helpful, WHY aren't they cut out to work in the industry? Telling them they must not be trying hard enough or putting in enough effort when they're trying and making efforts to the point of driving themselves to tears is also unhelpful, all it leaves them thinking is "what do these people want from me???"

Think of it this way, young developers are inherently inexperienced, pointing out that they are inexperienced as a reason for them failing to make headway is just stating the obvious. It's the classic cycle of "I can't get a job because I don't have experience because I can't get a job". Of course there are other ways to get experience, but you can't pay the bills while doing them and most companies won't accept non-employment experience.

The reason people get frustrated is that being honest or blunt doesn't help by itself, being constructive does.

We're not looking to be told we're perfect, we're looking to be told why we're NOT perfect. Not everyone is born with tons of confidence in their own ability, that's not a reason to write them off, though.


You are welcome to dismiss any part of my comments you like. As my former First Sergent used to say "Perspective *is* reality." Your reality is based on your perspective. Mine on mine. Yours is no more right or wrong than mine and vice verca. They are just different.

I will say that from my perspective having been out in the development world for the last two decades I have seen countless rookies that DO think their degree is a golden ticket to immediate 6 figure paychecks right out of college. From experience I can tell you more newbies are stunned by low pay and being treated as 'no nothings' than are not. Far too many come in to start work and want to say "well you're doing this all wrong because in school we learned this", than are open to the idea that college may be myopic and and out of date. Too many want to lead not follow.

You can say you feel I'm wrong. That fine. You know what you know based on you and your fellow students. I know what I know from actually doing this for living in the real world. Too be fair, my real world is going to be different than the next guy's. My time developing in the entertainment industry will be different than the guy with the same amount of time in insurance software.

I also agree that everyone needs a little different approach. Some people need coddling, some need encouragement, some need a swift kick in the arse. Over the internet I can't tell who is who. So I split the difference and go down the middle with "talk to you directly like a grown-up". I don't condescend into thinking everyone needs Kidd gloves and being treated like a potential suicide victim; and I don't tell everyone they are maggots with no business coding. I will be direct and say what I think as if the other person is an adult.
Was This Post Helpful? 3
  • +
  • -

#14 astonecipher  Icon User is offline

  • Too busy for this
  • member icon

Reputation: 2330
  • View blog
  • Posts: 9,378
  • Joined: 03-December 12

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 02:51 PM

tlhIn`toq I believe a lot of that mentality comes from the military background. I have been told I am not very tactful and I don't much care. And I also agree that college kids believe they are now due a higher paycheck just for finishing, some think it just for attending. And my experience says that it is not just in development, but in everything. I have actually watched people say they wanted $60k a year for an entry-level position in construction, because "they went to school for it."

This post has been edited by astonecipher: 02 August 2014 - 04:28 PM

Was This Post Helpful? 1
  • +
  • -

#15 jon.kiparsky  Icon User is online

  • Chinga la migra
  • member icon


Reputation: 10681
  • View blog
  • Posts: 18,294
  • Joined: 19-March 11

Re: How to deal with a failed programming test?

Posted 02 August 2014 - 03:12 PM

On the subject of communication styles. I have to say that communication is something that you either do well at, or you don't, and if you don't do it well then you need to change what you're doing. If you're not getting your point across by one method, you have to try another, or give up. If what you think of as "frankness" isn't working, and you keep doing it, eventually one or both parties will give up. Result - wasted time and bad blood. Generally the junior person in the encounter loses their job, and the senior person loses whatever time they've invested in that person to date (time, resources, opportunity cost, etc) This is a failure that both parties in the exchange have contributed to.

A bad communicator fails continuously in the same way and blames it on the other party. A good communicator fails in different ways until they get their point across.

Notice that this does not excuse either other party from responsibility - "communicating" means both speaking and being understood, and hearing and understanding.

I notice that this sort of "manly man" aggressive style is very hard for its adherents to root out, because they always see their experiences as confirming its effectiveness. But if you're talking to an employee and they feel that you're threatening or direspecting them, it doesn't matter much what you're trying to say, they're probably going to to react in ways you don't want, and that's not going to get you where you want to be. Again, that's partly their fault - they should be able to rise above little things like your inability to get a point across well - but it's also your fault, and you need to understand that if you're going to stop failing.
Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2