The Big Programming Thread - Page 641
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
WolfintheSheep
Canada14127 Posts
| ||
supereddie
Netherlands151 Posts
On June 15 2015 05:11 wherebugsgo wrote: for example at one of the places I interviewed at I was requested to solve something that is a slight variation of the collaboration distance problem. (e.g. Kevin Bacon number or Erdős number) and I was given maybe 20-30 minutes to whiteboard my solution to the problem which was initially not in an easily or obviously solvable format. I'm pretty sure that question was designed to fail almost every candidate that applied. If I ever get questions like that I'd just get up and leave. No point in wasting my time on stupid, irrelevant questions. Unless, of course, the position you apply for has an actual need for such algorithms and it said so in the job description. But then I wouldn't apply to that position ![]() Sure, it can be useful to know bubble sort, of some pathfinding alogrithm, or whatever. But in my professional programming carreer I never needed to implement my own. There are existing frameworks and libraries who are probably widely used, heavily tested and have good to excellent performance... | ||
Blisse
Canada3710 Posts
| ||
phar
United States1080 Posts
On June 15 2015 06:01 supereddie wrote: If I ever get questions like that I'd just get up and leave. No point in wasting my time on stupid, irrelevant questions. Unless, of course, the position you apply for has an actual need for such algorithms and it said so in the job description. But then I wouldn't apply to that position ![]() Sure, it can be useful to know bubble sort, of some pathfinding alogrithm, or whatever. But in my professional programming carreer I never needed to implement my own. There are existing frameworks and libraries who are probably widely used, heavily tested and have good to excellent performance... Well the point is to land a job that pays ~$200k or more after a few years. Also even if the interview questions are bad (because some interviewers use bad questions, there's nothing you can do about that), the work is typically more interesting. | ||
killa_robot
Canada1884 Posts
On June 15 2015 05:11 wherebugsgo wrote: it sucks but that's the way you have to do it if you want a well-paying job at a tech company in SV. Most of my on-site interviews were all-day affairs, usually starting around 10 in the morning and ending around 4. The hardest part is the fatigue once you have enough practice and you know what is expected. Also you can consider the phone screens to just be individual interviews prior to the "real thing". But it paid off for me :D hard to beat $150k++ in annual compensation and amazing perks right out of college edit: also I should say that some of the hardest interviews are not at the places you'd expect. The ones for me that were hardest were some startups in SF and places like Dropbox, Quora, Patreon etc which are on the smallish to medium size. for example at one of the places I interviewed at I was requested to solve something that is a slight variation of the collaboration distance problem. (e.g. Kevin Bacon number or Erdős number) and I was given maybe 20-30 minutes to whiteboard my solution to the problem which was initially not in an easily or obviously solvable format. I'm pretty sure that question was designed to fail almost every candidate that applied. You must do a ton of side projects if you were even considered for such a high paying job just outside of school. | ||
Manit0u
Poland17191 Posts
On June 15 2015 05:49 Nesserev wrote: Hmmm, it's a shame that you don't remember what the exact problem was anymore, would be fun... but sounds difficult to solve if you haven't taken an algorithm course that has handled Dijkstra and such. I guess they were testing him for the ability to write an app that serves "If you liked that, you might also like..." stuff and such ![]() Anyway, it all boils down to the shortest path algorithms and if you know them (or even about them) or not. | ||
wherebugsgo
Japan10647 Posts
On June 15 2015 10:13 Manit0u wrote: I guess they were testing him for the ability to write an app that serves "If you liked that, you might also like..." stuff and such ![]() Anyway, it all boils down to the shortest path algorithms and if you know them (or even about them) or not. actually this was exactly what it was The job was for a startup in SF that is essentially a competitor to Yelp and it builds like a social search app. So no, the question wasn't really out of context but it was still relatively surprising. I actually managed to get fairly far into the question although I spent a non-trivial amount of time rearranging the data so I could treat it like a search problem. I tried to get it into something that resembled an adjacency list before attempting to use BFS edit: On June 15 2015 05:53 WolfintheSheep wrote: Pretty sure most interview questions like that are designed to evaluate thought processes, general knowledge and problem solving, not having specific answers to specific problems. Yes, this is true. However I think you'll find that a lot of the time bad or unmotivated interviewers will not really ask good questions. Some questions don't elucidate the candidate's thought process as well as others. Sometimes when you get someone who is clearly not interested in interviewing (and often I'm not quite sure how they end up in that position) or who is having an off day or whatever they tend to be rather terse with you and it makes for a bad experience. I interviewed for at least 20 companies in the bay over a period of about 2 months and in almost half of them there was at least one interviewer who was clearly disinterested and probably didn't care what I had to say. It's also kinda shocking how lacking the process is in diversity. I think I had a whopping 3 women interviewers and maybe one person who wasn't white or Asian. There are lots of positions that are not filled with the best people (particularly design, management and numerous creative roles) simply because the process sucks at finding them. It definitely needs to change, and I can see it happening at some companies, but it's worrying that these types of interviews are so commonplace. At least for the most part in my experience once you know how the system works you can always play to it. Not necessarily the most uplifting thing, however. | ||
phar
United States1080 Posts
On June 15 2015 09:51 killa_robot wrote: You must do a ton of side projects if you were even considered for such a high paying job just outside of school. You do not need to do side projects to get a job at GooMicBookZon right out of undergrad. They hire a large number of new grads, and it would not surprise me if starting offers were $150k+ now, especially at Facebook. | ||
Zocat
Germany2229 Posts
On June 15 2015 05:11 wherebugsgo wrote: one of the places I interviewed at I was requested to solve something that is a slight variation of the collaboration distance problem. (e.g. Kevin Bacon number or Erdős number) and I was given maybe 20-30 minutes to whiteboard my solution to the problem which was initially not in an easily or obviously solvable format. k-hop neighbourhood in graphs. If you have a node it self is the 0-hop neighbourhood, all nodes it can reach within 1 hop is the 1-hop neighbourhood etc. It's often used in topology control and similar features (i.e. routing). A cool feature of it is that you can calculate it without having the whole view of the complete graph, it's enough that each node can see it's 1-hop neighbourhood and thus it can be easily/efficiently solved in a distributed way. Traditional algorithms usually perform worse. | ||
amazingxkcd
GRAND OLD AMERICA16375 Posts
https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition | ||
helpman177
56 Posts
Edit: I see, I'm a bit slow. | ||
Manit0u
Poland17191 Posts
On June 15 2015 12:19 amazingxkcd wrote: This might be off-topic, but this is the best github project i have ever laid my eyes on https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition Naah, nothing will ever beat ToleranUX (sadly, it got blocked by GitHub) and C+= ![]() | ||
ZenithM
France15952 Posts
On June 15 2015 16:35 Manit0u wrote: Naah, nothing will ever beat ToleranUX (sadly, it got blocked by GitHub) and C+= ![]() Great stuff :D (those 2 posts). | ||
![]()
BisuDagger
Bisutopia19155 Posts
If I have a function OnMouseDown() and it calls a function IsUISelected() such that it looks like this:
If IsUISelected resolves to true in it's function I need to break out out of the OnMouseDown() function instead of continuing. I'm trying to simply this statement. Simplying the state is purely just a curiosity not a necessity.
| ||
![]()
BisuDagger
Bisutopia19155 Posts
On June 15 2015 16:35 Manit0u wrote: Naah, nothing will ever beat ToleranUX (sadly, it got blocked by GitHub) and C+= ![]() I'm cracking up so hard right now. To bad I'm surrounded by artists who won't get the jokes. Gold: private == privileged printf(); == yell(); class Foo{}; == social_construct Foo{}; #include == #consider break; == leave; if() == maybe() for() == check() while() == freeflowing() sin(x) == biotruth(x) div == unite 'y's are strictly prohibited when naming variables; only 'x's are allowed | ||
inn5013orecl
United States227 Posts
On June 15 2015 21:05 BisuDagger wrote: Okay this is a pretty odd question and either there is no answer or it is stupidly obvious. Reply in terms of C++, C# please: If I have a function OnMouseDown() and it calls a function IsUISelected() such that it looks like this:
If IsUISelected resolves to true in it's function I need to break out out of the OnMouseDown() function instead of continuing. I'm trying to simply this statement. Simplying the state is purely just a curiosity not a necessity.
Pretty sure that's as simple as you're going to get. Return pass control back to the caller of OnMouseDown(), effectively exiting out of the function. In this case, works exactly like a break statement in a loop.
| ||
![]()
BisuDagger
Bisutopia19155 Posts
On June 15 2015 22:07 inn5013orecl wrote: Pretty sure that's as simple as you're going to get. Return pass control back to the caller of OnMouseDown(), effectively exiting out of the function. In this case, works exactly like a break statement in a loop.
That's what I thought. I just have to use this check in so many damn places I was trying to save white space. Oh well lol. edit: The reason I keep the brackets is to match a coding standard of another companies programmers I have to work with from time to time. | ||
Acrofales
Spain17848 Posts
On June 15 2015 22:11 BisuDagger wrote: That's what I thought. I just have to use this check in so many damn places I was trying to save white space. Oh well lol. edit: The reason I keep the brackets is to match a coding standard of another companies programmers I have to work with from time to time. Restructure your program to require less of these checks? Or suck it up. Honestly, I can't think why you wouldn't just put all of that check and return statement on a single line (including {}s). Hell, you can add a line of commentary above it and still save 2 lines if you do it that way.
is imho just as clear as the 4-line version (although the line of commentary is not necessary at all, the line is pretty self-explanatory. Better commentary would be a reminder why breaking out of the mouse handler is the proper functioning of the program). | ||
![]()
BisuDagger
Bisutopia19155 Posts
On June 15 2015 22:33 Acrofales wrote: Restructure your program to require less of these checks? Or suck it up. Honestly, I can't think why you wouldn't just put all of that check and return statement on a single line (including {}s). Hell, you can add a line of commentary above it and still save 2 lines if you do it that way.
is imho just as clear as the 4-line version (although the line of commentary is not necessary at all, the line is pretty self-explanatory. Better commentary would be a reminder why breaking out of the mouse handler is the proper functioning of the program). As I mentioned in my edit. For at least this project I'm matching a coding standard for another company. I'm the lead programmer within my company and I 100% agree with you, but the other companies guidelines are "always use brackets for readability" and "Don't comment code unless absolutely necessary to reduce clutter.". I've done really well in my profession by following the technical outlines of a company (even if you disagree) instead of fighting the system. | ||
Manit0u
Poland17191 Posts
Instead of doing:
You can do that:
Still not pretty, you could perhaps think of making some custom constructors or event listeners, injecting the stuff and such to maybe bypass some of the clutter. Another way could possibly be wrapping the IsUISelected() method into a method that checks it and throws an exception. Then you could possibly use try/catch stuff to do the work. | ||
| ||