Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming Education

34% of AP CS Students Couldn't Solve This Java-Based 2D Array Question 226

96,000 American students took this year's [Java-based] AP Computer Science A test. And more than a third — a full 34% — missed question #4.

It asks test-takers to write two methods for the class BoxOfCandy — one that moves a Candy object to the first row (of a column), and one that finds and returns a Candy object of a specfic flavor, removing it from the box.

Long-time Slashdot reader theodp shares some thoughts: - "If 34% of students are not getting any points, it's a test question problem, not a student one," argued one commenter on Twitter. [Question 4 is 5-pages long.]

- Here's a stab at an Excel VBA solution to Question 4 for comparison-to-Java purposes. It's a little bit clunkier due to how VBA functions return results compared to Java, but it's still pretty concise and allows code to be easily tested and results to be easily visualized using the 2D Excel worksheet grid.

- AI-powered Bing refuses to provide the answer to the question that completely eluded 32,000+ AP CS A exam takers ("I'm sorry but I cannot provide you with the answer to that question. It is not ethical to share the answers to an exam question". [But] it does tip one off to a suggested Java solution for Q4 that can be found in A+ Computer Science's 2023 AP CS A Exam Review.

This discussion has been archived. No new comments can be posted.

34% of AP CS Students Couldn't Solve This Java-Based 2D Array Question

Comments Filter:
  • ... just returned "Life is like a box of chocolates."

    • by fermion ( 181285 )
      I suspect that AP CS teachers learned from ChatGPT.

      Every year there are truly horrible AP teachers who cry because thier student got every question correct but still only got a 5. This is ok for a history or English teachers, they likely have no math ability, but not for science, math or computers..

      For those of us who design good tests and understand the AP exam know that some students will randomly get questions correct, and many tests are designed to have very difficult questions, not only for benchma

      • Long-time Slashdot reader theodp shares some thoughts: - "If 34% of students are not getting any points, it's a test question problem, not a student one," argued one commenter on Twitter. [Question 4 is 5-pages long.]

        I think the Twitter commenter is wrong, that 34% of students, some 32K students, can't answer a particular question, there is another, more likely possibility - "There's a problem with some of the instructors."

        (We can't blame the kids generally or the test specifically, since 2/3rds of students got the question right.)

        I wonder how many AP Computer Science teachers actually ever studied Computer Science at the collegiate level?

        I bet if you dig a bit deeper you'll find many of those 32K students had instruct

        • by alvinrod ( 889928 ) on Monday June 26, 2023 @11:21AM (#63633908)
          If you have a question that 100% of students will get correct it's probably too easy. Any question that 0% of students get wrong is too hard and just as useless. If you aren't asking any questions that some individuals may get wrong the test is pretty useless.

          A lot of the college courses I took would have a few questions like this because the professor wanted something to distinguish between the A and B students who were going to get all of the other questions correct.
          • If you have a question that 100% of students will get correct it's probably too easy.

            Agreed.

            Any question that 0% of students get wrong is too hard and just as useless.

            Syntax error.

      • by imidan ( 559239 ) on Monday June 26, 2023 @03:38AM (#63632782)

        Some years ago, I was asked by a high school teacher friend whether I might have interest in coming to the school part-time and teaching CS. I looked in to the idea, and in discussions with the principal, they wanted someone to teach AP CS if they taught any CS. So I looked at the AP CS materials. In the end, I didn't think the AP CS curriculum was well designed. Having been a (pretty good) college instructor, I have some understanding of what works and what doesn't. I thought the AP CS curriculum was a little light on learning to program and had too much emphasis on topics like ethics (i.e., hacking is bad), intellectual property rights, piracy, and other topics that seemed tilted toward industry propaganda rather than useful education.

        I know the curriculum has changed a lot since I looked at it, but given how it was and how I understand it has been shaped since then, it's not surprising to me that 1/3 of the students were unable to correctly answer a question that should be pretty simple to do in Java.

    • Your comment about VBA programmers reminds me of a programming contest I entered in university back in 1984... or 1983? I'm old. I have no concept of time anymore.

      Anyway, there were no rules on language. All that mattered was to produce a working program that provided the correct answer to the problem in the shortest time. Most of the teams wanted to show off their grasp of the predominant language being taught at the time, which was COBOL. A couple of the more engineering-oriented students went to their de

  • Based on the snippet provided, this seems remarkably trivial. Is there some catch to this question I'm not seeing or something?

    • by theodp ( 442580 ) on Sunday June 25, 2023 @08:53PM (#63632218)

      I imagine some may have had problems fully understanding the 5-page question (which can also be a challenge for some Advent of Code problems!). It'd be interesting to know how many of the 34% who got a 0 on Q4 are also in the 33% who failed to get a passing score (3+) on the exam.

      • I would disagree that the complaint that it is a "5 page question". The initial background setup including listing code is 1 page. The first part of the question (a) is 2 pages including code snippets, instructions, and pictures, The second part of the question (b) is also 2 pages but again includes code snippets, instructions, and pictures. Frankly if CS students cannot get through 5 pages, then the real world is going to be rough.

        As a real world example, I had to sort through more than a million rows of d

    • Most of the hard work is presented in the question. It requires some patience to methodically go through all the very nice test cases to work out what is needed it be written. My recommendation, which is almost universal in these sorts of exams, is to read the entire question before attempting to answer it.

    • by kenh ( 9056 ) on Sunday June 25, 2023 @10:37PM (#63632410) Homepage Journal

      Just to point out the obvious, 66% of students taking the test got it right.

      Is there a reason to think EVERY AP student should get EVERY question right on the exam, meaning the sheer fact that that 1/3rd missed it means the exam is at fault?

      Oh, and what was the point of saying ChatGPT "couldn't" answer the question? It's not because the question was so hard, it's because ChatGPT has been programmed to avoid answering exam questions!

      This is a nothing story, really. Two-thirds of students got a particular question right, one-third didn't - maybe it's just a hard question, maybe the textbooks didn't adequately prepare the students to answer this question?

      • by edwdig ( 47888 )

        Is there a reason to think EVERY AP student should get EVERY question right on the exam, meaning the sheer fact that that 1/3rd missed it means the exam is at fault?

        This is a nothing story, really. Two-thirds of students got a particular question right, one-third didn't - maybe it's just a hard question, maybe the textbooks didn't adequately prepare the students to answer this question?

        You almost had it. There are certainly questions that are intended to be hard, which you would expect a lot of students to get wrong. But this is a fairly easy one.

        When a large percent of students get an easy question wrong, it usually means the problem isn't with the students. It helps to ask why they got it wrong so you can have a better test next year.

        • Uh, it's not necessarily a problem with the test either. It could be a fault of the curriculum. If every question was designed so that 90% of the students get it right, unless the test is aimed at broad sampling it will be useless to determine who the brightest students are because so many people would get 100%. You might as well make it a Pass/Fail exam.
           

          • by edwdig ( 47888 )

            Right, bad test results can be because of bad curriculum design.

            The AP tests aren't trying to figure out who the brightest students are. The intention is to figure out if they learned enough of the subject matter to earn college credits.

            They're not pass fail because AP isn't giving out the college credit. The credit is awarded by the school the student eventually goes to. Some subjects offer multiple test levels, and individual colleges structure their curriculum differently. The tests are graded out of 5.

    • Comment removed based on user account deletion
    • It seems like the question fell victim to two things:
      1. The question is longer than the answer. English is so imprecise that it becomes difficult to accurately understand the question under pressure. There are so many ways that it is possible to code roughly the same thing, that it is very easy to miss a subtle detail. For this question, there are lots of details.
      2. Last question on a time-limited test.

  • by 93 Escort Wagon ( 326346 ) on Sunday June 25, 2023 @08:29PM (#63632162)

    AP Computer Science confirms it!

    • Comment removed based on user account deletion
      • Why, 2/3rds of students correctly answered question #4, maybe we don't blame the test, maybe we take a look at the teachers and/or the study materials used?

    • Java is not computer science. Should ask them to solve the problem in any language they want. When I took Computer Science and Engineering, and when I graded for it, and when I taught it, the language was just something on the side, a tool. The tests were not about the language. Of course, assignments they had plenty of time to learn it.

  • Java just isn't the best choice to test CS.

    Java isn't bad but it's too finicky for learning CS.

    I don't need to scope class variables to show you I grok an algorithm. Boilerplate is antithetical to clarity.

    Use in industry is different but look at these sample answers. I like OOP but goddamn.
    Several languages would be much more appropriate.

    public boolean moveCandyToFirstRow( int col )
    {
    if( box[0][col] != null )
    return true;
    for( int r = 1; r < box.length; r++ )
    {
    if( box[r][col] != null )
    {
    box[0][col]=box[r][c

    • English isn't so great either. But at some point we have to draw the line and pick a language that is well represented in both industry and academics, that has a relatively stable standards body, and is capable of demonstrating many different concepts necessary for neophytes to learn. I don't consider verbose versus concise to be a high priority metric, as in industry we face both languages that are more or less verbose than Java. Most are less verbose than Java, some are borderline inscrutable in their con

    • by NFN_NLN ( 633283 )

      I don't recall the details of java...
      - Is there some exception that needs to be handled if "int col" is greater than the # of actual columns?
      - Also what happens if you call .getFlavor() on null?

      • by NFN_NLN ( 633283 )

        I guess you could have a pre-check on (a) to return false if col > than actual col.
        Same for (b), a pre-check on flavor and return null if they pass in null.

      • The instructions indicate that calls will always meet preconditions, and this one states that "col is a valid column index in box"

      • Calling something on null causes a NullPointerException - obviously.
        Accessing an array out of its bounds causes an ArrayOutOfBoundsException - obviously.

        But both exceptions you do not handle, the indicate a bug, so you let them explode into your face: obviously.

        If the compiler can ensure that the indices never are out of bounds, it optimizes the checks away.

      • I believe that how the code written by the student handles both is probably part of the test.

    • by jonwil ( 467024 )

      What's a better pick for this than Java? C#? C++? Basic? Pascal? C?

      • Re:Java (Score:4, Funny)

        by NFN_NLN ( 633283 ) on Sunday June 25, 2023 @09:44PM (#63632348)

        First day on slashdot? The answer is Rust... it's always Rust. :)

      • Just about any "demonstrate simple algorithm" problem is better in python.
      • by narcc ( 412956 )

        As it happens, I often teach AP CS at a local private school. Given the topics it covers, Java is fine.

        If the curriculum was up to me, and I needed to pick a programming language for some reason, I'd probably go with C. Of course, I was a CS student back in the days before every program mutated into a glorified programming bootcamp. Kids these days need to go to grad school these days to even hear about topics covered in my intro course. I guess that's what happens when you treat colleges like trade sch

    • I read the question and neither of your methods do what they say given the examples. For `moveCandyToFirstRow` they say that the function can end up in 1 of 2 states and your function works deterministically and only produce the first example.

      For `removeNextByFlavor` - they say that calling their implementation of function with the parameter "lime" would result in row 1 cell 3 being chosen, but if you're starting at the beginning the "lime" instance at 0,0 would be the first one and if you started at the e

      • For `removeNextByFlavor` - they say that calling their implementation of function with the parameter "lime" would result in row 1 cell 3 being chosen, but if you're starting at the beginning the "lime" instance at 0,0 would be the first one and if you started at the end and counted backwards, the instance at 2,4 would be the first one. If you think I'm crazy or stupid, look at their own examples. It's confusing as hell and I totally understand why students would miss the question.

        Why would you ignore the pictures and instructions provided by the question and re-index an array then blame the question for being "confusing" when you did the one step that confused you?

        That is like saying a parking lot is confusing where each spot is numbered because you parked in spot "42" and could not find your car. In your mind, spot "42" should be row 4 and column 2. Never mind that the parking lot is not rectangular shaped and has a map.

    • No idea what you think is wrong with the example answer you gave.
      I have read the assignment yesterday, but from my memory it even looks like they are correct?

    • by sfcat ( 872532 )
      I learned that same level of work in C. If you think Java is a bad choice....um...it could be far worse....also, these are HS students...making them learn a FP language just to answer such questions seems...a bit much. We do want some of them to pass the course and how many languages can they learn in that time and still learn actual CS concepts?
  • Time? (Score:5, Insightful)

    by gbooker ( 60148 ) on Sunday June 25, 2023 @08:40PM (#63632182) Homepage Journal

    This test question isn't that difficult. The quoted text points out that the question is 5 pages long but that is just clarifying exactly how the functions should behave with text and pictures describing it.

    This question is the last on the exam. So I have to ask, of the 34% who missed it, how many attempted and failed to provide a workable solution and how many simply didn't answer because they ran out of time answering the previous questions?

    • Back when I was in high school taking AP exams, the method that my teachers taught me was, if any problem seemed as if it would take a significant amount of time, skip it and go through all the easy ones first to maximize the number of questions you answer, and then go back and answer the hard ones. So if the problem that the 34% were having was that an earlier problem was eating too much time, they should skip that one, answer 4, then come back to the one bogging them down and work on it until the time run
      • Re:Time? (Score:5, Interesting)

        by edwdig ( 47888 ) on Sunday June 25, 2023 @09:35PM (#63632328)

        That just enhances the previous poster's point, right? I would think most questions don't require 5 pages of explanation, so this would be one of the longer ones. If the last question on the test is really time consuming, then surely you'd expect a significant amount of people to not answer it, right? Regardless of your approach to test taking, you'd expect a lot of people to save that one for the end.

        • It says they missed the question - presumably meaning that they didn't even touch it. I guess that usually you would get some points for even partial answers but not here... if they were put off by the format I've got some bad news - 5 pages of rambling specs for something that turns out to be trivial to accomplish is not unheard of in industry!
    • by tlhIngan ( 30335 )

      The problem is simple - the text is really hard to parse.

      The goal of the question is super simple once you follow the examples to see what it actually wants. However the way it's described in the text is kind of confusing - I mean, without the examples, I would have no clue what the text was wanting me to do.

      So as a test taker, I'd read the first few sentences, figure out that it's a hard question simply because I couldn't understand what it's asking for and not read the examples. After all, if the text wa

    • This test question isn't that difficult. The quoted text points out that the question is 5 pages long but that is just clarifying exactly how the functions should behave with text and pictures describing it.

      I don't know how many questions there are on that test and can't be bothered to investigate, but if I came across a 5-page question, I'd just skip it entirely. And maybe only come back to attempt it if there's time left at the end.

  • It is the question (Score:5, Interesting)

    by ugen ( 93902 ) on Sunday June 25, 2023 @08:42PM (#63632190)

    So, I am a software developer for my entire adult life, I like solving technical problems and usually don't miss a chance to look at/play with code (esp. if not too onerous).

    Now, I only looked at question 4. It is technically trivial. However - it is just so extremely tedious and boring. I started nodding off after the first 2 paragraphs. They keep going in circles re-explaining what was already explained, declare minutae of API for you and then ask for implementation or results that (at least myself) had absolutely no motivation to look for (as in - intellectual curiosity or need for order).

    Personally, I'd probably fall asleep at the keyboard and that'd be it for the test.

    Software development is fun, but plenty of people (esp. professors) know how to make it unbearable. Same reason many people (esp. in this country) "hate math".

    • So, I am a software developer for my entire adult life, I like solving technical problems and usually don't miss a chance to look at/play with code (esp. if not too onerous).

      Now, I only looked at question 4. It is technically trivial. However - it is just so extremely tedious and boring. I started nodding off after the first 2 paragraphs. They keep going in circles re-explaining what was already explained, declare minutiae of API for you and then ask for implementation or results that (at least myself) had absolutely no motivation to look for (as in - intellectual curiosity or need for order).

      Personally, I'd probably fall asleep at the keyboard and that'd be it for the test.

      Software development is fun, but plenty of people (esp. professors) know how to make it unbearable. Same reason many people (esp. in this country) "hate math".

      (Emphasis mine)

      Absolutely agree. The test questions are tremendously repetitive, boring, and the interesting bits of the question are lost in a sea of words.

      Really. A terse explanation would work much better.

    • I started nodding off after the first 2 paragraphs.

      Kind of how I felt. I was going to read TFA as it were, but it was too boring.

      It's also a 4 page slog in a 90 minute exam.

      I used to teach my students (uni) for a 3 hour exam, don't write anything at all for the first 10 minutes. Just read every question carefully, not down the easy and hard ones, which of the options you will pick, any easy marks of any question parts. Then work out how much time per mark you have, and in your first pass if you get stuck on

      • If you nod off after two paragraphs, you aren't going to make it when to comes to reading vendor documentation.
      • If you think that's bade you need to read a Use Case I was provided years ago for creating an Insurance Document (object), it was 40-50 pages, convoluted and highly detailed, with exceptions sprinkled throughout.

  • Or in more blunt terms, do 1/3 of AP CS students have no business being in AP CS?

    It's an unfortunate conceit if the computer geeks that intelligence and effectiveness in the workplace are synonymous with aptitude at coding. I know several people who are rational, quantitative thinkers who just don't code and won't code.

    It's okay. Best to send them to AP math class or physics or chemistry when they're in high school instead of throwing them into this particular meat grinder.

    Think of it another way. Just abou

  • by NFN_NLN ( 633283 ) on Sunday June 25, 2023 @09:11PM (#63632256)

    80% of the test is reading...

  • AI-powered Bing refuses to provide the answer to the question that completely eluded 32,000+ AP CS A exam takers ("I'm sorry but I cannot provide you with the answer to that question

    Wtf? Something need to be done about this nonsense of Language models randomly refusing queries, before it too late for us...

  • Just reading the test and getting in the mindset of a soulless cog that produces code is so unpleasant. And they added a time limit to make it extra gross.

    I've said it before and I'll say it again: The foundation of CS knowledge I want from coworkers is that they know how to:
    1.) Handles dates correctly
    2.) Understand race conditions
    3.) Grasp that floating point math is mechanical, not theoretical pure math

    If I don't have to sell someone on those concepts, we can usually get the job done well

  • by Walt Dismal ( 534799 ) on Sunday June 25, 2023 @10:59PM (#63632446)
    Question 4 seemed more like a test of whether one can read a tediously badly written specification, parse it, and write the trivial code to handle it. Rather than testing the abiity to write a good algorithm. Bluntly, the spec meanders and this seems a test of ability to decode poor verbose instructions. And thus more a test of suitability to work in industry for morons.
    • Question 4 seemed more like a test of whether one can read a tediously badly written specification, parse it, and write the trivial code to handle it.

      So, a good test of being a software developer :p

      • Don't think for a moment that the people who wrote this question at The College Board are top quality developers which may or may not make this a good question depending on one's perspective

    • Question 4 seemed more like a test of whether one can read a tediously badly written specification, parse it, and write the trivial code to handle it.

      So it was a realistic question to test suitability for custom software development?

  • by mmdurrant ( 638055 ) on Sunday June 25, 2023 @11:54PM (#63632506)
    No wonder students missed it, it's worded poorly and it's confusing. Look at the `moveCandyToFirstRow` method they describe. Given the same inputs to the same function, they say the array can end up in 1 of 2 states which ... huh? Are the students supposed to write it so it behaves one way 1/2 of the time and another way the other 1/2? It's worded very poorly.
    • by bsolar ( 1176767 )

      It's not worded poorly: the spec basically says a candy on the column needs to be moved to the first row if the first row is empty but if multiple candies are available on the column it's irrelevant which one gets moved.

      It's pretty common for a spec to have parts that can be implemented in different ways as long as some specific condition is respected.

      • by Veretax ( 872660 )
        The thing that throws me. I don't expect High Schoolers to have ever seen a box of Candy, but if they had. The positions are not generic, they are used to identify the piece base don a legend. Moving them around in the box would seem a cruel prank to pool. Perhaps the entire analogy is a poor one.
    • by Bahbus ( 1180627 )

      No. They specify in the question that the method "searches" for a match. They are not forcing you to search the array in any particular way. There are numerous different search algorithms: linear (front to back or back to front), binary, interpolation, etc. Depending on how you search will determine which candy gets moved to the front. Hence, they give a visual example that ending up with either end result is good. It's not confusing, it's just unnecessarily long-winded.

  • I hope it's a long road from "I'm sorry but I cannot provide you with the answer" to "Open the pod bay doors HAL!"

  • by dhasenan ( 758719 ) on Monday June 26, 2023 @12:38AM (#63632546)

    The problem tells you that you have a two-dimensional array and to provide a method to manipulate it by column. You don't write the method to fill the 2d array, and it never specifies whether it's stored in row-major or column-major form. I'm going to hope that testers were lenient as long as the response was consistent.

    Other than that, there's null safety and equality operators to worry about, which will catch some percentage of people but hopefully not a third.

  • by Bahbus ( 1180627 )

    That is AP's fault. That question took almost as much, if not more, time to read than it did to write the solution. I didn't look at the rest of the test, but if it's all equally long-winded, then half of their test isn't even coding...it's reading speed - which isn't something that should be tested here. Just write the damn questions, no one needs or wants all this superfluous information, nor does it provide any benefits to anyone. They don't need to be written by someone with a useless English PhD.

    • That is AP's fault. That question took almost as much, if not more, time to read than it did to write the solution.

      Well, people say exams should test as close to the real world as possible. Maybe this is as close as you can get to the 99% of bullshit 'n' meetings and 1% coding that make up a coding job. In a real company it would have been assigned at the beginning of the two week "sprint", then overrun the next three after getting bogged down in design meetings and sidetracked by that guy (you know who yo

      • by Bahbus ( 1180627 )

        Well, people say exams should test as close to the real world as possible.

        They're still failing at that, too.

  • The explanation and samples were very long in the tooth. Also, one of the cases has two possible outcomes, because it is underspecified. Any professional would toss that right back for clarification: is taking the first candy in the column fine? If not, which candy and why?

    And honestly, a two dimensional array isn't a great choice for the operations needed here. If you use say, a list of queues, the implementation would be much easier.

  • Having taught introductory programming classes myself, it's sometimes hard for teachers to get to 2 dimensional arrays in their classes. There's so much material to cover, the often time the more algorithmic array manipulation is left to be covered in later classes.

    I'm not familiar with the AP curriculum, but it could be that there simply was less time to work on this sort of stuff during the semester because other topics were emphasized instead..

  • by reiscw ( 2427662 ) on Monday June 26, 2023 @05:37AM (#63632952)

    I teach this course and this year for the first time I was a grader. I graded Question 1. The week after I graded, I attended a professional development session led by a professor who has done the reading for around 30 years (back into the days of Pascal). For those of you not familiar with AP, the readers are typically divided about 60/40 between high school teachers and university professors. The exam committee is similarly split (although that one I think they keep at 50/50). The professor I was with addressed many of the points above which are valid. I think they may have had an "off" year. CS professors and teachers are just as opinionated about some of these things :)

    Several posters above made good comments about the detailed requirements specification. I agree with their points, and the AP CS people are also aware of it. The amount of text present per question is being discussed on a national level. We practice AP questions like this in my class so that the students are familiar with the exam format. I tell my students that careful reading is a necessity. But in this case, 22.5 minutes per question seems short to me.

    The questions themselves were hard this year. Each question is graded on a nine-point rubric so partial credit is a definite thing (some of those nine points are fairly easy to get). Those rubrics and student samples get released in September to the public if you are curious (just search 2023 AP Computer Science A FRQ Scoring Guidelines).

    Another poster made the comment about there being two correct ways to finish a problem -- and I agree, that was dumb, and it is unusual. I've looked at exams going back to 2009, and almost always you are told "this is exactly the state it should be in when finished."

    They are also struggling with whether the exam format should be revised. They piloted a project/portfolio exam this year but then the whole ChatGPT thing happened. And they seem terrified of digital exams (probably because most schools don't have dedicated, controlled, computer labs any more). They are convinced that some students would find a way to cheat (esp. in a course like AP CS A). Some students who have issues writing by hand are allowed to type their exams, but it's a relatively small number.

  • Most programming languages are 90% logic and 10% semantics. Once you have a good grasp on the logic part, it is much easier to nail down the semantics.Granted, there are some paradigms that you have to wrap your head around (OOP, Functional, multithread, mutex, race conditions, borrow checker, etc.) but the reality is that the most important (and portable) thing you take from language to language is logic. Hence, the emphasis in education should be just that - and teach one or two actual languages to show h
  • According to this guy: https://www.reddit.com/r/APStu... [reddit.com] we get a score distribution of 2/3 pass

    This apparently is a typical result both in AP CS A but also in other AP topics. https://www.bestcolleges.com/c... [bestcolleges.com]

    So maybe it's fine.

You are always doing something marginal when the boss drops by your desk.

Working...