Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pattern problem. 4

Status
Not open for further replies.

mmerlinn

Programmer
May 20, 2005
745
US
[tt]I notice that this forum has been dead for almost a year.

Today I was thinking (yeah, I know, DANGEROUS) about a simple test that could be given to prospective coders to determine how well they can visualize and code on the fly. The following is what I think would separate real coders from the rest of the pack.

Let's see some code for the following problem:

0123456789
9876543210
1234567890

Using the above three lines as a pattern, write code that will output the above lines and all following lines until the pattern repeats. Hint: This pattern will repeat starting with the 21st line.

Everything you need to know is posted above. There should be no reason for me to answer any questions. And, yes, this is deliberately minimal to test two things. First, how well a coder can recognize patterns. And, second, how well a coder can write code to output those patterns.

I spent about 10 minutes before I could visualize how to code this. Then I spent 20 more minutes writing/debugging C++ code to solve this problem. I am a FoxPro programmer, but chose C++ because I have about 3 HOURS total experience in C++ coding. I did not try FoxPro, but I assume that the time would be comparable.

Later I will post my C++ code for comparison purposes. I may even give stars to code that I think is exceptional (assuming that I understand your coding language).[/tt]

mmerlinn


Poor people do not hire employees. If you soak the rich, who are you going to work for?

"We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding. Answering questions for careless and sloppy thinkers is not rewarding." - Eric Raymond
 
Having seen a few database developers in action, the best ones (I think) are the ones who keep on calmly asking what the point of the database is, what the users are trying to do, and how they currently do it, until both sides have agreed expectations. This often involves the users learning quite a lot about their own job, and realising that their data and working practices are quite different to what they thought! It takes considerable interpersonal skills as well as a good ability to combine overview of a complex problem with understanding of its nitty-gritty detail; an ability to observe and understand current approaches, but not be limited by them unnecessarily. I don't think many people can do it.

You know I couldn't agree more, and not just with database design. I've lost track of how many jobs that were totally different to how the managers described it once you get to understand what the users are actually doing.

And most user do not know WHAT they are doing, they just know how it's done from their perspective and what they need it to do for them.

One hour of asking the right questions is often worth several days of rewriting code.


Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
As a telecoms engineer I can agree fully with all of that
often you get given requests for operation that are not the best way for the new system to operate.
The jsutification from the customer is always "Thats the way the old system did it". Often they have forgioten how much that complained obout that particular method of operation when the old system was installed :)

The goal should always be give the customer what they really want, not necessarily what they ask for. This can only be achieved by talking with them to find out what the end result should & then confirm the new process before starting.

Once the receptionist learns she can do her job faster with less effort the battle is won :)

A Maintenance contract is essential, not a Luxury.
Do things on the cheap & it will cost you dear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top