Did I make a fool of myself (1 Viewer)

DCrake

Remembered
Local time
Today, 02:28
Joined
Jun 8, 2005
Messages
8,632
I have been a programmer in Access and VB6 for many years now, and until today I thought I was pretty skilled at it, thinkning off the top of my head and all that. Well today I had to see a company about a VB6 contract, and I was aware that he was going to test my skills.

He brought out notepad and asked me to write a function that used Factorial

Such as 5! = 5*4*3*2*1 = 120

Off the top of my head and without access to the internet I failed miserabley. Next he asked me to write another function that would perform a sort on a given set of numbers or letters either a-z or z-a or 1-9 or 9-1. I thought of some sort of bubble sort using an array. But plucking the code right out of thin air without any reference to other resources made me feel like getting up and walking out. I felt a right fool, telling him about all what I had done in the past and could not come up with anything remotely logical. What a dork.

Very much doubt if I get the contract.

One thing I did get right was to write the SQL to display matching records between two table where field 1 in table 1 matched field 2 in table 2. But I could not use a where condition.

Thank heavens that I remembered about left inner joins.

finally he said I have 2 buckets one can hold 3 gallons another holds 5 gallons how do you get the larger one to contain 4 gallons.

1st attempt was to suggest placing the smaller one in the larger one and use displacement. Did not want that approach.

2nd attempt was that I know 1 gallon weighs 10 pounds so I asked if I could use scales, Nope.

In the end I got the answer, but bloody hell, what I have to go through to get work.
 

ChrisO

Registered User.
Local time
Today, 11:28
Joined
Apr 30, 2003
Messages
3,202
>>He brought out notepad and asked me to write a function that used Factorial<<

Whatever you wrote in notepad worked.

Assume: write a function that used Factorial, on a slab of granite, using invisible ink, twenty thousand leagues under the sea.

The point being: did the test environment complain or was the tester trying to not accept the very test environment he gave you?

Notepad was the test environment he gave you and whatever you wrote was accepted by that test environment.

It was a failure of logic on behalf of the tester not to give a reasonable test environment and to not accept the results of the test he gave you.

Recommended reading for the tester: -
Lewis Carroll: 'Alice's Adventures in Wonderland' and 'Through the Looking Glass'.

Chris.
 

smig

Registered User.
Local time
Today, 04:28
Joined
Nov 25, 2009
Messages
2,209
not realy sure what he was looking for.
seems like a test for your logic thinking ability and not for your VB/Access programming skills.
 

spikepl

Eledittingent Beliped
Local time
Today, 03:28
Joined
Nov 3, 2010
Messages
6,142
Don't assume that people hiring other people know what they are doing, or know what is the best way to determine the match (or lack thereof) between an applicant and the job at hand :D

Ever heard of the Peter Principle? Google it, and I bet it'll make you feel better.
 

vbaInet

AWF VIP
Local time
Today, 02:28
Joined
Jan 22, 2010
Messages
26,374
These are common questions asked at interviews because of your skill set and level. You will also find that questions like write an algorithm to make a simple chess program, to get prime numbers, fibonacci series, different sorting algorithms and their complexity time etc. You will find that mostly big organisations ask these sort of questions. Sometimes they will ask you to do it on a whiteboard or do it on Notepad, hardly will they give you a proper IDE to write the algorithm on.
He brought out notepad and asked me to write a function that used Factorial

Such as 5! = 5*4*3*2*1 = 120
Why Notepad? Well, it's not about the accuracy of the algorithm and whether it contains error or not, it's about your logical reasoning. They don't expect it to be a working program (but it would be nice if it compiles) but they expect that your steps were logical and well thought out - depending on the time frame given.

Next he asked me to write another function that would perform a sort on a given set of numbers or letters either a-z or z-a or 1-9 or 9-1. I thought of some sort of bubble sort using an array.
This one is a bit harsh as it's the sort of question you would expect when being interviewed by Microsoft. Actually, they (i.e. Microsoft) do ask questions related to sorting algorithms but they tend to go into more detail about it.

finally he said I have 2 buckets one can hold 3 gallons another holds 5 gallons how do you get the larger one to contain 4 gallons.
This is just another aptitude test so it's not related to your ability to program. People in the IT, Science and Engineering fields would normally get asked this question, but you will be suprised that they may even ask Economists too :)
 

ions

Access User
Local time
Yesterday, 18:28
Joined
May 23, 2004
Messages
785
The reason you had trouble as I would probably have is because

1) For these type of logical problems I like to be in a silent room that I am comfortable in, alone and not under time pressure.

2) Sort algorithms are already coded for us, same with factorial so we don't practice that kind of thinking once we leave university.
 

vbaInet

AWF VIP
Local time
Today, 02:28
Joined
Jan 22, 2010
Messages
26,374
1) For these type of logical problems I like to be in a silent room that I am comfortable in, alone and not under time pressure.
If you anticipate the sort of questions that are going to be asked (maybe by asking people who have been to the interview before) then you will be able to manage.

2) Sort algorithms are already coded for us, same with factorial ...
There's no built-in sorting algorithm for Arrays in VBA and in this instance we have to code our own. Some other OOP languages have a function built-in to the Array class.

2) ... so we don't practice that kind of thinking once we leave university.
Depends on your background and your current interests or job. For people who are into research and theoretical computer science working with algorithms is a routine task.
 

smig

Registered User.
Local time
Today, 04:28
Joined
Nov 25, 2009
Messages
2,209
Sort algorithms are already coded for us
I remember when I started programming in VB (many yars ago) I had a need for sorting an array.
As I ever realy learned programming in school or any other class I made my oun sort routine.
I talked to a friend who is much younger and was already a skilled programmer, and he said "Ho, This is simple, it's a bubble sort, but you can use a sort function"
Truth is I was very happy I recreated the bubble sort :)
 

stopher

AWF VIP
Local time
Today, 02:28
Joined
Feb 1, 2006
Messages
2,396
If you anticipate the sort of questions that are going to be asked (maybe by asking people who have been to the interview before) then you will be able to manage.
I agree of course but it's easy to say after the event. But consider the scenario...you think you're pretty hot on vb (or whatever your hot topic is)). You think, "what else do I need to prepare for". So you go along to an interview for a vb coder. And they hit you with some abstract problems. Even if someone had told you that this or that might come up you'd have probably been happy with your skill set and shrugged it off.

Imho it takes an one or two events like this to shape you up to these sort of tests. Kind of a tap on the head.

There's no built-in sorting algorithm for Arrays in VBA and in this instance we have to code our own. Some other OOP languages have a function built-in to the Array class.
I think ions point is these things are always at your fingertips when you're at the office. I'm pretty hot on logistics (my field) but I still rely on google a lot for qualifying my knowledge. After 20+ years in the industry I wouldn't start revising my CPC (a logistics certification) for a job interview.

Depends on your background and your current interests or job. For people who are into research and theoretical computer science working with algorithms is a routine task.
I might be wrong but I don't think that was the kind of job David was tending for.
 

vbaInet

AWF VIP
Local time
Today, 02:28
Joined
Jan 22, 2010
Messages
26,374
I can actually name a couple of big organisations that asks these sort of questions. If someone had told me this or that was going to come up I wouldn't shrug it off just because I feel I'm a good programmer, I would do it and memorise the formation, not the code. There's a site, I think it's called Euler.net or something, and in there are lots of questions regarding building algorithms to solve certain problems. If you're able to go through most of the questions on that site then questions like this will be a breeze when asked. Obviously, practice makes perfect in this scenario.

If that was your dream job I bet you will spend lots of man hours going through your CPC ;)

He's gone for a VB6 developer position (in most likely a big organisation), so they are thinking algorithms, OOP, 10+ years in the field, we can dish out hard questions :) They normally don't want the full algorithm but for the candidate to show that he or she knows the different sorting algorithms and how to implement them. These are standard questions for positions within Java, C, C#, VB.net etc. They don't expect him to get all questions right, they just want to test his level of reasoning. There would be something in the Job Description that justifies their asking this sort of question (i think).

Oh, by the way David, no you didn't make a fool of yourself. You did the best you could but I do hope you showed them that you were confident in problem solving but at that point in time couldn't think straight. If they see you're confident they will be willing to offer you the contract.
 

DCrake

Remembered
Local time
Today, 02:28
Joined
Jun 8, 2005
Messages
8,632
I have been reading the discussions going on from my opening thread, and I understand alot of things that are being said. However, for someone who have never been put in this situation before, I was quite daunted, The last time I attended and actual interview for a job was about 12 years ago and was offered the job on the spot. I have also interviewed people myself for jobs, but I do not take the approach that if they can write an algorithm then they can do the job.

Its a bit like going for a job as a chef if you can cook what's on the menu then why the need to be able to butcher the cow? You let the butcher do that, all you do is cook the damm steak. It's fine if you have the ability and can recognise a good cut of meat from a bad one but it is not essential.

I think that my attitude stems from the fact that I have always been self taught, yes, I have read the book, and watched the video, and climbing on the backs of giants can be a clever thing. But if the client wants to see you perform brain surgery as a pre-emptive exercise then to me that's OTT.

Remember the story of the eagle and the wren. Which bird can fly the highest. The Eagel said "I am big and strong and have larger wing span with great muscle power and can fly far higher than the little wren."

So the eagle took off and flew up and up and up until he could fly no higher. Looking down he scoured the ground looking for the little wren, he was no where in sight. Then al of a sudden he hear the wren call out. "Hi Mr Eagle" the voice came from above. He looked up and saw the littel wren hovering aboove him.

"How did you manage to fly so high when you are so small?" the eagle asked. "Actually I was sat on your back all the time just waiting for you to run out of steam." So the wren won the bet.

This is not the actual quotation it is just how I remember the story going. But my point is, There is more than one way to skin a cat. And why re-invent the wheel or spend 80% of your time on 20% of the problem when you refer to other more inteligent or people to provide the answer, well if not the complete solution, a push in the right direction. Is that not why we are all memers of this forum?

If he has sat me in a room and gave me 20 mins I would have given him the answers in time - via google and AWF. Would than not of shown resourcefullness and the ability to come up with a solution in the shortest possible time. Thus increasing productivity.

I hope I don't get offered the contract anyway as the rate was poor and the location was far away. Bu that is beside the point.
 

vbaInet

AWF VIP
Local time
Today, 02:28
Joined
Jan 22, 2010
Messages
26,374
Yes, but it's just how they want it to be these days. I bet it was the client that insisted on them asking applicants those questions. If it's a core programming position such as a Software Developer (i.e. not Junior) then the chances of them asking is high.

"Actually I was sat on your back all the time just waiting for you to run out of steam."
That was actually quite funny!:D

I hope I don't get offered the contract anyway as the rate was poor and the location was far away.
Give them a quick ring so you don't get disappointed when you're told you've got it :p
 

DCrake

Remembered
Local time
Today, 02:28
Joined
Jun 8, 2005
Messages
8,632
Actually what happened was I came home did a quick search, go the answers and emailed them back to them and said.. Here you are..... proven and tested answers to your questions... not my solutions but the correct ones. Why re invent the wheel? It may have taken me x times longer to get the answer when one quick Goggle would have given me the answer. In my eyes I would sooner have a correct proven solution, tried and tested than a guestimate anytime.
 

vbaInet

AWF VIP
Local time
Today, 02:28
Joined
Jan 22, 2010
Messages
26,374
With your actions they may think, "this guy is serious about this position and has got a can-do attitude. Let's give it to him".

But if you do get it you already know the sort of time-frame your client would expect fairly complex solutions to be delivered.

Good luck!
 

DCrake

Remembered
Local time
Today, 02:28
Joined
Jun 8, 2005
Messages
8,632
Wha is ironic is that or 2 years I worked in the same building but on a floor higher than them and saw then sneaking out for a fag many times every day. My previous contract only ended 3 weeks prior to me revisting the location and yes I did bump into people from the above floor.

Do I really want to work 50 yards away from my previous empoyer so to speak, getting pestered for support and whatever, I fear not. Anyway we shall see what happens.

But with the demise of the Government closing down of all the PCT's thus potentially placing all the contrators on the unemnploed line beggers can't be choosers.

I have spent the last 6 years on a very comfortable rate only to be contronted with a situation wher I need to seriousley evalualte my circumstances. but if I end up on the proverbial scrap heap so be it. I am 55 now and sufferning from severe COPD but I can still get along 3 yrs left on my big mortgage......early retirement and all that.. Maybe I might even win the Lotto0, who knows.

Pissed again

David
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 11:28
Joined
Jan 20, 2009
Messages
12,851
It is always difficult to assess a candidate's skill at interview and bigger institutions with specialist HR staff often resort to this kind of thing because there isn't time to do it better.

However these tests don't really address the most important capabilities of a programmer. They are aimed at testing a random microcosm.

Systems Analysis, the ability to convert an abstract specification into structure, is the crucial skill. Where there is an element of this in the test they used it is more akin to asking an automotive engineer to design a spark plug.

The engineer can work with the specifications of a spark plug and knowing the exact detail of such an object of the top of their head is not important. The engineer would likely be able to work with references to understand spark plug design better than the spark plug specialist would cope with designing an engine.

Maybe they were looking for a code jockey to write small pieces for the master and the test would be quite appropriate. In that case you wouldn't want the job anyway because it would be boring.

I am a competent systems analyst and I consider myself a good programmer but Google is integral to that skill. One of my primary strengths is the ability to formulate a search that will get me the code block I need even when I don't know exactly what I am looking for.

A search will often reveal there are often many way to approach a problem and it is important to be able to compare the different strategies. The crucial ability is to be able to critically examine the code. There is a lot of quite clumsy code online with considerable scope to improve on it or adapt it to precise needs.

If I was testing someone I would provide an example of code and ask them to explain how it worked, point out the vulnerabilities I had included in it and show how it could be made more efficient. This is a much closer match to how I think most of us work.
 

DCrake

Remembered
Local time
Today, 02:28
Joined
Jun 8, 2005
Messages
8,632
I understand what you are saying. for example if you was using a selet case statement and you was examining the day of the week. Now obviously thre is only 7 but I would still incule the Case Else as the 8th option just in case somethng went amiss. What you don't want is the program bommiong out on you when you least expect it to do, do you?
 

ChrisO

Registered User.
Local time
Today, 11:28
Joined
Apr 30, 2003
Messages
3,202
David, I think that sort of response on your part is perfectly acceptable.

A tradesman knows his tools and if he doesn’t have the correct tool he either knows where to get it or he builds it.

I perceive the tester as being a smartarse. The tester seems more intent on trying to prove that someone can not do a specific task and, in trying to prove that position, provides an unacceptable and hostile environment.

He (she) should have been more interested in arriving at the best quality * time product. That may mean doing a Google or it may mean looking up something we have done in the past, whatever.

But the tester seems more interested in proving someone wrong than in trying to achieve the best cost-effective result for the company that pays his (her) salary.

To my mind, the interviewer failed the interview…

Chris.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 02:28
Joined
Sep 12, 2006
Messages
15,634
Dave

I could write a bubble sort algorithm of the top of my head - but I certainly couldnt write a quick sort algorithm, without looking it up - but I do know the relative efficiency of each of them, which might impress them.

I could write a simple factorial function with a couple of variables - but if they wanted a recursive one, I would need to play a bit - although I've written the recursive fibonacci sequence algorithm enough times to be able to do that straight off.

funny you mention factorials as the next thread on this forum is about combinations of objects.

A puzzle is just a puzzle - the buckets one is well known

fill the 3 - put it in the 5
fill the 3 again, put 2 in the 5 to fill it - leaving 1 in the 3
empty the five
put the 1 in the 3 into the 5
fill the 3 and put in the 5


I never realised they would get you to do silly things like that - i suppose its like giving a typist a typing test - but if you don't expect it, it would come as a shock, wouldn't it?


But i'm sure I wouldn't have ben able to write the SQL without having access open!

its a bit like when Kasparov was on a TV programme - and they asked him to analyse a trivial chess position - expecting him to demonstrate a mate about 8 moves deep - and instead he produced an outbusrt about the irrelevance of the question.
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 02:28
Joined
Jul 9, 2003
Messages
16,271
Well I think I would have told him to get lost!

I don’t think I would have put it quite that bluntly, but that’s the general attitude I would have taken. You were attending an interview for an MS access job, not to see if you would be any good in the pub quiz team!

Let me ask you an intelligence question I once heard:
A small boy he lives in a block of flats, when he goes to school in the morning he takes the lift, when he comes home at night, he takes the lift and stops at the fourth floor, then takes to the stairs to complete his journey home. Why?
 

Users who are viewing this thread

Top Bottom