CS in VN
March 27, 2013 10:49 PM   Subscribe

Kids In Vietnam Are Crazy Good At Programming - '11th graders in Vietnam are so good at programming that they could easily pass an interview at Google' (via)
posted by kliuless (62 comments total) 27 users marked this as a favorite
 
The result in America is a prefect storm of opposition (to CS) from every level. Effecting meaningful change is virtually impossible. I work for the education department at Google and the stories our external educators return with are as shocking as they are unpublishable. We've been spending enormous resources with frankly minimal impact.

Yeah that's sounds about par for the course.
posted by AElfwine Evenstar at 11:25 PM on March 27, 2013 [4 favorites]


Fascinating.

In contrast, Eric Schmidt rightly slammed the embarrassing state of computer science education in the UK a couple of years ago, and was namechecked in the recent announcement that it's being added to the curriculum as 'the fourth science' alongside the traditional three. Google have also handed out 15,000 Raspberry Pi computers to British schoolkids who've shown an interest in programming.

Interesting that the government in a developed country needs to be shouted at repeatedly by industry to get computer science taught properly in school, while in a developing country kids are programming away at an advanced level. (Some kids, anyway - the fact that Fraser donated a year's teaching salary so one school could teach all its kids makes me wonder what percentage of schools in Vietnam offer this curriculum?)

Also, to save anyone else checking, "11th graders" are 16 or 17.
posted by jack_mo at 11:34 PM on March 27, 2013 [1 favorite]


Riiiight... I'm sure the kids are quite adept at coding. But if this represents what's in the top-third of Google interview questions, I'm applying for their CTO position today.
posted by oxidizer at 11:35 PM on March 27, 2013 [11 favorites]


By grade 3 they are learning to how to use Microsoft Windows. Vietnam is a 100% Windows XP monoculture. Probably all with the same serial number. However, given that a copy of Windows costs one month's salary, it's easy to understand.

I don't understand. Every crazy good programmer I know uses a suite of Open Source software which costs a weekend's salary.
posted by three blind mice at 11:45 PM on March 27, 2013 [8 favorites]


Interesting that the government in a developed country needs to be shouted at repeatedly by industry to get computer science taught properly in school, while in a developing country kids are programming away at an advanced level.

Vietnam has always valued education, and, just like other countries in the neighbourhood such as Japan, Taiwan, Korea and China before them, I predict Vietnam will rise up the value chain over the next decade. Maybe the next ubiquitous consumer device won't come from Korea (or, before Korea, Japan), but Vietnam.
posted by KokuRyu at 11:54 PM on March 27, 2013


That's a fairly challenging problem for high school students to solve in one class, so props to those kids and their educators. To say they could easily pass a Google interview is pure hyperbole, though.

1) It's harder to solve a programming problem with an interviewer watching and presumably judging your thought process. Some people *cough* get so nervous that they over-think the question, try to finish too fast, etc. etc. ... and mess up even trivially simple problems. The harder one tries to prove one's intelligence, the dumber one ends up looking.

2) If Google asks you this problem in an interview, you better deliver the best algorithm for solving it. I'm a mediocre programmer, and it took me two minutes to figure out a brute-force solution, which would probably have the hypothetical Google interviewer gaping at my audacity to be there.

There are huge differences between solving a problem, solving a problem in an acceptably efficient manner, solving a problem in the best possible way, and solving a problem creatively ~outside the box~.
posted by fatehunter at 11:56 PM on March 27, 2013 [8 favorites]


I don't understand. Every crazy good programmer I know uses a suite of Open Source software which costs a weekend's salary.

They're not paying for windows, so it doesn't really matter that open source is free.
posted by empath at 11:56 PM on March 27, 2013 [3 favorites]


I'm actually curious what the answer is to the problem.
posted by empath at 11:57 PM on March 27, 2013


By grade 4 they start programming in Logo.

I started Logo in 3rd grade. In 1983. In America.

Students intentionally tune out of CS class since there are few things worse in American high school than being labelled a nerd.


What. This whole thing is evidence-free nonsense.
posted by drjimmy11 at 11:58 PM on March 27, 2013 [13 favorites]


Is this to go with that "TEACH EVERY KID CODING" video that was being shared on FB by, funnily enough, everyone but my friends who work in tech?

Kids who wanna code are gonna code, but it's a vocation and should rightfully be deemphasized in favor of core sciences and liberal arts. This "problem" is pretty imaginary and the uncritical sharing of the video reminds me of nothing so much as "Kony 2012."
posted by drjimmy11 at 12:00 AM on March 28, 2013 [11 favorites]


They're not paying for windows, so it doesn't really matter that open source is free.

What matters is that open source is open.
posted by tom_r at 12:00 AM on March 28, 2013 [6 favorites]


Students intentionally tune out of CS class since there are few things worse in American high school than being labelled a nerd.

Nothing cooler than Minecraft where I live, except for the new ball hockey league.
posted by KokuRyu at 12:04 AM on March 28, 2013 [1 favorite]


The great thing about programming is you can both learn and produce incredibly valuable things with almost no capital. A $100 computer is completely sufficient to teach yourself programming, and to write a top-quality application on. If you are motivated and work hard you can use that $100 computer to sell millions of dollars of software.

I hope some kids are able to take advantage of this and lift themselves out of poverty. And I hope some of them invent the next big thing and make the world a better place for all of us.
posted by foobaz at 12:05 AM on March 28, 2013 [3 favorites]


I'm a mediocre programmer, and it took me two minutes to figure out a brute-force solution, which would probably have the hypothetical Google interviewer gaping at my audacity to be there.

I'm actually curious what the answer is to the problem.


The brute force solution is the best solution. You initialize all of the cells to unvisited. Then, for each "unvisited" cell:
• flood-fill starting from that cell and mark those cells as visited while keeping track of the total size of the region and if you ever hit the side of the maze
• increment the number of regions if the flood-fill never hit the side of the maze
• if the region size is more than your largest region so far, set your largest region size to this region size
posted by esprit de l'escalier at 1:44 AM on March 28, 2013 [3 favorites]


Imho, everyone should learn simple programming skills quite young, say by age 10.

After that, we should maintain this core knowledge with periodic programming courses and programming exercises in other courses. Programming assignments work great in mathematics and physics course. A high school music class could incorporate a generated music programming assignment, for example. A music class could include a couple math or physics assignments too.

Ideally, all students need fun shop-like laboratory classes for their physics requirements, perhaps even call em' engineering classes. You'd teach the mathematics and physics needed for simple chemical reactions, building digital and analog circuits based on programmable micro-controllers, etc. Just avoid using calculous since some might not understand calculous quickly and they only learn it in their junior and senior years anyways.

There are an awful lot of vague topics like software engineering and object oriented programming that sound wholly inappropriate for grade school kids I personally loved languages then but such messy topics demoralize many students. Just focus on fun stuff.
posted by jeffburdges at 3:26 AM on March 28, 2013 [1 favorite]


Well, if the ethos there is that everyone steals the OS, it's unlikely that they will "use that computer to sell millions of dollars of software", don't you think? I think that, rather than simply being afraid of being labelled as nerds, kids look around and perceive that software has little value, because it is so casually and pervasively stolen. If you want more and better programmers, work harder to create a society that respects intellectual property.
posted by newdaddy at 3:36 AM on March 28, 2013 [2 favorites]


Also, we mentioned Neil Fraser before, but only one has the neilfraser tag.
posted by jeffburdges at 3:52 AM on March 28, 2013


Coding ought to be taught as a core academic subject. It's already essential to doing most serious natural science and engineering and much serious social science. In my field (finance) everyone's in essence a coder although many people have to do it via Excel, and would do it much better after a few months of weekends teaching themselves a bit of proper programming.
posted by MattD at 4:21 AM on March 28, 2013 [1 favorite]


Coding is applied math. Put it in the math curriculum.
posted by LogicalDash at 4:30 AM on March 28, 2013 [4 favorites]


Math needs to be expanded from just the one course that teaches basic arithmetic, geometry and algebra - those are building blocks, and not practical tools for most kids. Managing personal finance and computer science need to be taught from grade school on up to highschool. The ability to run a small business and compare mortgages should be a prerequisite for graduation, as should be the ability to write a spreadsheet macro to automate it.
posted by Slap*Happy at 4:55 AM on March 28, 2013 [1 favorite]


I started Logo in 3rd grade. In 1983. In America.

Yeah, me, too. Then after that, no computer science until college.

Not everyone is going to use math beyond arithmetic in their daily lives, but it's still worth teaching, and it's easier for people if they get consistent exposure to it earlier. It'll probably be more applicable to their lives than trigonometry will be.
posted by ignignokt at 5:10 AM on March 28, 2013


I think that, rather than simply being afraid of being labelled as nerds, kids look around and perceive that software has little value, because it is so casually and pervasively stolen.

Or it's so easily available for $0.99 in the local app store. I'm always saddened when people ask if specific software exists that does a particularly simple, easily programmed task such as extracting telephone numbers from a text file. Our consumer culture trains to seek NumberExtractor.app instead of considering how such a task may be accomplished with the tools we already have.
posted by RonButNotStupid at 5:24 AM on March 28, 2013 [3 favorites]


So, coding is a vocation, and Vietnamese kids are being trained to be good at it, so everyone in the US should learn how to code so they can be paid like a Vietnamese programmer? I mean, you don't even need a giant cargo ship to transport code.

It seems more like an argument not to get your kids interested in programming if they don't want to find themselves approaching middle age with a specialized skill that can be cheaply replaced.
posted by ennui.bz at 5:36 AM on March 28, 2013 [3 favorites]


Well, if the ethos there is that everyone steals the OS, it's unlikely that they will "use that computer to sell millions of dollars of software", don't you think? I think that, rather than simply being afraid of being labelled as nerds, kids look around and perceive that software has little value, because it is so casually and pervasively stolen. If you want more and better programmers, work harder to create a society that respects intellectual property.

I think it's highly unlikely that any given person with programming skills will use a computer to sell millions of dollars of software. Or at least in terms of actually getting paid millions of dollars directly from writing code. I grew up in the BBS computer culture which was pretty much 100% about casually stealing code/software/games/whatever and 0% about making millions of dollars. I wrote code because I wanted to make computers do cool and fun things, and I downloaded pirated software for the same reason. I know a lot of programmers who got started for the same sorts of reasons and don't know any who got started from their love of strictly enforced intellectual property rights. I wouldn't have gotten into programming at all if the software tools I needed to do it weren't freely available either legally or illegally.

The reason why I can make a living being a professional programmer today is because there are companies out there that have unique problems that can only be solved with code, and they are willing to pay people a living wage to write that code. It would not matter if every line of code I wrote was published as open source for anyone to use, because at the end of the day if there's not a solution for their exact problem out there already then they need to pay somebody to write it.
posted by burnmp3s at 5:55 AM on March 28, 2013 [6 favorites]


The brute force solution is the best solution.
I don't know what definition of a brute force search that you are using, but for me a simple find connected components graph algorithm does not fit that category. I agree that you can't get better than O(n) for this solution though.
posted by kiskar at 5:58 AM on March 28, 2013


I'm actually curious what the answer is to the problem.

• Fund schools to where they can add CS classes and teachers without losing other classes
• Stop denigrating education and educators throughout our culture and media
• Show CS as a realistic, normal, real-world career, instead of a geeky, outsider fetish where you're either some fat, Mountain Dew-swilling loner in mom's basement reading comic books, or wealthier-than-god Bill Gates. Seriously. Geek Culture™ is really not all that attractive to non-geeks. And, at the heart of it, we're talking about attracting and bringing non-geeks into CS. That means making it relevant and realistic to their lives.

Aren't Vietnam's schools government-run? Or, at the very least, isn't the curriculum ordained by the government? Seems that that would have a lot to do with why their kids are immersed in CS at such an early age. It's a national effort, directed by the powers-that-be. Here in the US, with education so decentralized, in many schools we run the very real prospect of science being turned backwards, in favor of local religious or political dogma.
posted by Thorzdad at 5:58 AM on March 28, 2013 [1 favorite]


It's an interesting example of starting kids early in working in a specific skill set, then investing in developing talent in that area over a school career. All they need now is to start some kids off being venture capitalists in 3rd grade, and they're all set.
posted by ZeusHumms at 6:12 AM on March 28, 2013


Our consumer culture trains to seek NumberExtractor.app instead of considering how such a task may be accomplished with the tools we already have.

That's because most of us value our time at more than 99 cents an hour. I write scripts for stuff I do at work, but you best believe that if there were an off the shelf script I could buy for a dollar, I'd do it.
posted by empath at 6:28 AM on March 28, 2013


I don't know what definition of a brute force search that you are using, but for me a simple find connected components graph algorithm does not fit that category.

kiskar, imagine each square in the grid has two nodes on opposite sides of its diagonal, and connect with an edge any pairs of nodes directly adjacent one another. Then find all connected components, ignoring the ones connected to the nodes on the outermost edge. Each node accounts for half the area of a square.
posted by attente at 6:39 AM on March 28, 2013


Sheesh. This post makes me feel a little bad. I'm generally considered to be one of the stronger software developers in my little corner of the IT industry (judged in terms of delivering bug-free code on time that meets the client's business requirements and expectations) and to be perfectly honest, I'm not sure I even have the conceptual tools handy to solve the problem posed in the article. Of course, there's not much demand for this kind of programming in the work we do (I work for a custom software shop that mostly provides business solutions to the state government sector and does a lot of work with data and content driven business systems). In most cases we're dealing with code at a higher-level of abstraction and essentially just integrating various preexisting frameworks, libraries and components to deliver a solution. It's funny, really: I've seen a lot of developers come and go in my day who have excellent CS skills and education, and yet, they often under-perform in the real-world (in many case because they seem to get bored with the lack of opportunities to do really low-level, hardcore CS programming; slapping UIs on data or content driven business applications all day or debugging other people's ridiculously over-convoluted code isn't exactly hard-CS) and often end up leaving the field (or at least, the market I'm in). I would really love to have had a better general education in CS. I've taught myself quite a bit about the higher-level engineering aspects of CS, but I have to admit, I'd probably have to do a couple days of research and self-teaching before successfully tackling a problem like that one (especially in Pascal, whose features aren't familiar to me). I've been trying to encourage an early interest in CS in my son, so hopefully he'll be better equipped than I am.
posted by saulgoodman at 6:43 AM on March 28, 2013


That's because most of us value our time at more than 99 cents an hour. I write scripts for stuff I do at work, but you best believe that if there were an off the shelf script I could buy for a dollar, I'd do it.

But I think there's a huge difference between having enough knowledge and skills to make that cost/benefit decision, and just opting for the app because you don't know of any other approach.

I just put together a simple web application to display predictions for a few area bus stops. Plenty of these apps already exist, but I wanted something that could a) list multiple area stops on different lines so I can easily choose the next bus b) parse the xml server-side because javascript on my ancient Blackberry Pearl is slow and c) look nice on my phone. Nothing out there met my requirements, so I rolled my own solution and introduced myself to web.py and lxml in the process. It may have taken a few hours to make, but instead of settling for something that wasn't optimal or doing entirely without, I've gained valuable experience.
posted by RonButNotStupid at 6:59 AM on March 28, 2013


jeffburdges: we should maintain this core knowledge with periodic programming courses and programming exercises in other courses.

When I went to Simon Fraser U (Vancouver BC) in the 80's for an after-degree biochemistry program, this was their MO. Every course had a computing component, and if there wasn't an obvious way to fit one in, they got a bigger shoehorn. They had a WORLD-CLASS!1! Michigan Terminal System, and there were terminals all over the school. Plus you could get work experience credits (and money) by working on a variety of research projects- mine was doing data entry and running quality reports in SPSSx. Every course also had a public speaking component

Those two things have worked well for me in various jobs. I'm not a programmer, and IT has never been a core skill in my work, but knowing a) how to talk about solving problems with computers to management and b) how to talk about systems to the IT folks, has meant I've been able to work on lots of interesting projects over the years. Frankly, the latest phase of my work has been depressing because I've run out of energy necessary to explain to people who appear to be ignorant about basic science how to use our IT resources to solve fairly simple problems. But organizing data and writing some primitive code usually makes ME happy.
posted by sneebler at 7:25 AM on March 28, 2013 [4 favorites]


drjimmy11: "Is this to go with that "TEACH EVERY KID CODING" video that was being shared on FB by, funnily enough, everyone but my friends who work in tech?

Kids who wanna code are gonna code, but it's a vocation and should rightfully be deemphasized in favor of core sciences and liberal arts. This "problem" is pretty imaginary and the uncritical sharing of the video reminds me of nothing so much as "Kony 2012."
"

Honestly - I've had this discussion with my friend. Maybe we don't need coding, per se, but I think some form of logical thinking would be *very* beneficial for Americans to receive. No offense to traditional science, but that doesn't quite cut it. I think too often, the scientific process is abstracted out from the science education. What a child thinks in science class (at least if they're average, and certainly if they're below average -- I should know, because I was average and refused to learn apparently what I was supposed to learn, joking with the teacher, trying to push creationism, and in general not really UNDERSTANDING how science works, which includes a process of logical thinking), but that's because we're doing abstract projects that are either trying to teach a principle of reasoning, but so far abstracted that it makes the lesson hard to really understand, or so far down in the nitty gritty that it feels like you're learning facts, and not the process of science. Science education requires a bit of both. Unfortunately, I think this abstraction/detail removes children from the process of logical thinking in a direct and forthright manner.

Math word problems sort of get to this, but they are... math problems. You're not learning logic, necessarily. In some ways you are, of course, but not really pure logic, ultimately, you're learning a combination of problem solving, logic and math. Which is fine, but strip it down.

Get to coding, or some form of logic. Get it to the basic bare bones... I had stats, and that might get all the baseball junkie jocks all hot and bothered but it bored me to tears. I think it's a good thing to have, even though I barely remember any of it. But I think either some basic coding/problem solving process or pure logic is really the way to go. The problem with coding (shit, even logic) is that, in the end you're having to learn a brand new language, and not everyone thinks in that way, and it makes it hard to teach. Then you get little know-it-alls who are above the class level and think they don't have to learn anything, but this is a problem in general with any sort of education (not that I would know anything about that *ahem*).

Anyways, it might not be the end of Western Civilization, but I think a little bit of learning how to do some basic goddamned fucking reasoning about the world around you would really be a boon to our society as a whole. It might help reduce stupid youtube comments by 1%... And as much as I'd like to say that it's just Tea Party Fundie Bigots that need it, I think there is also a need for this kind of thing for people on the left as well, because there is plenty of stupidity and lack of thinking on that end of the spectrum. In the end, we can only benefit.
posted by symbioid at 7:30 AM on March 28, 2013 [3 favorites]


If you want to know where the best programmers are coming from, take a look at the results of the ACM programming contest. (Hint: Russia, China, Poland.)

Assuming this guy's description applies across Vietnam, I wouldn't be surprised to see it doing well in the finals in a few years, if not sooner.
posted by A dead Quaker at 7:33 AM on March 28, 2013 [1 favorite]


Maybe we don't need coding, per se, but I think some form of logical thinking would be *very* beneficial for Americans to receive

I think that's a much better, albeit less sexy, answer. I've never really used my BA in Economics for work (unless you consider working on spreadsheets for fantasy sports at work), but as a coder, I think economics gave me a good grounding in the skills I need to be good programmer. Econ, especially the early classes, focuses on simplifying questions* and abstracting away stuff you don't need to know to solve the problem. Just having that ability to pause before the rush to get started, step back and ask, "What problem am I trying to solve? Does it resemble something else I've done before?" is a huge advantage.

* Perhaps too much so for practical real-world economy modelling, but that's a different post.
posted by yerfatma at 7:45 AM on March 28, 2013 [1 favorite]


symbioid: too often, the scientific process is abstracted out from the science education.

This ^2. I think teaching people to solve problems using coding is a way around this. There's a built-in reward that comes with building a conceptual structure that solves the problem. I'm not good at some kinds of abstract reasoning (math, chemistry), but writing code uses a different part of my brain, and I don't notice that I'm doing math along the way.
posted by sneebler at 7:47 AM on March 28, 2013


It seems more like an argument not to get your kids interested in programming if they don't want to find themselves approaching middle age with a specialized skill that can be cheaply replaced.

Well, the same could be said of a huge number of white collar professions: accounting, finance, HR, the list goes on... But the real savings comes into play when we outsource upper management - think how much cheaper a Vietnamese CEO would be, and the quality would be roughly equivalent. I eagerly await this next trend in outsourcing.

As an actual software engineer: I think it's nice to expose children to some degree of logic and programming - through LOGO, mentioned above, or Processing, it's modern equivalent. But let's not get carried away here: computer science and software engineering doesn't spring magically from the air, you need a solid background in math and engineering practices that you're not going to get out of a good well-rounded high school education, because there isn't time to cram that in with everything else that you need to learn to function in society. You need critical thinking skills that you're really only just developing in high school. What he really seems to be skirting is the idea of teaching parts of formal logic.

That puzzle is not particularly hard, but you need to be able to: reason about the problem, describe the algorithm that is the solution, and then implement it. Would high-school-age me have been able to solve it? I'd like to think so, but that was a long time ago. Critical thinking skills that are taught now to students fall somewhere along the continuum of math/reasoning that goes out to formal logic, it's just taught across many subjects (within reading, math, etc.) and isn't called out as a subject in its own right. Perhaps if teachers had smaller class sizes they could get students to the point where they could effectively teach the basics of formal logic and discrete math. And let's not forget those non-math and science classes: art (seriously, never trust a software engineer to build a UI unless you've seen their work before) and music. Those non-hard sciences sure come in handy when you need to display information or build something interactive. And, it turns out, there's rather a lot of math involved in those subjects, so win-win. I'd rather all high-school students have art and music classes than formal logic and discrete math.

I can recall back to the dawn of time that my high-school offered computer science classes (and I took one year of them), and my children's school system does as well. I realize that isn't going to be something universal available - computer science classes are going to be a massive luxury to poor school systems in the US (and that's even a thing as a poor school district is a damn shame in its own right). Having smaller class sizes, actually having art and music classes, these are all things that are probably better for all the students than learning how to write a sorting algorithm, and most certainly a better use of money. I'd rather have every child graduated high-school could read and write text at an appropriate level, than ensure that a few could read and write software.
posted by combinatorial explosion at 7:48 AM on March 28, 2013


From the article: However, there is still one major wrinkle in the system. The introduction of computer science in the Vietnamese education system is relatively recent. It appears to have arrived at all levels simultaneously a few years ago.

This is very wrong, unless a few years means at least 15 years. My wife learned word processing in 3rd grade over 20 years ago in Vietnam, LOGO in 4th grade and studied Pascal in 11th grade. This curriculum is not new; it's been standard for some time now. Students who excel at computer science can choose a high school that specializes in IT. Similarly, there are high schools that specialize in foreign languages for students who will study exclusively in English (or another language).

So, coding is a vocation, and Vietnamese kids are being trained to be good at it, so everyone in the US should learn how to code so they can be paid like a Vietnamese programmer? I mean, you don't even need a giant cargo ship to transport code.

That's definitely not the takeaway here. The Vietnamese kids are being taught to think logically and they're being educated in STEM fields in a way that students in the US are not. Their curriculum in STEM fields is both more intensive and more extensive than what is being taught in most US primary and high schools.
posted by trueluk at 8:06 AM on March 28, 2013


The problem with coding (shit, even logic) is that, in the end you're having to learn a brand new language, and not everyone thinks in that way, and it makes it hard to teach.

Yeah, every programming language has certain unique features and syntax, so I don't know if everyone would necessarily get the same benefits in terms of general reasoning skills from learning programming as much as learning formal logic or propositional calculus or something more general. But then, logic is only part of the mix. Intuition and good high-level judgment is still just as important in most cases and often even more so. Still, I wish I hadn't hated math so much when I was still in school. The biggest problem was that the teachers in the US often weren't competent enough in the field to explain the theory behind the math. And I hated learning anything by rote repetition.
posted by saulgoodman at 8:13 AM on March 28, 2013


As an actual software engineer: I think it's nice to expose children to some degree of logic and programming - through LOGO...

ScriptCraft for minecraft is kind of a neat "LOGO." It's a hack which exposes the Bukkit minecraft server API to a javascript interpreter and implements a 'turtle' as a js function which is called, appropriately, 'Drone.' It's not gamified in any way and MC + Bukkit + texteditor is not exactly the most kid friendly development environment but it gets you LOGO in minecraft in a stripped down, yet powerful way.
posted by ennui.bz at 8:20 AM on March 28, 2013 [2 favorites]


Outside were 1500 children doing their morning exercises, which in part consisted of the Chicken Dance.

This was just a weird aside in the article but it made my day. I had no idea anyone outside of Wisconsin did this.
posted by desjardins at 8:21 AM on March 28, 2013 [2 favorites]


*clap clap clap clap*
posted by symbioid at 8:34 AM on March 28, 2013 [2 favorites]


So, coding is a vocation, and Vietnamese kids are being trained to be good at it, so everyone in the US should learn how to code so they can be paid like a Vietnamese programmer? I mean, you don't even need a giant cargo ship to transport code.

It seems more like an argument not to get your kids interested in programming if they don't want to find themselves approaching middle age with a specialized skill that can be cheaply replaced.


While I am uncomfortable with the connotations of "Vietnamese" used in this context (ie, "cheap faceless workers who are competing with you to replace you), I do agree with the idea that maybe software development is not such a great choice for a 10-year-old kid in 2013 contemplating what to take in university in 2020.

Pretty sure there will be a glut of software developers 20 years from now (when a 2013 ten-year-old would be approaching "mid-career" phase).

The problem is software dev is a young discipline at the moment, so current workers will dominate it for the next 20-30 years.

This article also points out what occupations are in decline.
posted by KokuRyu at 9:51 AM on March 28, 2013 [1 favorite]


There's definitely an element of "teaching to the test" that keeps classes like basic C.S. out of elementary schools. As for the universities, I ascribe all the problems the author lists to the fact that U.S. universities' curricula are targeted at corporate employment opportunities.

I'm guessing there aren't a lot of companies that hire programmers in Vietnam. In the U.S., studying C.S. is often a career choice, so U.S. students (and their parents) demand that curricula be focused on "useful" skills to add to a résumé, as opposed to thinking of C.S. as what it is, a branch of mathematics which happens to be practiced with a computer, with many applications across different fields of study. The latter way of thinking is more in line with how top-tier universities teach these programs, but most C.S. students in the U.S. will never set foot in a top-tier university. The reality is, most programming jobs do not demand a talent for creative problem-solving. A lot of jobs, especially outside the software industry, are all about maintenance, and having the desire and drive to innovate would actually be a detriment to the employer. I would guess that universities are scaling back their expectations for students based on the demands of corporate employers, rather than the reverse situation occurring.

For example, I knew a guy who studied COBOL in college. Like, he actually wanted to study COBOL, which if you're not familiar is a bit like majoring in Koine Greek. Why? Well, as it turns out, decades ago, a lot of large corporations built their database tiers in COBOL, and its too expensive and cumbersome to completely re-write this critical piece of software when your supply-chain depends on it, so they'll be hiring new COBOL programmers until the sun burns out. This peer of mine knew Company X Inc. needed to hire a hundred COBOL programmers over the next five years, and our university was based in the corporate headquarters of Company X. Company X contributed enormous amounts of funding to the university because it hires a huge portion of its engineers from recent graduates, which is no doubt why the university offered several courses in COBOL, and let students take those courses instead of more academic courses in AI and machine learning.

Most corporate programming work outside the software industry consists of maintaining an ancient piece of software that has rotted to the point that it needs constant attention to keep it from falling apart. Corporations in the U.S. know what their labor requirements are and have influence in determining how curricula at the average university are shaped based on what they need. And the average corporation does not want to hire as a maintenance programmer someone who is going to get bored in two years and leave. Hence, COBOL classes.
posted by deathpanels at 10:03 AM on March 28, 2013 [3 favorites]


Most corporate programming work outside the software industry consists of maintaining an ancient piece of software that has rotted to the point that it needs constant attention to keep it from falling apart. Corporations in the U.S. know what their labor requirements are and have influence in determining how curricula at the average university are shaped based on what they need. And the average corporation does not want to hire as a maintenance programmer someone who is going to get bored in two years and leave. Hence, COBOL classes.

That was the exact opposite of my observations when I worked for an industry association and later a government agency that provided services to / 'interfaced with' the tech sector (SME's mostly, so we're not talking about oligarchs).

Tech companies, particularly ones that relied on software dev, were frustrated by the fact that universities graduated students with no practical or applied skills. The universities themselves are insular and very difficult to influence, at least in Canada. The insularness means they do not rely on outside input to craft programs - they build it, thinking "they" will come. So, totally out of touch.

Companies that required more of a hardcore engineering approach were more satisfied with university STEM curriculum (I did a lot of surveys of industry).

I'd love to hear how industry can influence academia though. In my experience in western Canada, there is a massive cultural divide.
posted by KokuRyu at 10:32 AM on March 28, 2013


As posed the problem is very difficult, and I'd actually say it's way too hard for a 45-minute whiteboard interview. I just did the problem and it took me 30min, but coding on a whiteboard is much different than coding in an editor and you're also talking to the candidate at the same time, you want to lead them into it & discuss, etc. You're not looking for the same thing in a coding interview as you are in a test -- and the skills you are looking for aren't necessarily the ones they teach you in 11th grade in Vietnam.

That said. Could most Google engineers do the problem if you sat them down at a computer for 45min? Yes. But it's devilishly hard for 11th-graders!

But all this is beside the point, because if you look at the data file that comes with the problem it turns out they've done the hard part for the students! They just want students to implement floodfill, which I or any Google software engineer could do in 5 minutes flat.
posted by goingonit at 10:34 AM on March 28, 2013


I need to learn Pascal and try to do this myself because it's going to nag at the back of my mind annoyingly until I do. Maybe I can use my own self-instruction to teach my son. He recently started playing with Scratch.
posted by saulgoodman at 1:01 PM on March 28, 2013


Don't learn Pascal. Do it in Python. It will be easier and you will learn a useful language.
posted by esprit de l'escalier at 1:17 PM on March 28, 2013 [1 favorite]


Yes this is not something that gets significantly harder depending on programming language.

FWIW let me give you the input spec that I made up:
- First, a line with the width of the maze in squares followed by the height of the maze in squares
- Then, a line for each row with a character for each square. The character will be "/", "\", or "0" depending on which way it is split (or not at all in the third case).

So the input for the example problem would be:
6 4
\//\\/
\///\\
//\\/\
\/\///
And the output should be a single number representing the size (in squares) of the largest enclosed area (area = not split by any lines, enclosed = doesn't border the edge of the maze). So in this case the output is:
8
(bonus points: prove the output can never be fractional!)

Good luck!
posted by goingonit at 1:23 PM on March 28, 2013


Actually, now that I've had a second to come back to this and think about it, this approach makes sense to me, conceptually. I haven't had to do any much drawing of graphical elements in my career (and I've got no formal CS training), so using flood fill to test each cell wouldn't be something I would think of naturally. But the solution described above makes sense to me. That makes me feel a little better anyway.

Don't learn Pascal. Do it in Python. It will be easier and you will learn a useful language.

Thanks for the tip.
posted by saulgoodman at 1:32 PM on March 28, 2013


Indeed, flood-fill is the way to go, but the tricky part is figuring out a reasonable way to represent the cells and their adjacencies.
posted by goingonit at 1:36 PM on March 28, 2013


I'm a mediocre programmer, and it took me two minutes to figure out a brute-force solution, which would probably have the hypothetical Google interviewer gaping at my audacity to be there.
You might be surprised. A guy I knew applied there back in '06 and got a series of enormously complicated, open-ended, "let's see how you think"-type questions. A former coworker who applied recently said it was a fairly standard round of interview questions.
posted by deathpanels at 2:01 PM on March 28, 2013


Yeah, it's really two separate problems:

1. Given a graph where some vertices are marked as being on the "outside", find the largest connected component that does not contain an "outside" vertex.

2. Interpret the given input as such a graph.

They're both easy to explain, but the second one is tedious to code, especially on a whiteboard -- lots of edge cases and indexing to screw up accidentally.
posted by qxntpqbbbqxl at 2:13 PM on March 28, 2013


I wrote up a solution in Python 3 using their input format (although, I wasn't sure whether / or \ is represented by a 1). The indentation is unfortunately messed up by metafilter's reformatting.


import numpy as np
import sys

maze = np.array([[int(x)
for x in line.strip()]
for line in sys.stdin],
dtype=np.int8)
visited = np.zeros(maze.shape + (2,))
directions = [(-1, 0), (0, -1), (1, 0), (0, 1)] # left, up, right, down
directions_possible = [[[2, 3], [0, 1]], # for bottom, then top of type 0 cell
[[0, 3], [1, 2]]] # for bottom, then top of type 1 cell
entering = [(2, 3), (0, 3)]

def fill(x, y, top):
if visited[x, y, top]:
return False, 0
hitwall = False
num_cells = 1
visited[x, y, top] = True
for direction in directions_possible[maze[x, y]][top]:
newxy = np.array([x, y]) + directions[direction]
if 0 <> best:
best = nc

print(total, best // 2)

posted by esprit de l'escalier at 2:15 PM on March 28, 2013


Ah, it didn't work. I think metafilter is doing something to the code for some reason.
posted by esprit de l'escalier at 2:21 PM on March 28, 2013


esprit de l'escalier, take a look at their input again -- notice how the 1s are arranged in a zigzaggy pattern? My guess is that "1" is "wall" and "0" is empty space, and that each square takes up like a 4x4 area of the input. So then you don't have to do an fanciness, just regular floodfill algorithm and then divide by 16.
posted by goingonit at 2:24 PM on March 28, 2013


I'd agree that Python makes an excellent teaching language. Ideally, you'd assign Sage projects in math classes because Sage is an open source mathematics package based on Python.

Java makes an abysmal teaching language. There are even universities using Haskell for their intro to programming courses, which while that sounds crazy, presumably they avoid teaching the type system somehow. Imho, anyone first language should be interpreted because usually interpreters give better error messages. In fact, GHC has phenomenally good error messages, assuming you know Haskell's type system.
posted by jeffburdges at 2:25 PM on March 28, 2013


I imagine one could probably do a smidgeon better than simple flood filling, since it's on a lattice. If, for instance, an area is surrounded by filled nodes (or lattice edge) and that area is smaller than the current largest enclosed space, you can skip checking it. And you can probably leverage that fact to better select your starting points -- say, a grid of starting points where the grid spacing steadily increases as the current largest enclosed area increases. If the network is big enough with enough unconnected components, we might be able to get away with only testing a small proportion of nodes as n -> infinity. And since every square seems to have a stick and each stick is presumably randomly \ or / , we could probably even figure out the statistics for this...
posted by chortly at 7:57 PM on March 28, 2013


esprit de l'escalier, take a look at their input again -- notice how the 1s are arranged in a zigzaggy pattern? My guess is that "1" is "wall" and "0" is empty space, and that each square takes up like a 4x4 area of the input. So then you don't have to do an fanciness, just regular floodfill algorithm and then divide by 16.

That doesn't at all match up with the drawing that's with the question. I think esprit has it right.
posted by empath at 8:33 PM on March 28, 2013


empath: "I'm actually curious what the answer is to the problem."

The original blockly demo maze was solvable via a simple forward, turn left, forward, turn right, repeat loop. There's been a new one published elsewhere that randomizes the maze. The Blockly language there doesn't make much allowance for data; you're supposed to write a wall following algorithm: if there's no wall to your left, turn left and go straight; elseif you can go forward, do so, else turn right. That local reasoning works for mazes so long as you don't start on an inner loop. It's not the most efficient path, but flood fill isn't the most efficient algorithm for finding the most efficient path, if that XScreensaver is to be believed.
posted by pwnguin at 1:11 AM on March 29, 2013


Although with this one, if there's a / or \ in every square, it looks to me like there can only be one topology: a corridor of width 1 (or .707 or whatever). So all closed areas should consist of closed loops, and everything else will be corridors that start and end on an edge. So knowing that should really speed up exploration, particularly in conjunction with the knowledge that if an area enclosed by a loop is less than the longest current loop, you can skip checking it.

I imagine like all such things, this little set-up has probably been studied thoroughly by someone, probably including Martin Gardiner. But if we think about the distribution of closed areas, assuming the \ and / directions are random, that should look something like the distribution time-to-return-to-origin of self-avoiding random walks (at least, as the lattice size goes to infinity and thus the probability of hitting an edge goes to zero). There's actually whole books on self-avoiding random walks on lattices ... though in this case, it seems like you can't actually get stuck (eg, like in the Snake game) ... so it's actually a bit weirder.... hm. Save me, Martin Gardner!
posted by chortly at 12:58 PM on March 29, 2013


Although with this one, if there's a / or \ in every square, it looks to me like there can only be one topology: a corridor of width 1 (or .707 or whatever). So all closed areas should consist of closed loops, and everything else will be corridors that start and end on an edge. So knowing that should really speed up exploration, particularly in conjunction with the knowledge that if an area enclosed by a loop is less than the longest current loop, you can skip checking it.

That's very interesting and I wonder if you could get that to work. However, you need linear time to read the data in, so it doesn't really matter if you can solve the problem in sublinear time.
posted by esprit de l'escalier at 10:06 AM on March 30, 2013


« Older hitRECordTV   |   2yo boy picks lock to sister's room in the night... Newer »


This thread has been archived and is closed to new comments