search results matching tag: programmer

» channel: learn

go advanced with your query
Search took 0.001 seconds

    Videos (303)     Sift Talk (18)     Blogs (15)     Comments (649)   

FizzBuzz : A simple test when hiring programmers/coders

AeroMechanical says...

First piece of advice. "Clever" code is usually bad code. If I saw that line of code in a code review, I would have to have words with the programmer.

More seriously, it depends where you are. There area lot of jobs right now. If by no professional experience you mean no internship experience, that can make things harder but isn't a huge obstacle at all (the experience itself doesn't often count for much, it's really more of a "why didn't you get an internship?" sort of thing). A good way to start in that case is to look for contract-to-hire positions, possibly through a recruiting/placement agency (look for ones that specialize in engineers). They generally know what they are doing, and will work hard to find a good place for you and they are genuinely on your side. We like to use these where I work because you can hire someone on a three month or whatever contract, and if it doesn't work out, it's a relatively painless separation for everyone (ie, you weren't "fired" you just finished the term of your contract). It's easier to get your foot in the door through a CTH, and then you just have to diligently and prove yourself.

As for preparing for real work (the actual coding part), that's harder. Since you really don't know what you'll be doing, it's not easy to prepare for it. You really have to learn software engineering on the job, and companies hiring entry level talent know that. That said, if you have a particular field in mind, looking for *good* open source projects along the lines of what you want to do and studying the source is good idea. Exposure to real-world, non-academic code is very useful. Getting involved and maybe becoming a contributor is a great idea (and looks good on a resume and gives you something to talk about in an interview). Working on personal hobby projects is a good thing too (though not as good as working on larger projects with other people), which again, gives you something to talk about in an interview. Keep your hand in. Have something to talk about at your interviews.

There are some good books. "The Pragmatic Programmer" by Hunt/Thomas is an excellent general-purpose programming practices book (more about mindset and approach and good patterns than technical details), and I can't recommend it enough. There are some others, but they escape me at the moment. Google is probably your friend here. If you can find a second hand set of Knuth for a reasonable price, buy it up. It's not even remotely worth actually reading, but it looks good on a shelf.

Good luck and don't sweat it. You have a degree that makes you very employable. You'll find something that you like without a doubt. If you're lucky it will be your first job, if not, no big deal--move on to the next thing.

entr0py said:

I'm in the strange position of just having finished a CS degree, with no professional experience as a programmer. Any advice on interviews or how to prepare for real work?

Also someone in the YouTube comments got it down to 1 line of JS, clever bastard :


for(i=0;i<1e2;console.log((++i%3?"":"Fizz")+(i%5?"":"Buzz")||i));

FizzBuzz : A simple test when hiring programmers/coders

entr0py says...

I'm in the strange position of just having finished a CS degree, with no professional experience as a programmer. Any advice on interviews or how to prepare for real work?

Also someone in the YouTube comments got it down to 1 line of JS, clever bastard :


for(i=0;i<1e2;console.log((++i%3?"":"Fizz")+(i%5?"":"Buzz")||i));

FizzBuzz : A simple test when hiring programmers/coders

ChaosEngine says...

I got distracted by all the blinking lights. Where is he... the Death Star control room? Frankly, I'm mildly jealous that my work place does not look as awesome as that.

As to the test itself, it's way too basic. I would expect any beginning programmer to be able to write that with only a few hours training. You could make it slightly more challenging by adding some arbitrary restrictions like "don't use a for loop" (i.e. use recursion) but those are pointless academic wankery.

I actually wrote tests and hired a coder earlier this year. This test wouldn't have got you an interview, never mind a job.

You want to impress me? Start out by writing a test that verifies the output. I don't care if it works, I want to know you can PROVE it works. While you're at it, if I see a console.log or a printf or a cout or any kind of output in your algorithm (unless it's just there for debugging)... instant fail. Learn to separate presentation from logic.

Finally, if you REALLY want to impress me, make it scale. 100 numbers? Meaningless. 1 million? 194ms on my machine.
Write me a version that can do several billion and take advantage of whatever threads/cores are available,

FizzBuzz : A simple test when hiring programmers/coders

eric3579 says...

Where my computer programmers/coders at?

Also does this question actually ever get asked and if so don't coders know it might be coming and are prepared to give a perceived best answer?

From road rage (with gun) to respect

Tabs v(ersu)s Spaces from Silicon Valley S3E6

MilkmanDan says...

I understand where you're coming from, but I stand by my previous posts.

Full disclosure, I never got professionally employed as a programmer / coder / software engineer. However, my Bachelors Degree was in CS, and I have many friends working in the field.

In the show Silicon Valley, Richard Hendriks is working for a large corporate entity but has an idea / personal project that he ends up spinning into a new company. He is trained as a software engineer (CS), NOT with any business or management background (MIS), yet he becomes sort of the de-facto boss / CEO (at least early in the show). He hires a small team to help him develop his product.

Given that scenario, I think the show portrays things very accurately or at least completely plausibly. He's a coder, not a manager. Programmers may understand the importance of formatting and style standards, but at least tend to not have the correct personality type to be comfortable with formally dictating those standards to a team (an activity which would generally be more in line with an MIS background).

Also, his company is small -- just a few other programmers. They are all specializing on different components of the product. So they generally aren't working on each other's code. Standards for function arguments / helper functions / etc. would have to be agreed upon to get their individual components to interact, but that is a separate issue from tabs vs spaces. It would be wise to set a style and naming convention standard and have everyone conform to it, I agree completely. But Richard isn't built for the manager / CEO position, so he either fails to recognize that or doesn't feel comfortable dictating standards to his team.

One more thing to consider is that he (Richard) essentially is the product. He's the keystone piece, the central figure. He's John Carmack, Linus Torvalds, or Steve Wozniak. Even in a very large team / corporate environment, I'd wager that more often than not the style standards that end up getting set tend to fall in line with whatever those key guys want them to be. Don't touch an id Software graphics engine without conforming to Carmack's way, or the Linux kernel without conforming to Torvald's standards. Especially if they are building something new from scratch -- which is again true in the Silicon Valley show scenario.

The show isn't a documentary on how to properly run a startup company in the real Silicon Valley, but it is generally accurate enough that it has a lot of nuances that people with a programming background can pick up on and be entertained by (even people that don't actually work professionally in the field like me). And more important, the general feel of the show can be entertaining even for people that know absolutely nothing about programming.

Buttle said:

I have to disagree with this. If you're working with even a team of two, you have to edit someone else's source code, and tabs v spaces has to be agreed upon. There are a lot of other, more entertaining questions of formatting that have to be settled upon, not to mention how to name things: CamelCase versus under_scores.

Any halfway competent programmer figures out the local standards by observation and follows them. Anything else is an indication that she just doesn't give a shit about getting along with co-developers.

Tabs v(ersu)s Spaces from Silicon Valley S3E6

Buttle says...

I have to disagree with this. If you're working with even a team of two, you have to edit someone else's source code, and tabs v spaces has to be agreed upon. There are a lot of other, more entertaining questions of formatting that have to be settled upon, not to mention how to name things: CamelCase versus under_scores.

Any halfway competent programmer figures out the local standards by observation and follows them. Anything else is an indication that she just doesn't give a shit about getting along with co-developers.

MilkmanDan said:

Basically, I think that tabs vs spaces is completely a personal preference issue if you're working alone OR on a small team that don't interact with each other's code much. And even on a large team, either choice is fine BUT it becomes important to conform to the standards of the team as a whole.

Tabs v(ersu)s Spaces from Silicon Valley S3E6

MilkmanDan says...

@lucky760 -
I still think Judge is actually presenting the situation pretty accurately. If you look up online forum posts about tabs vs spaces, the file size thing is brought up as a pro for tabs very regularly.

While it is technically true, you're right that it doesn't make much sense because the difference is *tiny*, so conforming to the standard of wherever you are working is vastly more important.

BUT, that doesn't stop individual programmers from being (irrationally) passionate in their preferences.

Another dynamic that is (correctly) displayed in the show in my opinion is the difference between a big corporate environment, working as an individual in a large team of programmers as compared with having a project that starts out as a the brainchild of one person and grows into a small team.

The show is about the latter. In that scenario, a programmer / software engineer ends up trying to also be a manager of a team, in spite of the fact that he isn't really built for it. In a big corporate environment, they are well aware that style issue conflicts can turn into big time wasters unless they set out guidelines clearly at the outset. But that sort of micro-managing is NOT what a pure engineer type is comfortable doing.

Basically, I think that tabs vs spaces is completely a personal preference issue if you're working alone OR on a small team that don't interact with each other's code much. And even on a large team, either choice is fine BUT it becomes important to conform to the standards of the team as a whole.

Tabs v(ersu)s Spaces from Silicon Valley S3E6

Buttle says...

In my experience as a working programmer, tabs v spaces is a question of editor configuration, not typing. So, no, I don't believe he could hear it.

Conforming to the local convention on tabs v spaces isn't being anal, it's showing you want to keep your job. In particular, throwing in tabs where they are not expected results in unreadable hash.

MilkmanDan said:

I thought it was pretty clear in the show that he knew she was using spaces instead of tabs because of the sound of her repeatedly hitting the spacebar at the beginning of each line (which depending in your editor/IDE might be done automatically).

They are in a small environment, (loosely?) collaborating on code. He's anal about tabs vs spaces, and can tell that she's using the "wrong" one because of the repetitive (and annoying from his perspective) sound.

Put programmers together in a confined space, and they'll grate on each other over style issues / noise levels / music / whatever. I find the show extremely accurate in portraying the general atmosphere or feel of software development, if occasionally accenting or misportraying some details in the interest of making it good TV.

Tabs v(ersu)s Spaces from Silicon Valley S3E6

MilkmanDan says...

I thought it was pretty clear in the show that he knew she was using spaces instead of tabs because of the sound of her repeatedly hitting the spacebar at the beginning of each line (which depending in your editor/IDE might be done automatically).

They are in a small environment, (loosely?) collaborating on code. He's anal about tabs vs spaces, and can tell that she's using the "wrong" one because of the repetitive (and annoying from his perspective) sound.

Put programmers together in a confined space, and they'll grate on each other over style issues / noise levels / music / whatever. I find the show extremely accurate in portraying the general atmosphere or feel of software development, if occasionally accenting or misportraying some details in the interest of making it good TV.

Buttle said:

The film, however, makes no sense, because the only way you can find out about a fundamental disagreement on spaces v tabs is by opening someone else's file in your editor, and finding the indentation all messed up. It's not something you can tell by looking over a shoulder.

Tabs v(ersu)s Spaces from Silicon Valley S3E6

MilkmanDan says...

(**EDIT** hmm, code HTML tag doesn't seem to allow whitespace to show at the beginning of lines, so I'm replacing spaces with _underscores_ in the pseudocode below)

Code uses spaces or tabs to visually distinguish the flow of the program, what code belongs to what functions / loops / whatever.

Here's some C-style "pseudocode" that should get the idea across:

void function fizzbuzz {
__for (i = 1; i <= 100; i++) {
____set print_number to true;
____If i is divisible by 3
______print "Fizz";
______set print_number to false;
____If i is divisible by 5
______print "Buzz";
______set print_number to false;
____If print_number, print i;
____print a newline;
__}
}


The braces { } show the beginning and ending of a "function" (essentially one of potentially many self-contained algorithms in a program) and the beginning and ending of a "for loop" (that will repeat the code inside it some number of times). And the "if" statements will only perform the stuff after them IF the test they perform evaluates to true.

So in that pseudocode, there's sort of 4 tiers or things going on. First is the function (named "fizzbuzz"). Since functions are kind of the most basic structural unit of the code, they are on the far left -- not indented at all. Sorta like Roman Numerals in an outline.

Then, the actual content of that function (the code that makes up its algorithm) is set a consistent amount of space to the right to make it clear that it is contained inside the function. That can be done with *1* tab, or some consistent amount of spaces so that it lines up. The only thing in that tier is the "for loop" and the braces that show its beginning and end.

Then the content of the for loop is set a bit further to the right (with another space or another set number of spaces). All of the "if" statements are at that 3rd tier level, along with a bit more code at the beginning and end. Then, the actual content of the if statements is set one more tier to the right to help distinguish that it will only run IF the conditions are met.

That pseudocode uses spaces for all of the tiering -- 2 spaces per tier. I'm a tab person like the guy Richard in the video, because it seems easier to press tab once per tier than hitting the spacebar 2/3/4 times per tier. But it really is just a personal preference issue, because as he said in the video, by the time the code is compiled (turned into an executable file that the computer can run) the final result will be the same whether the programmer used spaces or tabs.

But like with many things, Silicon Valley really hits the nail on the head here. Programmers tend to be very set in their ways and anal about their style preferences for code. If we have to go through someone else's code that doesn't follow our style conventions exactly, it kinda tends to throw us out of whack. To make an analogy with something less nerdy, consider how annoying it can be when someone borrows your car and you have to adjust the seat / mirrors / radio stations etc. when you get back in.

eric3579 said:

Don't think i've ever used a tab outside filling in a form or playing video games. Does the tab thing have more to do with writing code?

Ahoy's Iconic Arms S3E6: P90.

MilkmanDan says...

The first time I remember learning anything about a (fictionalized) version of this weapon was in Goldeneye for N64. But I remembered it (known as the RC-P90) having an 80 round capacity in that game.

That didn't set off any alarms for me, but an interesting note was made here:
The FN P90 only holds 50 rounds in its magazine. It is speculated that the RC-P90's 80 magazine is actually a mistake due to directly giving the RC-P90 0x50 (that is, 80 in hexadecimal) bullets rather than 0x32 (50 in decimal).

Kind of a funny quirk for a CS nerd like me. Get your hex right, programmers!

What if money was no object?

noims says...

I've heard this idea espoused many times: follow your passion. An alternative that I like and follow (but not in a social media way) is 'become useful'. Find a useful skill or set of skills, become good at them, contribute to society, and get rewarded in return. This reward can come in several forms such as money, time, or convenience.

Of course, the best way to get good at something is repetition/experience, and the least painful way to get that is to pick something you enjoy doing, so in that respect I agree with the video.

I love programming. I got reasonably good at it. However, working as a programmer sucked much of the joy out of it, so I found a role where I could use that experience but not keep coding. I got good at that, and found a better niche that combined the two skills. I then did the same again. I now have a very nice set of very useful and quite rare skills, and have plenty of options.

I can't find where I first heard this idea - there are a lot of vidoes out there saying this - but there's a good version at https://videosift.com/video/Is-Follow-Your-Passion-is-bad-advice.

Descent: Underground - In Development Trailer

newtboy says...

Looks pretty, but without my thrustmaster joystick and throttle and their combined 56 programmable macro buttons, I'm curious how the controls will work.
Also, is this multiplayer only? The gameplay shown looked like it.

Westworld: What Makes Anthony Hopkins Great

entr0py says...

That made me realize how the nudity in the show is central to understanding what it is like to be a 'host'.

To the guests they're sex dolls. To the engineers and programmers, they are robots with no sexuality or shame, more like sculptures than people, so having them wear clothes while doing diagnostics is silly.

And then we saw in the last couple episodes that to the repair technicians they're more like cadavers than they are like robots, since they're always a powered down mess by the time they get to them.

So if you look at the experience of Maeve she gets to be a whore part of the day, a lab experiment part of the day, and a dead person at night.

Bring on the robot uprising, kill all humans.

RedSky said:

Yep, and as a result each of the stories is progressing at a snail's pace. Also while the premise is interesting I feel the dialogue tries too hard to be deep and meaningful.

Also the nudity is absurdly gratuitous. I get they want to convey the dehumanised aspect of the hosts and that the park is basically a harem to satisfy the carnal pleasures of the wealthy, but they've made that point an umpteen times too many already.

Acting's solid though and production values are obviously insanely high.



Send this Article to a Friend



Separate multiple emails with a comma (,); limit 5 recipients






Your email has been sent successfully!

Manage this Video in Your Playlists

Beggar's Canyon