14 comments

[ 3.0 ms ] story [ 31.7 ms ] thread
I think these types of questions would be closer to real life programming if they had to be done in an IDE and included tests to check your solution.
In my, once upon a time, programming job, I think we wrote about two or three times as much test code as actual code. Coming from a math background instead of actual programming, that was my biggest surprise.
The percentage of test code required depends on the language. The stronger the typing and the more statically verified it is, the less testing is required. The total "correctness code" is basically the same, but it's moved from dynamically run tests into the compiler, which statically verifies the rules.
At wethinkcode.co.za (A non-profit coding academy in South Africa) that's exactly how exercises and projects are done. Students are encouraged to add more tests than we provide initially, but grading is done by running the provided tests.

Disclosure: I work on curriculum matters for WeThinkCode_. I like the exercise in the article and I'll be proposing we add it to the Java curriculum. I'd be surprised (and not in a good way) if the majority of our students fail to make it work.

> I think these types of questions would be closer to real life programming if they had to be done in an IDE and included tests to check your solution.

You're contradicting yourself. In real life you're not given the tests that you must pass. So which one is it? Do you think it should be closer to real life, or do you think you should be given tests? I get the sense the real answer is you'd just want interviews to be easier.

(comment deleted)
(comment deleted)
When I did my A-Level (UK exams taken at the end of 16-18) Computing exam, this is pretty much along the lines of what they did.

Program source was released a month before the exam, to allow students to familiarise themselves with it, and the exam then gave a series of questions/modifications the students had to make (I think ours was based on a pack of cards, so we had to implement a shuffle algo, and a take x from top of deck, etc).

One twitter comment points out that this was the last free-response question on the exam, and that a preceding question was harder than usual. So examinees probably wasted too much time on the earlier question and lacked time to finish the last question. It doesn’t mean the last question was particularly hard.

(The twitter comment: https://twitter.com/m_litv/status/1670144278708748292)

Also, the problem should state whether the candy grid is stored row-major or column-major: is it `box[row][column]` or `box[column][row]`? As far as I can tell, that detail isn’t specified.

I don’t understand Slashdot.

I see links to people talking about the solution but I can’t see the question despite the title saying “this question”.

I would have expected a post like this to copy and paste the problem.

(comment deleted)
I think this is fine. I took this test without taking the class. I was not a well established programmer. I just grinded the textbook. I hadn’t ever actually done anything in Java when I took the test.

This class is many students’ first introduction to programming unlike other AP courses which are an advanced level of something they have already seen to various extents.

Writing out the code by hand, which can involve nested loops and must be syntactically correct, is pretty hard. Especially after a very long test beforehand. To be honest, I don’t think I really understood what an API was until I was forced to use a provided one on the test. I was utterly burned out by the end of it.

I thought it was a good class, test, and curriculum

Reading the way questions are worded in that exam makes me want to take back most of the negative things I've said about requires handed to me by Product Managers over the past 25 years.