× 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.



On Wed, 2016-06-29 at 18:49 -0400, Vinay Gavankar wrote:
As many have pointed out, there would be couple of questions like whether
to include numbers, or what to do with one letter words, and whether the
distinct is case sensitive (A/a are distinct or not).

Without actually dealing with the test set in the OP...

Would that, the "definition" of what constitutes alphabetic, not be
better left until till later in such a way that it can be changed
simply?

For example: (not real code)

AlphaChars = "AaBbCbDd....

For loop
if subst(DataToDoStuffTo,loop,1) = scan(AlphaChars);
Do stuff.
endif
end loop

The point being that some clarification is not required to solve the
problem - what is an alphabetic character; and at other times it is -
what is meant by "leave it in the same place", what about "words" that
are less than 3 chars...

I guess the issue is what this test is trying to prove to the
questioner, (1) is it to show that the programmer is thinking what
happens down the road by using a constant to store the alphabetic
characters which gives flexibility...

(2) Is the test trying to show that they can code "logically" (do A, do
B, do C = result)

(3) Is it trying to show they noticed that the result is not a compound
of the 3 parts, but is instead solved only by doing the 3'rd part as it
overwrites everything before it, with comments showing that part 1 and 2
are not required because they are thrown away and its actually a
"gotcha" question.

(4) Is it trying to show they understand the question is logically
incorrect or has short comings and can't be solved without further
input/clarification.

(5) Perhaps its trying to show the knowledge of op-codes.

I guess depending on which response is given, above, it shows various
things from - long time coder who has had to trawl through "clever" code
before, to some one who is a code cutter, to someone that will ask for
clarification when needed to resolve the problem, or someone who can see
the question makes no sense or that there is a short cut because parts
of the question are redundant.

I'll be honest, I hate that kind of question... its trying to be clever
or trying to trip up the interviewee and I'd much prefer a real world
problem such as "here is code, its broken, fix it" or "have you ever
used journals?" instead of "how do you prevent corruption of data during
a power cut?" and expect me to guess they are trying to get me to
mention journals when there are other possibilities such as UPS.

I also hate the type of questions that are designed to show you know
every op-code and its structure and all the F spec column positions off
by heart when thanks to PC's, PDF's, multiple monitors/windows, and the
internet, if there is something I don't know - I can look it up on the
fly.



I think the important question would be whether actual code is to be
written or pseudo-code?

I think one would require couple of hours of testing to come up with
bug-free code.

Vinay

On Wed, Jun 29, 2016 at 6:38 PM, Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx>
wrote:

Actually I didn't find it to be so ambiguous - maybe it's just Wednesday
here!

Yes, there are no methods in RPG - except as you specify those in a Java
object. <g>. But I do enough "interpreting" of things that I'd have written
a program - not even a subprocedure, maybe.

Everything is an opportunity to ask a question, as we already need to with
business users to clarify requirements such as this. My main issue is, are
numbers included in "alphabetic" - probably.

I didn't see anything about "exactly like the input" - I took it to say,
the non-alpha things immediately follow the transformed version of each
"word".

So now that I've insulted everyone, please, this is just one person who is
even somewhat intrigued by the exercise.

Cheers
Vern


On 6/29/2016 4:39 PM, Monnier, Gary wrote:

There is some ambiguous wording to be sure.

Distinct does not necessarily mean non-repeating, for example. I suspect
the first question is to test whether the applicant thinks in sql terms.

Question 2 seems to be, as you point out in your answer, to be a trick
question. You might ask: Determine the number of words in the string
A 6 pack does not necessarily refer to a stomach you #$%^$##$@#$
moron

Question 3 lacks context. If the output string is to be exactly like the
input string, everything in the output string should be in their original
relative location.

I agree with your assessment that management has been bamboozled by
someone who enjoys ambiguity and quite possibly obtuseness.


Thanks,
Gary Monnier
IT Software Engineer CSM, CSPO




-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Craig
Pelkie
Sent: Wednesday, June 29, 2016 1:11 PM
To: RPG400-L@xxxxxxxxxxxx
Subject: Interview question

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


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.