I contacted the like a little guys and they sent me back 2 puzzles before they would even speak to me. The first one was dead simple and took about 14 seconds to write the code and another 7 for it to run and give me the answer.
"A 7 digit number consists of 7 distinct digits (from 0..9 ofcourse); The product of the first 3 digits = product of central 3 digits = product of last 3 digits; Find the middle digit."
The next question I did not understand; I just figured I was not smart enough because I have no college and I am just a hacker that makes shit not a "software eng.". I sent it to a friend of mine that teaches Econ. at a top college and he said he had no idea what they were even asking. (see question below)
Given a list of N line segments on the X axis: (x1[i], x2[i]) where i = 1 to N; And then a list of M queries. Each query inputs one x-coordinate and you need to output the number of line segments that overlap this point. Assume M & N are very large. (So O(M*N) is really bad.)
I asked for clarification and got none so I guess they figured i was just too stupid to respond to which is cool but it made me wonder if when people talk about programmers that cant program do they mean people that cant answer these types of questions? I spent 5 or 10 min or it and gave up. But even though I didn't answer this I can code like a MF and if this question had been a programming challenge I think I could have done it.
My point is that companes should really think before sending out stuff like that to potential developers because they might pass up on some really good talent. I am not saying that I am very talented but I do know how to code and build cool products. I made digest.io and it uses clojure, ML, MapReduce to learn about your diet and help manage digestive conditions and it has paying customers that are happy. I made that and it works well so im not a rookie but I still have no idea what that 2nd question is asking.
BTW: Even though i hate these puzzles the FB puzzles are simple and I have always been able to complete them quickly.
They probably didn't answer because if you need clarification on the question, you have no hope of producing the answer. And incidentally it IS a programming challenge. (Which is why the econ prof had no clue.)
You have a collection of N intervals. And a collection of M points (which they call queries). For a given interval and point, that point can be in the interval or not. For each point you are supposed to find out how many intervals it is inside of. And you're supposed to make the code fairly efficient.
From the way you've written it, the intervals look like open intervals. So x1[i] is not in the i'th interval. That is a minor but significant detail, and I expect their test data to check it.
The naive solution is to write a function that takes an interval and a point, and says whether that point is in that interval. Then you just loop over all points and intervals. This works, but the number of times you run that comparison is N * M. Which, if N and M are large, is going to be painfully slow. In fact there is a notation to discuss how slow, and that notation would say O(N * M). They don't want any variant on this solution.
The solution they are probably looking for is O((N + M) * log(N)). One solution is to try to first find and put into sorted form all of the intervals where the answer is going to be constant across the interval, and then do a binary search for each point to find what interval it falls into (and therefore what the answer is for that point).
My guess as to their thinking is that anyone who can't figure out something like this won't have any clue when they cause scalability problems. This matters for larger sites.
If you don't understand any of what I just said, that's a hole in your background. To fix it go off and learn about little-o, big-O, and some basic algorithms. A short list of algorithms to learn could include quicksort, merge sort, hashing, binary search and how a BTree works. That combination will solve most problems pretty easily.
From the explanation you just gave I sovled it in 7 minutes but i guess thats no challenge since you did all the thinking and I just had to code it. But I see what you mean; i feel like I should have known that and will definitely go look into the things you suggested.
I took each x axis line segment
x(1) -> x(6) for example
and hashed it at 1,2,3,4,5,6
and did that for everyone
then it would simply be a question of iterating each M point and looking at the hash table
Probably a stupid way to do it but it worked.
I think the issue was that I did not know points == queries
Yea, i just wanted to solve it quick so I didn't feel like such a dumb ass. I did it again using your solution and now i see what you mean about scalability because your way is much much faster and more efficient. I had to run my solution on my db server using memcache because it was taking too long and too much memory but yours ran on my laptop.
I tink that Cuil became a disaster because Gogle existed. When google came out it was easily 10x better than what was currently on the market. The same cant be same for cuil.
How do you plan on determining when an item has been sold or a listing has been "fulfilled"? The only way I could think of would be to make it as easy as possible for the ad's poster to mark the listing as expired, or something.
I am really sick of these articles; why cant we just focus on talent. Put the best people in the best positions. It should not matter if they are male, female black or white.
How do you measure talent while recruiting? The person with the most accomplished resume or who can answer your technical questions most aptly? Both are only proxies, albeit usually pretty good ones, for measuring talent. Perhaps that interviewee was nervous or maybe they're really really bright, but just haven't been programming as long as some of their counterparts.
Tracy Chou of Quora wrote a really insightful post about being a female software engineer: http://www.quora.com/Tracy-Chou/Women-in-Software-Engineerin.... It really opened my eyes to some of the reasons why maybe there aren't more women who even get started in the field - even if there isn't outright prejudice, women in engineering still face a lot of challenges that men simply don't. Sure, you can argue that you should give the most talented person the job, but keep in mind that the methods we use for measuring talent are hugely subject to circumstance. For example, I'll bet the average age when most female engineers start programming is higher, so they simply haven't been programming as long. It is rather naive to believe that talent is the primary indicator of whether someone gets a job or gets into a particular school - success is just as much a product of circumstance, getting the necessary opportunities, and other external conditions as it is of one's own inherent talent and work-ethic. And let's face it, women in software engineering face a wholly different set of circumstances than their male counterparts, so let's stop pretending that it's just about talent.
It's probably true that the average age at which female engineers start programming is higher, and they haven't been programming as long. You are correct that this is not a matter of talent. It's a matter of experience. However, given that all other attributes are equal, why should anyone pick a less experienced person over a more experienced one? The circumstances that lead to that don't matter.
By making the "women in tech" conversation about anything other than talent, you are immediately creating another "affirmative action" situation.
Why should female applicants get a hand-out over more qualified male applicants? That doesn't do a damn thing other than even out some cosmetic "gender gap."
If I am passionate about programming, having done it from an early age, and I lose a position to a person who just discovered he/she could make a pretty penny at this "computer stuff," well, that really pisses me off.
I'm not advocating affirmative action or anything even remotely resembling that. In fact, I'm not offering any kind of solution at all. Just responding to having my eyes opened a little bit by a first-hand account of the struggles a woman in engineering faces.
I don't advocate affirmative action, but I acknowledge some of the reasoning/merit behind it. For example, I got into my dream school. Sure, I worked my ass off, and sure I wouldn't have been happy if someone else got in instead of me in part because of their race/gender/socio-economic status, but I also know that deep down, I'm really lucky/fortunate. I'm from a low-income family, but had tons of support/opportunities that a lot of other equally-deserving, equally-qualified people simply didn't. If affirmative action worked in a perfect world where out of two equally-qualified candidates, the upper hand went to the one who overcame more obstacles, then I wouldn't have any problem with it. Again, I'm not espousing choosing an applicant solely based on race/gender/socio-economic status, but if you turn a blind eye to an applicant's circumstances, your methods of evaluating candidates is extremely flawed.
As an industry, we're leaving about half the talent lying on the floor in the form of women who aren't inclined to study computer science. Carnegie Mellon has had a lot of success recruiting talented women [1]. In order to recruit talented women you can't alienate them. If I were a woman I wouldn't want to associate with the men in a typical high school or college computer science environment. I could give you a bunch of personal anecdotes, but the stories from [2] are typical of my experience. Why should bright women develop computer science talent when they're being harassed by their male peers? They go into another technical field, to the detriment of our industry.
> As an industry, we're leaving about half the talent lying on the floor in the form of women who aren't inclined to study computer science.
Your assertion shoots itself in the foot. Since you posit a group of people who are not inclined to study a subject, you can't count them as a loss -- all further effects are purely speculative.
It takes years and years of effort to get good at something difficult. You may as well lament the lack of interest in hammer-throwing, or ice hockey.
> If I were a woman I wouldn't want to associate with the men in a typical high school or college computer science environment.
And your bigoted attitude is the fault of other people why?
And despite that, you don't need to socialize with anyone to work on problems of theory or programming.
> I could give you a bunch of personal anecdotes, but the stories from [2] are typical of my experience.
Sexual harassment is not a computer science issue. There are any number of pursuits where sexual harassment is far more prevalent -- and yet females do not avoid those other pursuits like they do with computer science.
If anything, females are far more likely to experience sexual harassment and bullying from other females. Stories about this abound in the news and are fodder for teen movies.
Regardless of the makeup of a social group, you don't get good at a technical skill by socializing. You can spend all day painting and become a great painter, or you can try to "break into the scene" and spend all day trying to hang out with the hip crowd, and lament your lack of acceptance. None of that will make you a better painter.
Likewise, programmers get good by spending all day programming. There is more learning material available at everyone's fingertips than ever before in human history. A female of today has it a thousand times better than a male of the 1980s. Nobody is going to harass you while you are in your room working on programming, or art, or writing, or playing music.
Also note that the vast majority of males avoid computer science like the plague. Why are we not lamenting losing all of their talent? Are we only concerned with numbers of bodies here, or do individuals matter?
For every story about a female being harassed, there are 10 more about males bending over backward to be helpful and non-harassing to female peers. But it doesn't seem to matter, because ultimately, this stuff is difficult, no matter how nice people are to you.
Nobody can learn for you, just like a personal trainer can't exercise for you. And people have tons of excuses for why they aren't in shape.
Ultimately, this whole topic is begging the question, because people like you are assuming females ought to want to get into computer science. That seems the most condescending viewpoint of all, deciding that you know what's good for them better than they do.
The whole notion of making things more "female-friendly" is insidious sexism of the worst kind. How are you going to overcome social or cultural biases when you are dead set on preserving an existing set of cultural stereotypes and baggage?
If you are taking for granted that females are fundamentally different, then there is no basis for assuming that they should approach parity with males in any given context.
IQ tests show that there are more males at either extreme, with females clustered more toward the middle. If whatever IQ measures correlates well with whatever computer science requires, you should expect to see fewer females at the top end, even if you start with complete gender parity in classroom makeup.
Even disregarding that, it is not at all far-fetched that certain personality traits will be far more prevalent in one gender than another. It could just be that the kind of person who is okay with staring at a screen all day wrestling with code is more likely to be male.
It could even be that extremely smart people are evolutionary "mistakes", and all our progress comes thanks to the social equivalent of paraplegics. The more intelligent someone is, the more likely he or she is to be socially isolated or feel socially alienated.
And it may require social isolation to be able to devote enough time to certain pursuits to become very skilled.
Just by random chance, a small percentage of people born every year will be unusually smart, even when their parents aren't. So even if the smartest people never reproduce, there will still be a supply of smart people turned out by the general populace every year. That group -- a genetic dead-end -- picks up the reigns of the existing technology and takes the next step, generation after generation.
There is no reason we ought to wish anyone into that position. As a group, people who are into computers have traditionally been heavily discriminated against socially. Your comments are just another example of the social ostracization that technical people can expect. And then on top of it, they are a convenient scapegoat for why other people avoid the field. It couldn't be because it's hard -- no, it's got to be because of those fucking nerds.
Is that proven? Is it intuitively clear? What makes us think that a mixed team of programmers is better than a homogeneous one? Maybe it is in some cases, and isn't in others.
Several studies have reproduced a correlation between diversity and organizational success. I don't know of such a study for programmers specifically. I also haven't seen proof of causality - do better organizations have diverse hiring practices, or vice versa? But I've never seen a study that said that lack of diversity was a good thing. So far the evidence weighs towards diversity being better for your organization, though I wouldn't call it "proven".
If women want to do tech (read: if they are interested in tech) then they will do tech, and good for them.
But god damn it, stop complaining about it. There may be a distinct lack of women in the industry, but stop acting like it's actually a problem. It would be great to have more, sure, but the industry is doing fine, and so are the women.
If you're interested in something, fucking do it. That's all there is to it.
No one told me to get interested in programming, and if they did I would have told them to fuck off. The same goes for women, and everyone else in the world.
How many times were you groped by a peer while learning to program? When you were in high school and first learning to code, did you have peers whose presence inspired all the women to leave the room because of their obnoxious behavior? These patterns of behavior are a real, measurable problem that discourages female computer science participation. That shrinks the talent pool and benefits nobody.
I know a lot of women in tech and virtually all of them have either been groped or known a friend who was groped.
It can be interesting to poll your own network, although guys often have to get to a fairly deep level of trust before women will discuss it with them.
Yes, it does suck for anyone who undergoes sexual harassment.
But you're using the word "typical". It connotes that such harassment is not only regular, but expected if a woman attends a conference. Nothing you've linked to (and nothing they've linked to from what I've read) supports the position that sexual harassment is activity that a woman should expect to be typical when going to these conferences.
Do they happen more than any of us would like? Most definitely. I agree it's a problem. I disagree that it's a typical problem.
If women decide not to do Computer Science because they don't like their male peers, I think you're right that there is a more fundamental problem: they probably didn't want to do Computer Science that much in the first place. I would never let my classmates determine my career path. Anyone who tries to argue that is a fraud.
It really is no more complicated than this: do what you love, and fuck everyone else.
I mean it when I say I would love to see more female programmers. But it doesn't help anyone by trying to argue it's all the boys' fault there are no women in tech.
If more women were interested in esoteric technical subjects like computer programming or engineering, they would do them. It's that simple. It just so happens there are more guys who are interested in these things.
I do not think this is typical, yet, in High School. I think the social and sexual ineptness and poor behaviour is fostered and reinforced by the lack of female presence for the crucial years between, say, 14-23 (I doubt the number of actual sexual offenders — for whom acclimation is not a solution — is larger among the techy group than any others).
The long-term solution is to get more girls (HS and younger) interested in programming and so on.
Edit: probably unnecessary clarifications in italics.
FB treats friendship like its bimodal when in fact its not. People have many levels of friendship and FB does not take that into account. IMHO that is the main weakness w/ their site right now.
"A 7 digit number consists of 7 distinct digits (from 0..9 ofcourse); The product of the first 3 digits = product of central 3 digits = product of last 3 digits; Find the middle digit."
"Middle Number: 2" "Set: 1892463" "Common Products: 72"
The next question I did not understand; I just figured I was not smart enough because I have no college and I am just a hacker that makes shit not a "software eng.". I sent it to a friend of mine that teaches Econ. at a top college and he said he had no idea what they were even asking. (see question below)
Given a list of N line segments on the X axis: (x1[i], x2[i]) where i = 1 to N; And then a list of M queries. Each query inputs one x-coordinate and you need to output the number of line segments that overlap this point. Assume M & N are very large. (So O(M*N) is really bad.)
I asked for clarification and got none so I guess they figured i was just too stupid to respond to which is cool but it made me wonder if when people talk about programmers that cant program do they mean people that cant answer these types of questions? I spent 5 or 10 min or it and gave up. But even though I didn't answer this I can code like a MF and if this question had been a programming challenge I think I could have done it.
My point is that companes should really think before sending out stuff like that to potential developers because they might pass up on some really good talent. I am not saying that I am very talented but I do know how to code and build cool products. I made digest.io and it uses clojure, ML, MapReduce to learn about your diet and help manage digestive conditions and it has paying customers that are happy. I made that and it works well so im not a rookie but I still have no idea what that 2nd question is asking.
BTW: Even though i hate these puzzles the FB puzzles are simple and I have always been able to complete them quickly.