× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



A recruiter friend of mine sent me the following. My reply to him is
included below. Any thoughts?



Craig Pelkie



--------------------------

Begin message sent to me:



I am working with a large IBM i client and they are giving my candidates a
programming quiz that everyone is failing. I am wondering how difficult
this quiz is or is there some trick that everyone is missing in reading the
instruction. Could you please look at the instructions below and let me
know your thoughts? Is this something everyone should know or is it really
so difficult that only 5% of Developers would be able to get this?



Problem Solving Exercises
In the RPG programming language, write a method that modifies a string using

the following rules:

1. Each word in the input string is replaced with the following:
the first letter of the word, the count of distinct letters between the
first and last letter, and the last letter of the word. For
example, "Automotive" would be replaced by "A6e".

2. A "word" is defined as a sequence of alphabetic characters, delimited by
any non-alphabetic characters.

3. Any non-alphabetic character in the input string should appear in the
output string in its original relative location.

Thanks for your time.



--------------------------

Begin my reply:



I am sorry to say that you have fully and completely pressed my ?contempt?
button with this question. That is, this is perhaps the worst ?programming
exercise? I have seen for RPG.



Immediate problems:



1. What constitutes a ?letter?, what constitutes a ?non-alphabetic?
character? Is ?a? and ?A? the same letter, or different? I assume that a
blank space is a ?non-alphabetic? character. What about characters like ???,
?!?, ?#?, ?$?, ?(?, ?)? and so on. Are those counted as ?distinct letters?
or are they ?non-alphabetic? characters? What about numerals 0-9? Is this
limited to U.S. English EBCDIC, or do non-US English characters need to be
taken into consideration? What about characters like ñ, does that count as
?n? or a separate character?

2. What should be done for sequences of ?alphabetic characters? that
are only one or two characters long? Examples: ?I?, ?my?, ?37?, ?#$? how
should those be dealt with?

3. For Item 3, give an example. What happens if the string is
?1no#yes?, or something like that? Does the leading ?1? count as alphabetic
or non-alpha?



It looks like this client has a ?genius? RPG programmer who has successfully
managed to bamboozle the management with bulls..t. This is the type of
question that you see in college programming courses.



Far more relevant would be things like this:



1. You are presented with a working RPG program that has a subroutine
of 2000 lines, with nested DO/IF constructs to a depth of 20 levels. There
is a bug somewhere within the routine that you need to track down and fix.
Describe some techniques you would use to identify the bug, make a fix, and
test that the fix does not cause additional errors.

2. Discuss the role of ?refactoring? when working with existing code.

3. Demonstrate examples of how to define RPG procedures, including
procedures that return a single value (example: return an integer),
procedures that return no value, and procedures that need to return more
than one value. Demonstrate how to code procedure parameters, including a
no-parameter procedure, procedure with one parameter, required vs. optional
parameters.

4. You need to add a feature to a program where all 99 of the numeric
indicators (*IN01 - *IN99) have already been used. The program does not use
subprocedures, it uses subroutines (so everything has global scope). The
feature that you need to add will control a field on a display file, for
which you will need to use at least 2 indicators to set display attribute
values. Discuss how you would add the feature to the program. The program is
written in RPG/400 and cannot be converted to ILE RPG.

5. For Q4, the program is written in ILE RPG. Discuss how to add the
feature, given the same constraints (all 99 indicators already in use).



(manager) at (client) had the best ?interview? question I?ve encountered
yet: he sent me a small but non-trivial program that they needed a fix to,
and had me work on it to create the fix. That was much more realistic than
this misguided attempt to judge programming aptitude.



My suggested questions (1-5) above are actually based on code I?ve worked on
at (client). I think it is far more realistic to test an RPG candidate based
on their ability to deal with legacy code than to test for brain-twisters,
just so the tester can gloat about their superior solution. I would hate to
have to work on code that the person who came up with this created, it is
probably full of ?tricks? that are done more for personal
self-aggrandizement rather than for clearly solving business problems.



Craig




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.