Take this test...

SpookyWriter

Banned
Joined
Nov 14, 2005
Messages
9,697
Reaction score
3,458
Location
Dublin
It is for a job and I already know the answer, but won't take the test until tomorrow morning.

So do you fine folks have to go through this to get a job? I interview with the Mayo Clinic Monday. I just hope they don't ask me to operate on some poor fool.

---
University of X [name deleted] Online
T-SQL QE Test​
Triangles can be classified three different ways by their sides:

An equilateral triangle is a triangle with all three sides of equal length.
An isosceles triangle is a triangle with any two sides of equal length.
A scalene triangle is a triangle with no two sides equal

In this test, you will be working with the [triangle] table which has three columns: [side_a], [side_b] and [side_c]. These columns represent the three sides of a triangle.

Write a user-defined function or stored procedure that will read all rows out of this table and output to a different table of your own creation. This new table should be structured to indicate the values for equilateral, isosceles and scalene that your function/procedure returns.

2. Write a separate user-defined function or stored procedure to adequately test your code by inserting values to the triangle table, executing the code in step 1, reading the output from the output table and validating the output to the expected values. ** You should make sure that your tests comprehensively test your functions/procedures from step 1.

Take about one hour for this exercise. We’d rather have something incomplete that compiles and runs rather than something that you tried to be comprehensive on and couldn’t get working. Please be prepared to discuss what you would have added or done differently if you had had more time. Feel free to use books or web sites as references.

If you are taking this test remotely, please send us back the DDL for your new table, the package containing your code and the package to test your code.

Here is the DDL for creating the triangle table:

if exists(select 1 from sysobjects where id = object_id(N'dbo.TRIANGLE'))
drop table dbo.TRIANGLE;
create table dbo.TRIANGLE
(
[id] int identity(1,1) not null primary key,
side_a smallint not null,
side_b smallint not null,
side_c smallint not null
) on [PRIMARY];
 
Last edited:

dclary

Unabashed Mercenary
Poetry Book Collaborator
Requiescat In Pace
Registered
Joined
Oct 17, 2005
Messages
13,050
Reaction score
3,524
Age
55
Website
www.trumpstump2016.com
LOL, nice test.

Would take about 15 minutes to write.


Just tell me you're not using a cursor.
 

clockwork

In the zone...
Kind Benefactor
Super Member
Registered
Joined
Mar 25, 2005
Messages
4,735
Reaction score
1,797
Location
Aphelion
Website
redzonefilm.net
Three is a magic number,
Yes it is, it's a magic number.
Somewhere in this ancient, mystic trinity
We got three as a magic number.

The past and the present and the future.
Faith and Hope and Charity
The heart and the brain and the body
Give you three
As a magic number.

It takes three legs to make a tri-pod.
Or to make a table stand.
It takes three wheels to make a vehicle
Called a tricycle.

Every triangle has three corners.
Every triangle has three sides.
No more, no less.
You don't have to guess.
When it's three and you can see
It's a magic number.

A man and a woman had a little baby.
Yes, they did.
They had three in the family.
And that's a magic number.

3-6-9, 12-15-18, 21-24-27, 30.
3-6-9, 12-15-18, 21-24-27, 30.

Now the multiples of three come up three times in each set of ten.
In the first ten you get 3-6-9
And in the teens ten you get 12, 15 and 18
And in the twenties you get 21, 24, 27 and it comes out even on 30.

Now multiply backwards from three times ten:

Three time ten is (30), three times nine is (27),
Three times eight is (24), three times seven is (21),
Three times six is 18, three times five is 15,
Three times four is 12,
And three times three is 9, and three times two is 6,
And three times one is 3, of course.

3-6-9
12-15-18
21-24-27. . .30

Now multiply from 3 times 10.
Three time ten is (30) three times nine is (27),
Three times eight is (24), three times seven is (21),
Three times six is 18, three times five is 15,
Three times four is 12,
And three times three is 9, and three times two is 6,
And three times one...
What is it?
3!
And that's a magic number.

A man and a woman had a little baby.
Yes, they did.
They had three in the family.
That's a magic number.

I hope that helps.
 

SpookyWriter

Banned
Joined
Nov 14, 2005
Messages
9,697
Reaction score
3,458
Location
Dublin
dclary said:
LOL, nice test.

Would take about 15 minutes to write.


Just tell me you're not using a cursor.
Nope. I have a magic wand. These people send me a test which in online and the answer is also easily available. Errr...Obviously they want me to pass. I just hate it when they make SAT's so fricken easy.

I may write a Mc'd proc and let them figure it out later.
 

dclary

Unabashed Mercenary
Poetry Book Collaborator
Requiescat In Pace
Registered
Joined
Oct 17, 2005
Messages
13,050
Reaction score
3,524
Age
55
Website
www.trumpstump2016.com
SpookyWriter said:
Nope. I have a magic wand. These people send me a test which in online and the answer is also easily available. Errr...Obviously they want me to pass. I just hate it when they make SAT's so fricken easy.

I may write a Mc'd proc and let them figure it out later.

Actually... THIS would be funny:

1.
The object comments have been encrypted.


2.
The object comments have been encrypted.
 

SpookyWriter

Banned
Joined
Nov 14, 2005
Messages
9,697
Reaction score
3,458
Location
Dublin
clock_work9 said:
Three is a magic number,
Yes it is, it's a magic number.
Somewhere in this ancient, mystic trinity
We got three as a magic number.

The past and the present and the future.
Faith and Hope and Charity
The heart and the brain and the body
Give you three
As a magic number.

It takes three legs to make a tri-pod.
Or to make a table stand.
It takes three wheels to make a vehicle
Called a tricycle.

Every triangle has three corners.
Every triangle has three sides.
No more, no less.
You don't have to guess.
When it's three and you can see
It's a magic number.

A man and a woman had a little baby.
Yes, they did.
They had three in the family.
And that's a magic number.

3-6-9, 12-15-18, 21-24-27, 30.
3-6-9, 12-15-18, 21-24-27, 30.

Now the multiples of three come up three times in each set of ten.
In the first ten you get 3-6-9
And in the teens ten you get 12, 15 and 18
And in the twenties you get 21, 24, 27 and it comes out even on 30.

Now multiply backwards from three times ten:

Three time ten is (30), three times nine is (27),
Three times eight is (24), three times seven is (21),
Three times six is 18, three times five is 15,
Three times four is 12,
And three times three is 9, and three times two is 6,
And three times one is 3, of course.

3-6-9
12-15-18
21-24-27. . .30

Now multiply from 3 times 10.
Three time ten is (30) three times nine is (27),
Three times eight is (24), three times seven is (21),
Three times six is 18, three times five is 15,
Three times four is 12,
And three times three is 9, and three times two is 6,
And three times one...
What is it?
3!
And that's a magic number.

A man and a woman had a little baby.
Yes, they did.
They had three in the family.
That's a magic number.

I hope that helps.
Yes, it did help. Thanks. I am now ready to submit this answer and cross my fingers and toes. Do you think I have a shot at the big one?

There was once a monkey name Spunky who couldn't eat unless the food was funky.
 

SpookyWriter

Banned
Joined
Nov 14, 2005
Messages
9,697
Reaction score
3,458
Location
Dublin
jbal said:
On vd tests, "positive" doesn't mean you passed.
True, but it doesn't mean you've failed until your penis falls off. Right?
 
Last edited:

clockwork

In the zone...
Kind Benefactor
Super Member
Registered
Joined
Mar 25, 2005
Messages
4,735
Reaction score
1,797
Location
Aphelion
Website
redzonefilm.net
SpookyWriter said:
Yes, it did help. Thanks. I am now ready to submit this answer and cross my fingers and toes. Do you think I have a shot at the big one?

There was once a monkey name Spunky who couldn't eat unless the food was funky.

We'll see. I submitted that answer too. May the best man win.
 

TrainofThought

A flowering bud of bitchiness
Super Member
Registered
Joined
Jul 7, 2006
Messages
6,179
Reaction score
6,835
Location
Land of Bier
Website
www.authordenisebaer.com
You lost me at "It is for a job..."

Are you still on the road Spooky, or are you sitting outside a Wifi coffee shop? Either way, nice to see you posting again, and I hope you refer to my traveling tips along the way.
 

robeiae

Touch and go
Kind Benefactor
Super Member
Registered
Joined
Mar 18, 2005
Messages
46,262
Reaction score
9,912
Location
on the Seven Bridges Road
Website
thepondsofhappenstance.com
If I were you Spooky, I'd point out that the three classifications of triangles are wholly incorrect, except in Euclidean space--which wasn't specified anywhere in the instructions. Nothing worse than pseudo-intellectuals...
 

SpookyWriter

Banned
Joined
Nov 14, 2005
Messages
9,697
Reaction score
3,458
Location
Dublin
expatbrat said:
I couldn't even understand the question.

Errrk - you can have it. I'll stick with Personal Training and Swim Coaching. And occasionally (very occasionally) adding to my WIP.
But the job pays very good money...
 

expatbrat

Look what we made:
Super Member
Registered
Joined
Sep 20, 2005
Messages
745
Reaction score
239
Location
Aussie living in Pattaya, Thailand
Website
www.expatbrat.com
Writing doesn't seem to. Well - not thus far anyway. Hubs has a photo of a 5 million baht boat stuck on the fridge, he reckons he'll be able to get the boat once my book is out.

So cute he believe in it so strongly. I'll get him a nice inflatable boat one day.
 

aadams73

A Work in Progress
Super Member
Registered
Joined
Feb 12, 2005
Messages
9,901
Reaction score
6,428
Location
Oregon
Is this one of those idiot tests? Because I now suspect I'm an idiot. I didn't even understand the question.

I'm going to go and drool on myself now.