High School AP CS A Exam Takers Struggled Again With Java Array Question 159
theodp writes: As with last year," tweeted College Board's AP Program Chief Trevor Packer, "the most challenging free-response question on this year's AP Computer Science A exam was Q4 on 2D Array." While it takes six pages of the AP CS A exam document [PDF] to ask question 4 (of 4), the ask of students essentially boils down to using Java to move from the current location in a 2-D grid to either immediately below or to the right of that location based on which neighbor contains the lesser value, and adding the value at that location to a total (suggested Java solution, alternative Excel VBA solution). Much like rules of the children's game Pop-O-Matic Trouble, moves are subject to the constraint that you cannot move to the right or ahead if it takes you to an invalid position (beyond the grid dimensions).
Ironically, many of the AP CS A students who struggled with the grid coding problem were likely exposed by their schools from kindergarten on to more than a decade's worth of annual Hour of Code tutorials that focused on the concepts of using code to move about in 2-D grids. The move-up-down-left-right tutorials promoted by schools came from tech-backed nonprofit Code.org and its tech giant partners and have been taught over the years by the likes of Bill Gates, Mark Zuckerberg, and President Obama, as well as characters from Star Wars, Disney Princess movies, and Microsoft Minecraft.
The news of American high school students struggling again with fairly straightforward coding problems after a year-long course of instruction comes not only as tech companies and tech-tied nonprofits lobby state lawmakers to pass bills making CS a high school graduation requirement in the US, but also as a new report from King's College urges lawmakers and educators to address a stark decline in the number of UK students studying computing at secondary school, which is blamed on the replacement of more approachable ICT (Information and Communications Technology) courses with more rigorous computer science courses in 2013 (a switch pushed by Google and Microsoft), which it notes students have perceived as too difficult and avoided taking.
Ironically, many of the AP CS A students who struggled with the grid coding problem were likely exposed by their schools from kindergarten on to more than a decade's worth of annual Hour of Code tutorials that focused on the concepts of using code to move about in 2-D grids. The move-up-down-left-right tutorials promoted by schools came from tech-backed nonprofit Code.org and its tech giant partners and have been taught over the years by the likes of Bill Gates, Mark Zuckerberg, and President Obama, as well as characters from Star Wars, Disney Princess movies, and Microsoft Minecraft.
The news of American high school students struggling again with fairly straightforward coding problems after a year-long course of instruction comes not only as tech companies and tech-tied nonprofits lobby state lawmakers to pass bills making CS a high school graduation requirement in the US, but also as a new report from King's College urges lawmakers and educators to address a stark decline in the number of UK students studying computing at secondary school, which is blamed on the replacement of more approachable ICT (Information and Communications Technology) courses with more rigorous computer science courses in 2013 (a switch pushed by Google and Microsoft), which it notes students have perceived as too difficult and avoided taking.
Computer programming is not for everyone (Score:5, Insightful)
Seems like computer programming and logic just clicks for some people, and it becomes intuitive and natural. For others it will never be. You can teach CS to every student all you want but you'll never change that. When I was working at a uni, as CS started to become more popular for income-potential reasons, I saw more students take CS who had never so much as looked at a computer before. Some of these students did find that they had the natural inclination for it and did as well as the students who had been programming since they were children. But a lot of students just really struggled and never did figure it out, despite years of intense courses. Sadly many of these students did go onto graduate and go out into industry where I suspect many of them hit a brick wall and regretted majoring in CS.
Re: (Score:2)
Re: (Score:2)
What current market? More than 50% of all job postings are fake [fake is a strong word but they have no realistic possibility of being filled] and that is across all industries. Tech is far far worse. It used to just be internal hire with mandatory posting requirements but now managers use interviews to and tech evals to pad hours and seem productive or they post jobs to make the overworked team think help is coming then 'they pulled my req! Now I'll have to wait for the new budget' later they get some fres
Re: Computer programming is not for everyone (Score:2)
Job boards are and always have been a crap shoot, for both you and the potential employer. While that's how I've been hired for most jobs I've gotten, when I've been on the other side of it I've always noticed that we get our best through word of mouth. We get literally tens of thousands of resumes daily and if we're lucky there might be one worth calling back.
Job boards are a bit like soliciting roommates on craigslist -- buyer beware. In fact if you're looking for a place to rent, a lot of the best deals
Re: (Score:2)
What current market? More than 50% of all job postings are fake [fake is a strong word but they have no realistic possibility of being filled] and that is across all industries.
But if they didn't have unfillable positions, how would they convince the government to allow them to bring in H1Bs?
Re: (Score:2)
Computer programming is something anyone can do.
But following a software specification is a skill. And depending on personality, the work can be enjoyable or torture. So doing this stuff as a career isn't for everyone.
Re: Computer programming is not for everyone (Score:3)
Re:Computer programming is not for everyone (Score:5, Informative)
IQ is a real thing
Re: (Score:3)
But is it even IQ related?
Take other somewhat niche things taught in school. How many of us ever get past drawing essentially stick figures into still life to portraits to masterpieces? How many of us get past being able to play Itsy Bitsy Spider on the piano to playing Mozart's 5th by memory? Why would being able to see the way code works and be able to come up with imaginative solutions to a coding problem be any different?
Re: (Score:2)
Why don't all high IQ people become the CEO of some F500 company? Because there is a myriad of skills that will determine your path in life.
But almost none of those factors affect your ability to learn to code, directly. However, IQ will. There is pretty much zero chance someone with 100 IQ is going to be writing complicated functional programming. But someone that can't keep a conversation, has no friends, and
Re: (Score:3)
the fact we have found a way to test for intellectual ability.
Except we haven't. It's been acknowledged for decades now that IQ tests are flawed.
You can do your own Google search for "IQ test flaws", but one of the more hilarious study results found that people scored higher on IQ tests if they were offered money for scoring higher. A $10 reward upped the IQ test results by 20 points.
Re: (Score:2)
Sorry I couldn't find the study where they show that paying people increases motivation and care for a task, so obviously giving people random IQ tests with no consequences but then adding a consequence made them perform better (it's not like anyone said it's impossible to coast and put little effort into a test, did they?), but I'll take
Re: (Score:2)
But almost none of those factors affect your ability to learn to code, directly. However, IQ will. There is pretty much zero chance someone with 100 IQ is going to be writing complicated functional programming. But someone that can't keep a conversation, has no friends, and is scared to go outside can learn to code just fine.
Dude, I write software for a living, and even I don't want to deal with functional programming. :-D
All I can think about is the joke about the Russian spy who stole a bunch of nuclear missile launcher source code. He got back to the Kremlin and said, "Well, we got part of it, but we only got the last two pages, so all we can tell you is that it was written in LISP." He then presented a page full of "))))))))))))))))".
Re: (Score:2)
Contrary to popular belief, there is not a single test that is THE "IQ Test." There are various tests that attempt to measure cognitive abilities for different reasons. The first IQ tests were designed to flag people with mental disabilities before they entered military service. Those are very different tests than ones intended to evaluate people with extraordinary abilities. Tests given to children or those who do not speak a language in which a heavily verbal test is written will be different from ones gi
Re: (Score:2)
Seems like computer programming and logic just clicks for some people, and it becomes intuitive and natural. For others it will never be. You can teach CS to every student all you want but you'll never change that. When I was working at a uni, as CS started to become more popular for income-potential reasons, I saw more students take CS who had never so much as looked at a computer before. Some of these students did find that they had the natural inclination for it and did as well as the students who had been programming since they were children. But a lot of students just really struggled and never did figure it out, despite years of intense courses. Sadly many of these students did go onto graduate and go out into industry where I suspect many of them hit a brick wall and regretted majoring in CS.
Yep, a very common tale. People chase what is popular or what they THINK is going to make them money in the future when they head off to college, without a great deal of actual thought placed into it. This is at least somewhat reasonable from the student, considering the age and (more importantly) maturity level many students matriculate to college are at, but their parents and advisors should absolutely know better.
Most people are not suited either by personality or by interest for jobs in highly technical
Re: (Score:2)
"But a lot of students just really struggled and never did figure it out, despite years of intense courses."
This is my experience not just in programming but in technology in general. Some people just have a brain that works for these kind of tasks and problems and some don't. I've been involved in hiring and no shortage of training. I've seen no correlation between degrees and ability though some areas do align better with an academic structure; most technology practice is more akin to the process of self-
Re: (Score:2)
Seems like computer programming and logic just clicks for some people, and it becomes intuitive and natural. For others it will never be.
Nonsense. I sometimes teach AP CS at a local private school. I have been able to maintain a 100% pass rate despite it being a one semester course open to students with no prior programming experience. I've found that programming "clicks" for even the dullest student inside two weeks.
Programming isn't some mystical art that can only be taught to the elect. It's a skill that anyone can learn with a little effort. I often say that the learning curve is steep, but also very short. Once it "clicks" for the
Re: (Score:2)
Yes it's true that institutions have really struggled in this regard over the years. That's because until the last couple of decades, CS was full of students who already knew how to code; they learned it on their own as children. CS was all about teaching the mathematical principles needed to actually do creative things with the coding that the kids already knew how to do. At that time CS was not about teaching coding. In fact in many of my classes at uni, we'd be exposed to a new language that we were ju
Re: (Score:2)
By "statistics" I mean a basic, functional understanding of the mathematical field of statistics.
Re: (Score:2)
until the last couple of decades, CS was full of students who already knew how to code; they learned it on their own as children.
I took AP CS in 1991-2. The class used Turbo Pascal back then. Most of us had never used Pascal, but all of us had experience in BASIC.
I don't remember the teacher teaching anything. Everybody just worked independently. We had textbooks, but of course no World Wide Web.
I didn't take the AP test, but I'm sure everyone in that class could have passed. We were all nerds who, as you say, had been programming on our TI-99/4As and Atari 800XLs for a decade.
Re: (Score:2, Interesting)
"and MOST people aren't good programmers"
This is why letting coders restructure all our technology to utilize code based definitions and be custom apps was and still is a horrible idea.
Re: (Score:2)
"and MOST people aren't good programmers"
This is why letting coders restructure all our technology to utilize code based definitions and be custom apps was and still is a horrible idea.
What's the alternative? AI and hallucinations? When you're building systems that have to do the right thing, you do not want some LLM deciding that there's a safe driving path right through a bus full of nuns.
Re: (Score:2)
MOST people aren't good programmers
I never took CS, and I'm entirely self-taught, so maybe there's something going on here that I'm not getting and only a CS major would, but the first thing they present in the question is this:
public class Location
{
private int theRow;
private int theCol;
public Location(int r, int c)
{
theRow = r;
Re: (Score:2)
It's more a Java thing there (which is the language the AP class uses). Professionally you'd see the same sort of thing with Java code. The big reason is Java doesn't have properties so if you define location.x and then want to update that to calculate the x/y spread or something when you write to location.x, then you need to make a function setX(int newX) which means you have to change everything that uses that class which in enterprise Java is a big no-no.
Most other languages provide properties so you c
Re: Computer programming is not for everyone (Score:2)
It's been a few years since I touched java, but can't you simply make theRow and theCol public? Then you can just get and mutate without needing getters and setters.
Re: (Score:2)
Re: (Score:2)
But this is what I meant when I said these aren't going to be misused. Location is only constructed by the helper methods of the GridPath class. Nothing takes Location as an input, it's only constructed as an output. Even if the user of the class modifies it to set invalid values, so what? It's not like it'll break any assumptions made anywhere else. Presumably if they mutate it, they're doing something else with it that isn't even relevant to GridPath. If you were writing this into a library, all this does
Teaching issue, I'd guess (Score:5, Interesting)
Re: (Score:2)
The teacher who posted the example linked in the summary also got it wrong on his first try.
Re: (Score:2)
Re: (Score:3)
using Integer.MAX_VALUE was a weird approach to begin with. also, once he had established the new locations he should use those instead of computing them all over again for no reason, which introduces unnecessary error chance, duplicates logic, fails to reuse the given api and even compromises single source of truth. (eg "grid[row + 1][col]" should be "grid[belowLoc.getRow()][belowLoc.getCol()]).
not only didn't he run his own code, he shouldn't be teaching coding to begin with. which explains part of the i
Re: (Score:2)
Re: (Score:2)
Yeah, and most people with strong CS skills are going to be doing software for a living rather than teaching high school. At many high schools, the AP CS teacher may not know the subject themselves before being told to teach it. Students will just have to figure it out from the written materials.
Not the greatest question (Score:5, Insightful)
Re: Not the greatest question (Score:3)
Re: (Score:2)
This absolutely test's a student's ability to code in the real world! The real world is made up of product managers who can't think clearly or properly explain themselves. btw. Don't ever ask "What is the big picture? What are you ACTUALLY trying to do."
The question isn't hard. It does take a careful read to understand how they want these functions to work. The problem doesn't link back to any obvious real world application. It's a puzzle.
Re: (Score:2)
It isn't hard, but it is a bad question. It was written terribly, then formatted terribly. If a product manager was ever as equally bad as this question, I'd smack them upside the head because they're a shitty product manager.
Re: (Score:2)
Re: (Score:2)
Mostly middle of the road. Not quite bad enough for me to think they're completely stupid and useless thus deserve a smacking. But still not super great at explaining what they need/want.
Re: (Score:2)
Re: (Score:2)
Re: Not the greatest question (Score:2)
Speaking of being careful: tests, not test's.
Re: (Score:2)
If you haven't written a bunch of OO code as a high schooler I could see someone getting tripped up with the class definitions and terminology.
They've taken an AP CS course. If they're not familiar with the terminology, I have to wonder what they were doing for an entire semester.
Difficulty (Score:2)
Matrices are hard to wrap your head around in abstraction. You need a practical example to get how it all works. I was iffy on the topic until I had to write some DSP code. I agonized through it until I realized I was basically re-creating a FFT, at which point I imported fftw and kept going, but I finally understood how matrices work.
Re: (Score:2)
Re: (Score:2)
While you can represent a matrix with a 2d array, 2d arrays are a separate, far simpler, concept.
as we used to say (tongue in cheek) (Score:2)
Re: (Score:2)
Re: (Score:2)
If you build someone a fire, they will be warm for that night.
If you set someone on fire they'll be warm for the rest of their life.
Re: (Score:2)
This again? (Score:5, Insightful)
Re: This again? (Score:2)
This is what I came to post. In addition to it being the last question, the actual distribution of scores (particularly 4â(TM)s and 5â(TM)s) is pretty good compared to many of the other AP exams. So maybe this exam is working as intended.
Re: (Score:2)
It couldn't possibly be because it's the last question on the test, and most test-takers answer questions in order.
Rather than trying to teach a bunch of random students CS, it would probably have been better to teach them how to effectively take tests.
Rule 1: Read the whole test before trying to answer any questions. This has at least two advantages: You can answer the questions from easiest to hardest, so you'll always get credit for the easy questions before you run out of time. Also, there are often clues to help jog your memory with earlier answers in the text of the later questions.
Re: (Score:2)
It couldn't possibly be because it's the last question on the test, and most test-takers answer questions in order.
Not really relevant. Tests are designed to be done by the class often with time to spare. If you didn't finish a test, you weren't good at a subject. If you got stuck on an early question and ran out of time, you're not good at any subjects.
Re: (Score:2)
There are a lot of reasons why someone might get stuck early that doesn't mean they don't know the subject matter. Some people just freeze up in testing environments due to nervousness. Others have difficulty with performing in a room full of people. Others are capable of completing the task but need more time to do it. Time pressure may help in separating the students who can perform effortlessly from those who possess less mastery, but it's not the only way to do so. Make the test sufficiently difficult a
Re: (Score:2)
Back in 1994 when I was a senior in HS, I had to write a sorting algorithm from scratch (having never been taught sorting algorithms). Mine was pretty bad. Took about a half
appalling (Score:3)
What's appalling is the suggested solution (and that it took more than one attempt). If that's considered good code, it's no surprise production code is so bad today. Teach our students to suck at programming.
Honorable mention for terribleness is the definition of the interfaces themselves. Why can't nextLoc be called for any valid element of the array? LOL
Re: (Score:2)
There are some things I don't like about the code. The repeated calls to
Re: (Score:2)
grid.length and grid[0].length are not calls, but fetches of values from a field in an array object, I assume. Moreover, because these are native objects, I assume the bytecode compiler is really good at dealing with them efficiently.
I don't know that grid.length is going to be any less efficient than assigning it somewhere to a field in the underlying object (whatever object all these methods sit in) and then fetching it from that field.
grid[0].length is a bit less efficient because you have one more level
Re: (Score:2)
Yeah I didn't like the creation of the two location objects either but when the teacher first tried to optimize them away, he created a bug, so I guess he decided that correct with e
Re: (Score:2)
> Why is the suggested code terrible? It doesn't look awful to me.
Its pretty bad, with a "precondition" that is mysteriously complex and invariably going to result in invalid Location construction, which will not throw an error at the right point because its numerically stable.
The entire problem design is bad, and the solution worse.
Part of the blame can be laid on Java, which is statically types and object oriented, both of which serve as rocket fuel for suck in this problem definition and that hideousl
Re: (Score:2)
Re: (Score:2)
Am I missing something, or does getNextLoc() return basically value that is out of bounds if you ask the value of nextloc at bottom right corner? I mean, it doesn't return null or any other indication that there *is* a NextLoc...
(Not that even validates inputs)
Re: (Score:2)
It's not a bad test question, though. There's only a limited amount of time in a test environment, so IMO extraneous factors should be cut out as much as they can, leaving more time to focus on the actual goal of the question.
I don't think they should have to show how to use a text editor/IDE or invoke javac in their answer, either, even though those are quite important. :-)
If the goal is to test the student's ability to traverse arrays given a set of rules, it's pretty good -- tests the concept, while bei
Re: (Score:2)
If that's considered good code, it's no surprise production code is so bad today.
No one was asked to produce good code. They were asked to produce working code for the question. You're asking way too much from a highschool student.
Re: (Score:2)
Wow. You sound like a real asshole.
I'd have to look it up and test it. (Score:3)
And would likely get one or two things wrong until it would fit.
Big fat hairy deal. The last time I "paper coded" was in Sharps Basic, sometime in the late 80ies. Hopping through a 2D array and comparing and adding values is trivial, that doesn't mean that most devs would get it right on one try if they had to write code on paper or type it out in a plain text area by heart without the ability to test things. Especially when under time pressure and hopping through different progging details and subjects by the minute.
I've been programming for 38 years and have been doing professional development for 24 years and I still regularly look up basic stuff, especially when hopping around in different PLs.
These results are way less dramatic than they sound and say little to nothing about any individual learners eventual ability to code. That's my strong assumption anyway.
Re: (Score:2)
Re: (Score:2)
This shows the real problem with moden programming (Score:4, Interesting)
I can honestly see people struggling with the question, not because it's difficult, because they can't think of some pure abstracted OOP way to solve it. Don't worry about the optimized solution, worry about a solution, then optimize it. People waste way too much time trying to be smart, instead of just solving the problem.
Re:This shows the real problem with moden programm (Score:5, Funny)
I've been in those meetings. "Why did you do X?" is usually followed by the rectangle-head middle manager screaming something about team players and bursting into tears. Then they fire everyone right before Christmas.
Re: (Score:2)
Sounds like Java is the problem with its bizarre way of using classes as namespace, leading folks to shoe-horn all sorts of programming techniques into a less-than-ideal object-oriented structure. Java has really messed with generations of programmers now.
Re: (Score:3)
why are we still playing Trouble? (Score:2)
Why are people still playing Trouble, Sorry, Ludo, and Parcheesi? All these Pachisi style games are an absolute dog's dinner of a game mechanic. It's been 3000 years, time to move on. Also let's get rid of Snakes and Ladders too. That game was to made to teach children how life is unfair and that will have no choices, just karma.
Don't Worry (Score:4, Interesting)
Even if you get that answer right in a job interview, you won't get hired.
Right Disney?
Re: (Score:2)
This sounds like there's a story behind it? Care to share a link?
Just stop (Score:4, Insightful)
Stop equating variables to "buckets" that contain information within the computer for starters. Get actual computer programmers to teach programming classes instead of repurposed math teachers or teachers that show a "heightened" awareness of computer concepts in general.
Re: (Score:2)
Get actual computer programmers to teach programming classes instead
Please no. Highschool programming should be basic application of logic, nothing more. Math teachers are good at that. Leave the actual programming to university rather than boring the heck out of poor kids before they even finish school.
Good god, this question makes my head spin (Score:3, Informative)
Imagine using the word neighbor then redefining it implicitly to mean right or down. And then using y, x. And then demanding a class is return class instead of a tuplet. Or writing this question in 4 pages instead of 1 paragraph. And having it serve no useful purpose.
This just tests your ability to tolerate nonsense spinning in your head. And then do it on a piece of paper? Tf?
Re: (Score:3)
Neighbor is a poor term. They are really talking about the next step in the path. The only allowed steps are down and right. The question may have been *worded* poorly but the *picture* was more than good enough to understand the problem and build a solution.
Re: (Score:2)
Does java demand you write accessors for variables?
I guess my takeaway was-- this question is exactly in the format my brain hates-- really long descriptions for very simple things, with enough confusion that I end up getting focused on reconciling why I shouldn't. As in, I would end up off my footing just by that use of the word neighbor.
Perhaps it was also the most missed question because it was last?
Anyway thanks for your reply--- really surprised about the tuple thing
Why Java? Bad language. Rust is better (Score:2, Offtopic)
Re: (Score:2)
Because it's universal and easy to setup regardless of which OS you are on. C and JS are garbage especially as an introductory language (and JS is usually covered in web development classes - though there are no AP versions that I'm aware of). Python wouldn't be terrible but isn't great for GUIs. Rust would be interesting, but it's too relatively new for AP testing. Go (it's just Go, not GOlang) is like Python in that it isn't great for GUIs. Plus, if using a Google language, it would be better to go with D
Re: (Score:2)
Re: (Score:2)
Never said good, but it does make it the better choice still. C# is about the only other language that would make sense to switch to, realistically, but Java is still easier for all parties.
Re: (Score:2)
Python isn't great for GUIs? Have you used Qt?
Re: (Score:2)
Re: (Score:2)
Good grief. Rust. Of course.
Rust is a terrible first language, I reckon. It's designed to solve some very hard problems you get with native languages when you want to them to run fast, and with complex fine grained multi threading and don't want to trip over yourself.
It's counterproductive to teach the machinery round that before people have grasped the basics.
Re: (Score:2)
Java is verbose, error prone, slow computer language. Python, C or JavaScript would be good. I would like Rust or GOlang to be taught.
Nah, I think they should use perl - just because it'd drive the people responsible for grading the tests insane.
It's the last question of the exam (Score:2)
Doesn't it make sense that if people run out of time for the exam, that question is the most likely to remain unsolved?
pen and paper programming (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
On the other hand, "write an algorithm that generates popular music," or "increase social media engagement" don't have well-understood underlying p
Re: (Score:2)
I think the kind of questions on a AP CS test should be of the nature that can be well specified though.
Tongue in cheek, it might be fun to include one question that is not properly specified to see if the students can spot it and respond appropriately - eg. give an answer that clearly states both the problem and the solution in less that 50 words including a car analogy and using only units of football fields, school busses and libraries of congress
Languages (Score:2)
Since the problem involves matrices, maybe APL would be useful to solve it.
Not necessarily surprising (Score:2)
I teach CS at $LOCAL_UNIVERSITY and I am not massively surprised. From where I sit, there are probably a few effects at play:
Lots of students one care about the exam as long as it makes the grade they are looking for. I have had students leave exams mid way telling me "now I know I'll get C in the class and that's what I need for the credits to be counted so who care".
You see a lot of "I want a CS degree but I don't want to program"; so they don't feel like they need to be able to handle the more complex qu
To be honest it greatly depends on the version (Score:2)
While older versions of Java from the 1990s still have fairly traditional syntax, since 2000 it adopted a more unique syntax as shown here:
http://p-nand-q.com/programmin... [p-nand-q.com]
Well... (Score:2)
Illustrates why this shouldn't be pushed so hard.. (Score:2)
Big tech companies have a vested interest in getting as many people interested in coding as possible, so the number of qualified applicants means they can hire people for less money.
In reality? Programming is something the vast majority of people have no interest in doing and take no pleasure in doing. I was one of those kids who grew up with the first 8-bit home computers (Timex Sinclair 1000 to start with), and learned to code in BASIC because that's essentially "what you did" with them. (At the very leas