My dad's a senior .Net developer and he just told me that some of his interviewees fail the fizzbuzz test???

My dad's a senior .Net developer and he just told me that some of his interviewees fail the fizzbuzz test???

there's literally nothing to it, I just wrote this up in 5 minutes, is it wrong? Am I retarded?

public static void main(String[] args) {
for (int i = 1; i

do your homework yourself pajeet

lol i'm just really baffled that some people fail this. I don't get it, what's so difficult about it that people would actually fail it. The people who just got their bachelors or some shit in CS fail this?

Why don't you go ask your dad.

he told me he doesn't understand why either

your implementation could be simpler btw you're not as smart as you think you are

That's not a correct solution, retard. Go tell your dad he failed as a parent

this is not about me being smart because I'm not. I'm just trying to understand why this is difficult for some people.

wait really? shit lol

What the hell is this fizzbuzz thing, and why does Sup Forums seem to be talking about it a lot in the past couple weeks?

It's summer

It's yogic bugs Vader joining cars bumpy chance Krugerrand bucks joining hard bunch ketch bumps.

Aah. I also read the actual code OP posted and got the gist. Does there have to be a '. ' before the fizz/buzz?

Also, should the non fizz/buzz numbers be displayed? Because OP doesn't seem to have that...

Yes, 100%... >_>

You have to be 18 to use this website

Which I am.

i just did that for readability

fine, here go, here's another implementation

for (int i = 1; i

Well, then you're a fucking adult. Solve your own problems. Use Google.

Still broken, and unreadable

But then I wouldn't be having such a lovely discussion with people like you.

you got me on the unreadability, but how the fuck is it broken?

Isn't the question:
print numbers from 1 to 100. if the number is a multiple of 3, print Fizz, if the multiple is 5 print Buzz, and if it is of both, print FizzBuzz?

>how the fuck is it broken?

Congrats, you just failed the interview. You're supposed to explain to ME why it works

No, it's not.

Well then what is it? I'm googling the question and it's exactly that

For each number, 1 to 100, print Fizz if divisible by 3, or Buzz if divisible by 5, or FizzBuzz if divisible by 3 and 5, else print the number.

that's exactly what I said

So you can't read or write?

You said

>print numbers from 1 to 100

Oh, by the way, you failed the janitor interview by this point too

I see what you're saying. So is this really how people fail the interview?

Yes. It's not so much about the question, but how you answer it. How do you think? How do you problem solve? Do I want to work with you 8 hours a day?

Wow, never thought about it like that. I'm entering my sophomore year at uni, so I don't have any work experience. Thanks for the insight

>I'm entering my sophomore year at uni, so I don't have any work experience.

>I'm entering my sophomore year at uni, so I don't have any work experience

That's not good. I had two internships by that point. You better ask your dad whose dick you need to suck at his company to get a job.

Were they two unpaid internships?

No. First one was $17/hr, second one was $38/hr

>mfw making $12 an hour for my internship

fuuuuuuuuuck

I'm not employed in a technology field (well, it uses technology, but I'm not writing or maintaining the infrastructure), and I learned this in a few minutes on CodeAcademy a long time ago. Are you telling me there's people who are supposed to be "programmers" getting INTERVIEWS and they can't come up with this? That's pretty hilarious that they'd even make it to an interview.

It's better than nothing

What the hell? What are you studying? If it's CS that's obscenely low (assuming US or Canada). you should probably be making closer to $20/hour. More if it's a good company and/or in a high-expenses area like the bay area.

Do they cover your costs of living with a housing stipend at least?

Do unpaid internships even exist in CS/engineering? Every one I see is $15-45/hour. I keep seeing people talk about internships as if they're unpaid in general. Is this for biology/etc, or are there actually unpaid programming ones? Why would anyone do them?

use haskell, it's better

fizzbuzz n | n % 15 = "FizzBuzz"
| n % 3 = "Fizz"
| n % 5 =" Buzz"
| otherwise = show n
where % = mod

main = mapM_ (putStrLn . fizzbuzz) [1..100]

> == 0
How about you use a real man's language

#include

int main(int i)
{
char *s[] = {"%d\n", "Fizz\n", "Buzz\n", "FizzBuzz\n"};
for (i=0; i++ < 100;)
printf(s[!(i % 3) + (!(i % 5) * 2)], i);
return 0;
}

>his language has shitty typing
>his language thinks 0 is a False and anything else is True

>sir, this implementation is too arcane
>im afraid we need someone who works with others and keeps their code readable and efficient
>we do have this janitor position open though, you want it?

It's my first day programming and I've noticed that python is clean and minimalistic compared to other languages.

count = 0
while (count < 101):
if (count % 5) == 0 and (count % 3) == 0:
print "FizzBuzz"
count = count +1
elif (count % 3) == 0:
print "Fizz"
count = count + 1
elif (count % 5) == 0:
print "Buzz"
count = count +1
else:
print count
count = count + 1

quality copy pasta that I can understand.

see for concise

>My dad

Stopped reading. Come back when you actually know what you're talking about, and not your dad's second hand experience.

>main = mapM_ (putStrLn . fizzbuzz) [1..100]
is that an actually joke? I feel like using Haskell is the same as being able to write in hieroglyphics... sure it has historical value but it's not worth using anymore.

LOOK
RETARDS
IF YOU TYPE OUT
THE STRING

"FIZZBUZZ"

YOU HAVE FAILED.
THE END.

but I need to put a newline, dumfuck,
and also, testing every if clause a shit

its pretty straightforward if u know haskell

its like me criticizing the syntax of a language I don't know

kys, scrub

mfw it clicked.

thats like saying C is hieroglyphics when I don't understand what the ? dods
kill yourself you nigger faggot
can't believe I share a board with retard like these

you should use

IF YOU HAVE TO
WRITE
"FIZZ"
THEN
"BUZZ"
THEN
"FIZZBUZZ"
BY HAND

YOU HAVE FAILED.
99% OF G FAILS AT FIZZBUZZ

anyone can do that
but newlines are needed
also, stop writing in caps lock u autist

more like
for x in xrange(1, 101):

fizz = not x % 3
buzz = not x % 5

if fizz and buzz :
print "FizzBuzz"
elif fizz:
print "Fizz"
elif buzz:
print "Buzz"
else:
print x

APPARENTLY NOT

>how to print out 34, by user

>print 3
>pause
>then print 4

it's like no one on this god damned board can program

?

why r u afraid of fizzbuzz?
its more readable

also, nowt ur implementation, genius

...

refer to here's a challenge
make a fizzbuzz script
where you don't have to write "fizzbuzz" by hand.

there. Now you can program.

>5 minutes
>not 1 minute
Yep. Retarded is the word.

>not an argument
>not related to topic
>butthurt

deal with it fucko, you can't program your way out of a paper bag

Although to be honest I only just realized this now.

autismo is alive

>haha lol, these fucking idiots can't into my ideal fizzbuzz
>see my implementation, it's much better, took 4 hours to write though
>it's not as readable too, but who cares, I win with my arcane implementation
>hahaha, those loosars

I never figured out the code tags, have pity on me.

still no argument

we're talking about programming here, you obviously can't program, so I understand your inferiority complexes

if you waste time handcoding a case which your script can manage naturally, you failed

you're on the level of people who don't understand loops and write 1 through 100 cases by hand

see
its easy as fuck.

// v.1
final String[] FB = {"Fizz", "Buzz"};
for(int i = 0; i

A lot of startups in the UK exploit CS students by offering free internships. They tell you that you get a better learning experience and more independence yo rope you in.

there you go. You can program. You are not wasting time typing out something your program is printing out anyway.

// v.4
for(int i = 0; i < 100; i++)
{
String outStr = "";
outStr += (i % 3 == 0) ? "Fizz": "";
outStr += (i % 5 == 0) ? "Buzz": "";
outStr = outStr.isEmpty() ? String.valueOf(i): outStr;
System.out.println(outStr);
}


// v.5
for(int i = 0; i < 100; i++)
{
boolean isNotFizzBuzz = true;
if (i % 3 == 0)
{
System.out.print("Fizz");
isNotFizzBuzz = false;
}
if (i % 5 == 0)
{
System.out.print("Buzz");
isNotFizzBuzz = false;
}
if(isNotFizzBuzz) System.out.print(i);
System.out.println();
}

what the fuck are you even doing?

Fizzbuzzing

>no i % 15
>extra line
>doesn't even output what is desired
its always, number and fizz or buzz or none
ur a faggot, u preach about muh inaneness and fail to realize you write extra inane crap by trying to achieve ur ideal shitty version that doesn't even output the desired

>no i % 15

Are you legitimately retarded?

Can you read the code?

It's pretty clear what I'm doing: output "Fizz" if divisible by 3, "Buzz" if divisible by 5, "FizzBuzz" if both, the number if neither.

oh so you want to print all the numbers? remove first and last condition, keep the inner statements, bam, done.

that's bullshit senpai

it makes sense if you're thinking in terms of a program that literally does nothing but fizzbuzz, and that's all it will ever do, but what if, for instance, you want to print something ELSE if the number is divisible by 3 and 5?

then you have to rewrite the program in exactly the same way as if you wrote your code with the string "fizzbuzz" to begin with. all because you had to be a super cool efficient programmer with your perfect fizzbuzz implementation.

>its always, number and fizz or buzz or none

Or you know, it might be fizzbuzz.

seems like you are, considering its better than if i % 3 && i % 5
again, u preach about inaneness but write this shit
you also use python
so no wonder that u think you know how to program

You retard that wasn't the question
Nobody cares about your programming skills if you can't do what you're asked to do

obviously u don't know what the original problem is
the problem they ask in interview questions, you know

I know what fizzbuzz is, cuck

>but what if, for instance, you want to print something ELSE if the number is divisible by 3 and 5?

except that's not the case. The case is fizz if by 3, buzz if by 5.

There's no 15 mentioned in the task.

a is fizz
b is buzz
you don't need to figure out what a+b is

fizzbuzz doesn't exist you idiot. It's a combination of fizz and buzz

that's not my code Tayquan. You are legitimately retarded it seems.

>you had to be a super cool efficient programmer with your perfect fizzbuzz implementation

Isn't that exactly the point? Isn't that the test?

>that wasn't the question

except it was

fizz if by 3
buzz if by 5
fizzbuzz if by both

All accomplished. That user just got the job and you're left wondering why your manual write in case isn't as good as their dynamic one.

you're still a hypocrite because it's inane
its also inefficient

beat thjs
for i in range(1,101):
print("FizzBuzz"[i*i%3*4:8--i**4%5] or i)

i = 15
printf(s[!0 + !(0 * 2)], i) = printf("FizzBuzz\n", i);
the fuck?

>you don't need to figure out what a+b is

you don't need to be a genious to figure out*

and n if none, cuck

static void Main(string[] args)
{

string[] fizzText = new string[] { "1", "2", "Fizz", "4", "Buzz", "Fizz", "7", "8", "Fizz", "Buzz", "11", "Fizz", "13", "14", "FizzBuzz", "16", "17", "Fizz", "19", "Buzz", "Fizz", "22", "23", "Fizz", "Buzz", "26", "Fizz", "28", "29", "FizzBuzz", "31", "32", "Fizz", "34", "Buzz", "Fizz", "37", "38", "Fizz", "Buzz", "41", "Fizz", "43", "44", "FizzBuzz", "46", "47", "Fizz", "49", "Buzz", "Fizz", "52", "53", "Fizz", "Buzz", "56", "Fizz", "58", "59", "FizzBuzz", "61", "62", "Fizz", "64", "Buzz", "Fizz", "67", "68", "Fizz", "Buzz", "71", "Fizz", "73", "74", "FizzBuzz", "76", "77", "Fizz", "79", "Buzz", "Fizz", "82", "83", "Fizz", "Buzz", "86", "Fizz", "88", "89", "FizzBuzz", "91", "92", "Fizz", "94", "Buzz", "Fizz", "97", "98", "Fizz", "Buzz" };

foreach (string fizz in fizzText) { Console.WriteLine(fizz); };
}

>because it's inane

just because you can't comprehend something doesn't mean it's unintelligible.

>it's also inefficient

Go ahead fuckwad. Scale that anons code then scale yours. See which one executes quicker.

Your bait is not much worse than all the "programmers" who write in "i%15==0?'fizzbuzz'" shit. It's all the same, wasting time.

but you still support his code, which is inane, and that's what u preach about
kill yourself u insufferable faggot

#include

int main()
{
int i;
for(i = 1; i

>his code, which is inane

his code and some of these are the only working solutions here

so you can't even follow your own made up instructions?
no one asked you to print a tab
it's FizzBuzz not fizzbuzz
it doesn't output the number if it's neither Fizz nor Buzz

and that code is an inefficient piece of shit
star by indenting the 2nd and 3rd if () and get rid of the last if () but keep the empty print

>sorry user, the problem said to output n if by none
>u can't get his job, I'm sorry

>it doesn't output the number if it's neither Fizz nor Buzz

who gives a shit, that's an overlook that can be fixed.

thinking that literally typing in a case instead of using the code to solve is somehow efficient can not be fixed.

I don't know that language but isn't that what the first printf does?

indeedily it is, its C, worth picking up imo.

works too

his code is ineficient
it tests too much
also, readability is much preferred than the 0.00002 second increase u cuck
clearly something u don't know because uvee never Been hired