DSPRelated.com
Forums

Imbecility

Started by Vladimir Vassilevsky December 2, 2010
 From 10 people interviewed for the job of a programmer, as many as 8 
can't write a program to find a maximum element in an array. One of 
those who failed had a fresh PhD diploma.

VLV







On 12/02/2010 12:17 PM, Vladimir Vassilevsky wrote:
> > From 10 people interviewed for the job of a programmer, as many as 8 > can't write a program to find a maximum element in an array. One of > those who failed had a fresh PhD diploma.
Personal experience? Recent? A former co-worker of mine used to give people the task of reversing the order of a string. She came out of one interview barely able to contain an emotion that was 10% amusement, 10% dismay, and 80% amazement. Her victim had responded by scratching his head and muttering "I don't know, but I think it has something to do with recursion". So I wrote her a string reversal routine that used recursion. It was easy, as long as you didn't visualize what happened to the stack. // Find the maximum of an array #include <iostream> using namespace::std; float test_array[] = {-1, 1, 101, 99, 84, 42, 33, -3.14159, -100}; #define DIM(x) (sizeof(x) / sizeof(x[0])) static float find_max(float array[], int size); int main(void) { cout << "array maximum is "; cout << find_max(test_array, DIM(test_array)) << endl; } float find_max(float array[], int size) { if (size == 1) return array[1]; // else float last_max = find_max(array + 1, size - 1); if (last_max > array[1]) return last_max; // else return array[1]; } So, do I get the job? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
On 12/2/2010 12:17 PM, Vladimir Vassilevsky wrote:
> > From 10 people interviewed for the job of a programmer, as many as 8 > can't write a program to find a maximum element in an array. One of > those who failed had a fresh PhD diploma. > > VLV >
Good lord, tell me about it. I interviewed a guy the other week who couldn't even tell me what his own code did. The state of computer programming is shockingly dismal. It's no wonder so little software works. And, just to keep an idea of what's going, Microsoft released the following statement regarding their new Windows Phone 7 OS. "Microsoft is committed to delivering regular updates to the Windows Phone experience. Our first update will make copy & paste available in early 2011." -- Rob Gaddi, Highland Technology Email address is currently out of order
On Dec 2, 3:17&#4294967295;pm, Vladimir Vassilevsky <nos...@nowhere.com> wrote:
> &#4294967295;From 10 people interviewed for the job of a programmer, as many as 8 > can't write a program to find a maximum element in an array. One of > those who failed had a fresh PhD diploma. > > VLV
Vlad, It is truly amazing how many fail to posess basic skills. A friend and former neighbor of mine has a company that makes custom cut metal picture frames. On the back of the job application, applicants are asked to draw three lines: one each of three inches, two and one half inches and four and one eighth inches long. The applicants are provided standard rulers. More than half of the applicants (and a high school diploma is a necessary requirement) are unable to read a ruler and properly draw the lines. Cutting and measuring is needed for the job. I think you are seeing the results of many programmers using code generators and never actually learning basic algorithms and writing code. It would be interesting to see the dissertation of the freshly minted PhD to see what he actually did to "earn" his PhD. Was it in something computer related or underwater basketweaving? Clay
On Dec 2, 4:08&#4294967295;pm, Rob Gaddi <rga...@technologyhighland.com> wrote:
> On 12/2/2010 12:17 PM, Vladimir Vassilevsky wrote: > > > > > &#4294967295;From 10 people interviewed for the job of a programmer, as many as 8 > > can't write a program to find a maximum element in an array. One of > > those who failed had a fresh PhD diploma. > > > VLV > > Good lord, tell me about it. &#4294967295;I interviewed a guy the other week who > couldn't even tell me what his own code did.
Guilty! I remember an interview once where I had gotten to the head of the company. He asked me to recount how I solved a very difficult problem, why it was difficult and how I went about solving it. I immediately remembered an FPGA design I had done a year or two earlier where I had to sync an interface to a processor that ran between 2 MHz and 32 MHz, both sides of the speed of the other half of the interface. It was only after I told him of this, smiling a bit proudly that I realized I was having a mental block on the details. I couldn't even remember exactly why this had been so difficult to make work. Needless to say, I didn't get an offer. I don't think I ever went back to the design to recall exactly what was special about it either. Maybe I didn't want to disappoint myself with an ordinary design that I had inflated in my mind...
> The state of computer programming is shockingly dismal. &#4294967295;It's no wonder > so little software works. &#4294967295;And, just to keep an idea of what's going, > Microsoft released the following statement regarding their new Windows > Phone 7 OS. > > "Microsoft is committed to delivering regular updates to the Windows > Phone experience. Our first update will make copy & paste available in > early 2011."
Cool... what??? Is that using a mouse? Rick
On 12/2/2010 1:23 PM, rickman wrote:
> On Dec 2, 4:08 pm, Rob Gaddi<rga...@technologyhighland.com> wrote: >> On 12/2/2010 12:17 PM, Vladimir Vassilevsky wrote: >> >> >> >>> From 10 people interviewed for the job of a programmer, as many as 8 >>> can't write a program to find a maximum element in an array. One of >>> those who failed had a fresh PhD diploma. >> >>> VLV >> >> Good lord, tell me about it. I interviewed a guy the other week who >> couldn't even tell me what his own code did. > > Guilty! I remember an interview once where I had gotten to the head > of the company. He asked me to recount how I solved a very difficult > problem, why it was difficult and how I went about solving it. I > immediately remembered an FPGA design I had done a year or two earlier > where I had to sync an interface to a processor that ran between 2 MHz > and 32 MHz, both sides of the speed of the other half of the > interface. It was only after I told him of this, smiling a bit > proudly that I realized I was having a mental block on the details. I > couldn't even remember exactly why this had been so difficult to make > work. Needless to say, I didn't get an offer. I don't think I ever > went back to the design to recall exactly what was special about it > either. Maybe I didn't want to disappoint myself with an ordinary > design that I had inflated in my mind... > > >> The state of computer programming is shockingly dismal. It's no wonder >> so little software works. And, just to keep an idea of what's going, >> Microsoft released the following statement regarding their new Windows >> Phone 7 OS. >> >> "Microsoft is committed to delivering regular updates to the Windows >> Phone experience. Our first update will make copy& paste available in >> early 2011." > > Cool... what??? Is that using a mouse? > > Rick
It was the code he had emailed me as sample work. I handed it to him on a printout. -- Rob Gaddi, Highland Technology Email address is currently out of order
On Dec 2, 1:17&#4294967295;pm, Vladimir Vassilevsky <nos...@nowhere.com> wrote:
> &#4294967295;From 10 people interviewed for the job of a programmer, as many as 8 > can't write a program to find a maximum element in an array. One of > those who failed had a fresh PhD diploma. > > VLV
Do you mean at all, or an optimized algorithm? In other words, they couldn't even write a brute-force script? This makes me feel wonderful about my personal job security. Bryan
rickman <gnuarm@gmail.com> wrote:
(snip)

> I immediately remembered an FPGA design I had done a year or two earlier > where I had to sync an interface to a processor that ran between 2 MHz > and 32 MHz, both sides of the speed of the other half of the > interface.
Reminds me of the Commodore 64, which shipped with the schematic in the users manual. (I believe rare, even for the time.) With only a few seconds look, you could see what they had done during the design. There is one part on the lower left (including the processor) and another on the upper right (including the video generator) and a PLL in the middle. The processor is phase locked to some (strange) multiple of the video frequency, such that beats aren't visible in the display. Most likely, initially they weren't phase locked and the display looked bad. -- glen
On Dec 2, 4:44&#4294967295;pm, Bryan <bryan.p...@gmail.com> wrote:
> On Dec 2, 1:17&#4294967295;pm, Vladimir Vassilevsky <nos...@nowhere.com> wrote: > > > &#4294967295;From 10 people interviewed for the job of a programmer, as many as 8 > > can't write a program to find a maximum element in an array. One of > > those who failed had a fresh PhD diploma. > > > VLV > > Do you mean at all, or an optimized algorithm? In other words, they > couldn't even write a brute-force script? > > This makes me feel wonderful about my personal job security. > > Bryan
Ok, at risk of sounding totally dumb, what optimization is there for this algorithm? Isn't it just a matter of initializing a current "best" to the first element in the array, then starting at the next element checking if this is larger. If the array elment is largest it is saved as the current "best" and the process is repeated for the rest of the array. If the index is also needed, that has to be initialized and saved as well. I don't know of any way to optimize this. Perhaps you are thinking of sorting which is more computationally complex and has many variations of efficiency. Rick
On Dec 2, 5:36&#4294967295;pm, rickman <gnu...@gmail.com> wrote:
> On Dec 2, 4:44&#4294967295;pm, Bryan <bryan.p...@gmail.com> wrote: > > > On Dec 2, 1:17&#4294967295;pm, Vladimir Vassilevsky <nos...@nowhere.com> wrote: > > > > &#4294967295;From 10 people interviewed for the job of a programmer, as many as 8 > > > can't write a program to find a maximum element in an array. One of > > > those who failed had a fresh PhD diploma. > > > > VLV > > > Do you mean at all, or an optimized algorithm? In other words, they > > couldn't even write a brute-force script? > > > This makes me feel wonderful about my personal job security. > > > Bryan > > Ok, at risk of sounding totally dumb, what optimization is there for > this algorithm? &#4294967295;Isn't it just a matter of initializing a current > "best" to the first element in the array, then starting at the next > element checking if this is larger. &#4294967295;If the array elment is largest it > is saved as the current "best" and the process is repeated for the > rest of the array. &#4294967295;If the index is also needed, that has to be > initialized and saved as well. > > I don't know of any way to optimize this. &#4294967295;Perhaps you are thinking of > sorting which is more computationally complex and has many variations > of efficiency. > > Rick
Yes, that's true. O(N), with N being the number of array elements, is the lowest order of computational complexity if the elements are randomly arranged. I suppose I should have proposed my question better: was there any pattern to the elements such that you were trying to goad the applicants to find an optimized search algorithm, or was it simply a random array where the aforementioned "algorithm" was all Vladimir was looking for. I just assumed since it was a question proposed by the famed Vladimir Vassilevsky that it had to be more complex than that :) Bryan