oops...continued from above:
}
}
Main Topics
Browse All TopicsI have been asked to come up with a few simple test questions for programmers.
In this case for .NET and C# but the examples I am working on should work in any language since they are more about common programming problems and solutions than any particular language or framework.
I have produced one here (http://www.mindmesh.net/m
I have some questions that I just know you lizards will be able to help me with.
Constructive criticism only please.
1) Do you think this is any good ?
2) How much harder do you think this would be if I removed the diagrams (i.e. without any visualisation aids) ? Do you think it would be a fair/fairer/more relevant test without these ?
3) If the question did not have the diagrams or the snippets of code do you think the average programmer would still be able to understand it well enough to answer it ?
4) I have solutions for this. If you have time, I would be interested to see what different solutions people come up with and how different they are in both general approach and implementation.
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If you are a good .NET developer (an I mean GOOD!) and you are in New York contact Greg Brill at InfusionDev. They are always on the look out for good people. In fact Greg is offering appartments rent free for one year to entice good devlopers to come work for him in New York.
http://www.infusiondev.com
The optimisatoin I have is only small it just saves the if clause you used and means you dont have to iterate through all values from 0 -9 in your inner loop.
for (int y = 0; y < 10; y++)
{
for (int x = y + 1; x < 10; x++)
{
int n = matrix[x, y];
matrix[x, y] = matrix[y, x];
matrix[y, x] = n;
}
}
Interesting. I considered something else along those lines originally...except I kept the if clause. I considered:
for(int x = 1; x < 10; x++)
instead of:
for(int x = 0; x < 10; x++)
...to save iterating the inner loop for x value 0. In the end I decided against it, though, because while it may be more efficient in terms of execution time, I think it loses something in terms of readability and intuitiveness. I like your optimization, though.
Thanks for the tip, as well. I will contact Greg this week.
Business Accounts
Answer for Membership
by: cheddar73Posted on 2007-06-02 at 07:42:52ID: 19200720
1) It's not bad. However, I've encountered interview questions like this, and as an interviewee I generally found them quite annoying. I understand the point is to test basic problem solving skills and the ability to create a (semi-)complex algorithm, but as a job candidate it bugged me that so much time was spent in the interview process on tasks that really had very little to do with the actual job (writing database access code, designing and implementing classes, etc etc). I also know people who have used questions like this as part of the interview process, and they have let some very good programmers walk out the door because they didn't do so well on the interviewer's contrived scenarios.
2) Without the diagram, there is not enough information to do question 1. You say "write the code to populate this matrix." That doesn't tell how you want it populated. For example, the diagram in question 2 is also populated with the numbers 0 to 99, but that's not what you're looking for in question 1. Without the diagram, though, the matrix in question 2 meets the criteria for question 1.
3) I think you could lose the snippets of code and the average programmer would (or at least should) know what you mean. I will say, though, that I was confused for a minute about question 2. I had to read the question three times before I realized that the diagram in question 2 was what you wanted as the end result...i.e., it's the matrix from question 1 transformed. At first I thought it was the starting matrix for a new question...as in...here's another matrix, now transform it according to these instructions.
4) Question 1
int [,] matrix = new int[10,10];
for(int x = 0; x < 10; x++)
{
for(int y = 0; y < 10; y++)
{
matrix[x,y] = x * 10 + y;
}
}
Question 2
for(int x = 0; x < 10; x++)
{
for(int y = 0; y < 10; y++)
{
if(x > y)
{
int n = matrix[x,y];
matrix[x,y] = matrix[y,x];
matrix[y,x] = n;
}