Hey /prog/, this is one of the tests I give in job interviews to check for bullshitting. Too easy, too difficult? What do you think?
SQL
You have a table named orders with a structure described by the following statement:
create table orders
(
order_number varchar(12) primary key,
date_required datetime,
status int not null
)
1. Write a query which lists all order_numbers where the status is less than 6 and the year of date_required is 2004. Have the list sorted by order_number in ascending order.
2. Write a query that returns the number of orders which have a status of 8.
There are two tables, structure as follows:
create table machines
(
machine_id varchar(5) primary key
check (machine_id like '[a-z][a-z][a-z][0-9][0-9]'),
location varchar(4),
current_job_id int
)
create table jobs
(
job_id int primary key,
partnumber varchar(20),
quantity int,
quantity_completed int
)
Each row in the machines table represents a machine in the factory. Each machine has an ID number with three letters and two numbers. The location column is a four letter code representing different places in the factory. The current_job_id indicates what job the machine is currently running.
The jobs table is a list of these jobs. The item that is being made on that job is indicated by the partnumber column. The quantity and quantity_completed fields are how much needs to be made on that job, and how much has been made so far.
3. Write an SQL query that lists all machines located in location 'TOOL'
4. Write a query which returns all fully completed jobs for partnumbers beginning with 'H'.
5. Write another query that returns all machines that are running jobs for the partnumber 'P15/125'.
Visual Basic
Here is a template for a function that returns the number of occurrences of the character C in the string S:
Public Function CharacterCount(S as String, C as String) As Integer
...
End Function
>>1
I have completely no fucking idea about SQL (since i don't know SQL anyway) but VB is ridiculously easy.
Seriously.
(in C)
size_t youregay(const char *fuck, int c) {
size_t ret = 0;
while(*fuck != 0)
if(*fuck++ == c) ++ret;
return ret;
}
as you see, it's only 4 lines of code.
5 lines in C means the task is ultra simple
(could be hacked to 2 lines)
for(size_t ret = 0; *fuck; ret += *fuck++ == c);
return ret;
i mean, seriously.
FizzBuzz should be enough for detecting bullshitting. This test is too time-consuming for large groups of candidates and still too easy to let some serious asshatters through.
>>4 for(size_t ret = 0; *fuck; ret += *fuck++ == c); return ret;
That particular interview would end with a brief ``GTFO''.
Name:
Anonymous2007-09-07 11:13 ID:uaFBb2M3
>>9
Last time I used it was to interview just five computer science graduates who all claimed to know VB and SQL. Only one of them answered the VB question correctly. She got most of the SQL ones right too. (However, we unfortunately didn't hire her because of work permit complications.)
As for the others, one of them could just about answer it in Java, and three didn't have any idea at all - couldn't even describe an algorithm. And none managed the SQL past the first question. Useless fuckers.
Name:
Anonymous2007-09-07 11:20 ID:r4gGgXpQ
>>10
``Computer science graduates''? Which ``college'' they went to?
I wouldn't care much about them not knowing VB. Picking up such a basic (no pun indended) language would take about two days for a decent programmer (though apparently the javafag wasn't that great).
They all listed proficiency at VB and SQL on their CVs, so I expected them to be able to answer most of the questions.
Ok, most of them bullshitted about those particular skills - but the fact that they couldn't even describe a general algorithm for such a simple problem was the real shocker.
Also, after fucking up the test and being told the interview was over, one guy insisted on bringing out a laptop he'd brought with him and showing me that he could paint forms in Visual Studio, and make a message box say HELLO. I lol'd.
Name:
Anonymous2007-09-07 11:57 ID:zscjbnFu
Way too easy, but then I don't know what kind of EXPERT FAGGOTS might apply for your jobs.
>>9
so you don't like good code? i feel sorry for ya.
infact, it's not pure C
pure C would be
size_t ret;
for(ret = 0; *fuck; ret += *fuck++ == c)
;
return ret;
infact, im tired of all ye wankers, i wouldn't work for a shitfuck that hands me over such `test' to `check' me.
I'd just laught at him and tell him to look for some CS major twat, not EXPERT PROGRAMMERS like myself
you fucking cunts
Name:
Anonymous2007-09-07 12:01 ID:bwdi6nja
1. select order_number from orders where status < 6 and year(date_required) = 2004 order by order_number
2. select count(*) from orders where status = 8
3. select * from machines where location = 'TOOL'
4. select * from jobs where partnumber like 'H%' and quantity = quantity_completed
5. select m.* from machines m join jobs j on m.current_job_id = j.job_id where j.partnumber = 'P15/125'
6. Public Function CharacterCount(S as String, C as String) As Integer
For n = 1 to Len(S)
If Mid(S, n, 1) = C Then
CharacterCount = CharacterCount + 1
End If
Next
End Function
Welcome to the world of enterprise scalable turnkey synergy
Name:
Anonymous2007-09-07 13:44 ID:dndMa7nI
>>10
Why don't you make it more language agnostic?
Most EXPERT PROGRAMMERS probably don't know VB but can learn easily and quickly. You are shooting yourself in the foot if you test applicants for VB experience -- only the true morons and DeVry graduates will come in with knowledge of how to program in VB.
Give them fizzbuzz and let them do it in whatever language they want. Make them step through designing an algorithm to solve some problem.
Fuck, I got hired on to my current job with absolutely no Java experience... I was able to convince them I'm a quick study. Don't advertise you want VB programmers or the morons will come out of the woodwork.
>>21
That's actually some pretty sound advice. Some blawger said a while ago something like: ``If you need a team of good Java programmers, ask for Smalltalk programmers.'' That actually makes sense: everyone `knows' Java, but when you meet someone who has used Smalltalk, you can be pretty sure that he really understands OOP, and the rest is just dragging him to the level of mental retardation necessary to write Java.
Name:
Anonymous2007-09-07 14:18 ID:uaFBb2M3
>>19
Common usage dictates that it's quite common for an "Order Number" to contain more than just numbers, just look at any random selection of invoices and delivery notes. Perhaps I should have called it order_code or something. But I was writing the test to determine their knowledge of basic SQL, not how needlessly pedantic they are on English usage.
And what's wrong with varchar primary keys? If it's the column that uniquely identifies a row, then of course I'm going to make it the primary key.
>>22
Yep. I have friends who "know" Java -- enough to perform whatever shitty tasks got them through their "CS classes"
If you are forced to use the lowest denominator, don't advertise it.
Name:
Anonymous2007-09-07 16:48 ID:saQl9h+Y
My friends who "know" Java actually know this: they have a vague idea of class and method names somewhat related to what they want to do, so they Google for them and copypasta it into their code. Occassionally, they write some "glue" (enterprise fap-word) which consists of some kind of Java java = new Java() type things.
>>26
That's why it's vitally important to administer tests like >>1, to weed out the EXPERT COPYPASTAFAGS
Name:
Anonymous2007-09-07 16:53 ID:E+hACWEt
>>19
General rule of thumb: "If you're not going to do math with it, make it a string/character/etc..."
Name:
Anonymous2007-09-07 17:57 ID:R/O7USTu
>>28
What? Do you even know what a primary key is?
Name:
Anonymous2007-09-07 19:12 ID:saQl9h+Y
>>19 Why the fuck is "order_number" defined as a varchar type?
"Web designer" programming there
Name:
Anonymous2007-09-07 23:18 ID:xzcB44I2
1.
select
order_number
from
orders
where
status < 6
and year(date_required) = 2004
order by order_number asc;
2.
select
count(order_number)
from
orders
where
status = 8;
3.
select
machine_id
from
machines
where
location = 'TOOL';
4.
select
job_id
from
jobs
where
quantity_completed = quantity
and partnumber like 'H%';
5.
select
m.machine_id
from
machine m,
jobs j
where
j.partnumber = 'P15/125'
and j.quantity_completed = j.quantity;
6.
Public Function CharacterCount(S as String, C as String) as Integer
Dim current_count as Integer
current_count = 0
Dim position as Integer
For position = 0 to Len(S) - 1
If Mid(S, position, 1) = C Then
current_count = current_count + 1
End If
Next position
CharacterCount = current_count
End Function
The reason the SQL is all split up like that is because back when I was writing some apps that used SQL, I found it was a lot easier to add columns, tables and conditions if they were all on separate lines.
And I haven't touched VB in years. I'm assuming Option Explicit because coding without it is a friggin' nightmare.