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.
---
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];
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: