Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "fizzbuzz"
-
I challenged my girlfriend (and myself) for the FizzBuzz thingy. I did it in js (because I suck at js) and she in Java. I never saw such a way to write FizzBuzz. Turns out she forgot there is a thing called modulo operator.
I know there are more elegant ways to solve it! Feel free to post your favorites.46 -
During my first-ever technical interview, the interviewer asked me "Do you know the FizzBuzz problem?"
"Uhh, not really." (I was just thinking ok this problem has a name, must be some algorithm problem)
"So the problem is basically to give you the numbers 1 to 100, if the number is divisible by 3, print 'Fizz', if divisible by 5, print 'Buzz', if divisible by 3 and 5, print 'FizzBuzz'. For other numbers just print out the number itself."
After hearing the problem, I felt so many ideas popping out of my stressed brain.
I thought for a bit and said "ok, so if the digit sum of a number is a multiple of 3, then the number is divisible by 3, and if the last digit is either 0 or 5, it's divisible by 5."
Then I started to code out my solution until the interviewer said "there's an easier solution. Can you think of it?"
This stressed me out even more.
I thought for a bit and said "well, starting from 3, keep a counter that records how many iterations are done after 3. When the counter hits 3, that number would be divisible by 3 for sure. Should I try this solution?"
The interviewer said "Sure." So I started again.
However, I struggled for about another 3min until I realized this solution is a lot harder to implement. The interviewer probably saw my struggle too.
This was the point where he stepped in and asked me "Ummmm there's an easy way of solving this. Have you heard of the MODULO OPERATOR?"
In sheer embarrassment, I finished the code in 30s.
Of course, there was no further question after this, and I felt the need to seriously reevaluate my intelligence afterwards.15 -
About 18 months ago my non-technical Manager of Applications Development asked me to do the technical interviews for a .NET web developer position that needed to be filled. Because I don't believe in white board interviewing (that's another rant), but I do need to see if the prospective dev can actually code, for the initial interview I prepare a couple of coding problems on paper and ask that they solve them using any language or pseudo code they want. I tell them that after they're done we'll discuss their thought process. While they work the other interviewing dev and I silently do our own stuff.
About half way through the first round of technical interviews the aforementioned manager insisted we interview a dev from his previous company. This guy was top notch. Excellent. Will fit right in.
The manager's applicant comes in to interview and after some initial questions about his resume and experience I give him the first programming problem: a straightforward fizzbuzz (http://wiki.c2.com/?FizzBuzzTest). He looked as if the gamesters of Triskelion had dropped him into the arena. He demurs. Comments on the unexpectedness of the request. Explains that he has a little book he usually refers to to help him with such problems (can't make this stuff up). I again offer that he could use any language or pseudo code. We just want to see how he thinks. He decides he will do the fizzbuzz problem in SQL. My co-interviewer and I are surprised at this choice, but recover quickly and tell him to go ahead. Twenty minutes later he hands me a blank piece of paper. Of the 18 or so candidates we interview, he is the only one who cannot write a single line of code or pseudo code.
I receive an email from this applicant a couple of weeks after his interview. He has given the fizzbuzz problem some more thought. He writes that it occurs to him that the code could be placed into a function. That is the culmination of his cogitation over two weeks. We shake our heads and shortly thereafter attend the scheduled meeting to discuss the applicants.
At the meeting the manager asks about his former co-worker. I inartfully, though accurately, tell him that his candidate does not know how to code. He calls me irrational. After the requisite shocked silence of five people not knowing how to respond to this outburst we all sing Kumbaya and elect to hire someone else.
Interviews are fraught for both sides of the table. I use Fizzbuzz because if the applicant knows how to code it's an early win in the process and we all need that. And if the applicant can't solve it, cut bait and go home.
Fizzbuzz. Best. Interview. Question. Ever.6 -
Newcomer: I can do fizzbuzz in 6 lines of code
Experienced: I can do fizzbuzz in 3 lines of code
Professional: I can do fizzbuzz in 1 line of code
Enterprise: you did not create the user epic for this problem, I can't accept these solutions until you have done this. Please speak with Mike on getting this properly setup. I expect a full report of this by Monday.
Them: but it's Friday...
Enterprise: Get it done. I am not paying your overtime either
https://github.com/EnterpriseQualit...8 -
>>>>>>>>>>>>>>>>>>>>>>><<+>+>+++>>>+++++>>>+>++++++++++>++++++++++>++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++>>>>>>>>>>>>>>>>>+++++++[<<<<<++++++++++>>>>>-]+++++++++++[<<<<++++++++++>>>>-]<<<<----->>>>+++++++[<<<++++++++++>>>-]<<<---->>>++++++++++++[<<++++++++++>>-]<<--->>++++++++++++[<++++++++++>-]<++<<<<<<<<<<<<<<<<<<<<<<[>>><<[>><[><<<<<<<<<>[-]+>[-]<<[>>>>>>>>><<<<<<>[-]>[-]<<[>+>+<<-]>[<+>-]>[>>>>.>.>.>.<<<<<<<[-]]>>>><<<<<<<<<>-<[>>+<<-]]>>[<<+>>-]<[>>>>>>>>.>>>>>>>>>>>>>>>.>.>>>..<<<<<<<<<<<<<<<<<<<<<<<<<>[-]>[-]<<[>+>+<<-]>[<+>-]+>[<->[-]]<[>>>>>>>>>>>>>>>>>>>>>>.>.>..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<[-]>>>>>>>>>>><<<<<-]>>>>><<<<<<<<<+++<++++++++++[-]+>>>>>>>>>><<<<<<<<-]>>>>>>>><<<<<<>[-]+>[-]<<[>-<[>>+<<-]]>>[<<+>>-]<[<+++++>>>>>><<<<<<<<<<[<[>>>>>>>>>>>.>>>>>>>>>>>>>>>>>.>.>..<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<-]+>-]+>>>>>>>>>><<<<<-]>>>>>>>>+<<<<<<<<<<<<->>>>>>>>><<<<<<->>>>>><-]++++++++++>>>>----------<+<<<<-]++++++++++>>>>----------<+<<<<-]>>>.>>>>>>>>>>>>>>>>>.>.>..<<<<<<<<<<<<<<<<<<<<<6
-
There's always that great feeling of accomplishment when you finish a project.
Even if it is only 23 lines.
And FizzBuzz...
But it's in a new language and you mostly did it with your own logic!4 -
>Be me
>Notice cute girl in college
>Won't work because reptilian brain too stupid
>Girl needs help studying C
>Teach her C because I'm an idiot
>She turns out to be a bigger idiot, and has problems grasping FizzBuzz problems
>Thoroughly turned off
>Help her get 80% in semester end exam
>Breathe a sigh of relief, get back to usual schedule
>Girl admits to liking me
>Said that girl and I are not on similar wavelengths
>Girl asks me if I think she's stupid, and now is angry with me
>What did I do?17 -
I can't pass a whiteboard interview to save my life. I did pretty well on a fizzbuzz whiteboard a few years ago but in reality in is fairly straightforward. I am interviewing right now and the more I practice and study I realize my teacher in college was right 25 years ago. I should never have become a programmer. I am a likable and fairly competent coder but I am completely overwhelmed and stressed.14
-
anytime anyone asks me to write a solution to fizzbuzz - i do it in brainfuck because even if i screw up...no one knows. :P
++++++++++[>++++++++++<-]>>++++++++++>->>>>>>>>>>>>>>>>-->+++++++[->++
++++++++<]>[->+>+>+>+<<<<]+++>>+++>>>++++++++[-<++++<++++<++++>>>]++++
+[-<++++<++++>>]>>-->++++++[->+++++++++++<]>[->+>+>+>+<<<<]+++++>>+>++
++++>++++++>++++++++[-<++++<++++<++++>>>]++++++[-<+++<+++<+++>>>]>>-->
---+[-<+]-<[+[->+]-<<->>>+>[-]++[-->++]-->+++[---++[--<++]---->>-<+>[+
+++[----<++++]--[>]++[-->++]--<]>++[--+[-<+]->>[-]+++++[---->++++]-->[
->+<]>>[.>]++[-->++]]-->+++]---+[-<+]->>-[+>>>+[-<+]->>>++++++++++<<[-
>+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]>>[-]>>>++++++++++<[->-[>+>>]>[+[-<+>]>
+>>]<<<<<]>[-]>>[>++++++[-<++++++++>]<.<<+>+>[-]]<[<[->-<]++++++[->+++
+++++<]>.[-]]<<++++++[-<++++++++>]<.[-]<<[-<+>]+[-<+]->>]+[-]<<<.>>>+[
-<+]-<<] -
Today in programming class.
FizzBuzz on a sheet of paper. I mean, of course I aced the one thing I do in every language I learn. :)
Our teacher then proceeded to talk about the fact that some people, even having studied Computer Science, were unable to make a FizzBuzz program.
w h a t ?11 -
So... the company I work started a selective process to hire some interns. Since we had a lot of applications and little time, they created a simple test with coding, theory and interpretation questions (9 questions in total) to filter the best candidates then focus on the better ones.
One of the questions (the only one the candidate would actually code) was asking to write a simple FizzBuzz function. The idea was to check the quality of the code and clever/creative ways to solve the problem.
Turns out ONE of the candidates were able to write the function. So now, this question is not being used to evaluate the quality of the code; instead, it's being used to check if the candidate knows how to code at all.
Such disappointment...
-----
PS.:
The idea to put this question on the test was heavily based on the arguments of this video: https://youtube.com/watch/...
:)2 -
So I was having an interview with a cool company a while ago. I had a non programming, full-time job then and I was having the interview during my break. I stressfully coded my way through a fizzbuzz and a tree question (luckily I had been studying data structures) but the interviewer generally sounded satisfied. Towards the end, he cheerfully asks "So, why do you want to work for us?" I panicked because I forgot to read details about the company before the interview. My response was "Um, because you offer a remote and part-time position, I know that's not a very nice reason, but, ummmm". The interviewer said "I see, thank you..." in a very dissapointed voice. Man, I didn't shoot myself in the leg, I loaded a nuclear missile on a fucking satellite and directed it straight to my balls. I felt so embarassed. Interviewer guy if you are reading this, I wanna say sorry.2
-
Junior dev here. Finishing a boot camp, actively going through a few job application processes.
One of the companies has given me a tech assignment (for a Graduate Junior position, mind you) that was titled Full Stack Mid Level Challenge. It took me a week to build an app they asked and do analitycs and refactoring of the second part of the task (I only had late evenings free to dedicate to that), it was my first time doing back-end in Node (my boot camp teaches PHP) so I basically learned to do it while doing this challenge.
They asked testing and clean architecture.
I submitted the assignment (I thought I would die while doing it, exhausted, I think I was brain dead for a short perio of time, but I submitted it on time).
They got back to me and we had already have a tech interview with the Leads that had live coding at the end. Don't have feedback yet, really won't be surprised for whatever comes, it was literarly my first interview, treating it like a valuable learning experience.
But. This rant is not about this. Thsi is just to put you in my mood.
This is the !rant:
My classmate from the bootcamp is probably already hired, or will be one of these days. As a tech challenge she was asked to do FizzBuzz kata. I repeat, FizzBuzz bloody kata!
Now, I am very happy for this person, the situation is complicated and this job is extremely needed.
But, please, explain to me, HOW??? How is it possible that selection criterias vary that much?
End of rant. Thank you very much.4 -
I think I fucked up today's interview. Opening with non-technical questions really threw me off kilter.
"What happened the last time you conflicted with another team member?"
IDK, ask me what "static" means in C# or just let me solve "FizzBuzz".3 -
Was reading about FizzBuzz/Algo again and I guess the modulo run-time.
The most optimal solution I came across is like:
if (x % 15) FizzBuzz
else if (x % 3) Buzz
else if (x % 5) Fizz
else x
But then how long does % take? Should you care?
I was thinking it should use variables:
var f = x % 3 == 0
var b = x % 5 == 0
if (f && b) FizzBuzz
else if (f) Fizz
else if (b) Buzz
else x10 -
### Functions ###
range = $(if $(filter $1,$(lastword $3)),$3,$(call range,$1,$2,$3 $(words $3)))
make_range = $(foreach i,$(call range,$1),$(call range,$2))
equal = $(if $(filter-out $1,$2),,$1)
### Variables ###
limit := 101
numbers := $(wordlist 2,$(limit),$(call range,$(limit)))
threes := $(wordlist 2,$(limit),$(call make_range,$(limit),2))
fives := $(wordlist 2,$(limit),$(call make_range,$(limit),4))
fizzbuzz := $(foreach v,$(numbers),\
$(if $(and $(call equal,0,$(word $(v),$(threes))),$(call equal,0,$(word $(v),$(fives)))),FizzBuzz,\
$(if $(call equal,0,$(word $(v),$(threes))),Fizz,\
$(if $(call equal,0,$(word $(v),$(fives))),Buzz,$(v)))))
### Target ###
.PHONY: all
all: ; $(info $(fizzbuzz)) -
Gonna teach someone conpletely new to programming some C#. What are some good exercises I can give them to understand general programming well?
So far I'm thinking FizzBuzz, some progressively more complex math+logic stuff and maybe fibonacci using recursion.11 -
So a friend got on MATFYZ (best and probably hardest Uni in our country - Math& Physics) and told me some first impressions today and well, fuck me.. or us..
One dude said he hadn't had much of a time for preparations on getting onto the Uni because he was busy writing learning book about nano stuff and not only for students, but for fucking TEACHERS! He was at the same age as I am now when he wrote this. There were more stories but this one's insane.
Meanwhile I'm here programming fizzbuzz not even studying IT related school (don't ask, bad decisions, or maybe good, probably good, but still) and not knowing shit really.
Is it just me orrr ?3 -
During my first-ever technical interview, the interviewer asked me "Do you know the FizzBuzz problem?"
"Uhh, not really." (I was just thinking ok this problem has a name, must be some algorithm problem)
"So the problem is basically to give you the numbers 1 to 100, if the number is divisible by 3, print 'Fizz', if divisible by 5, print 'Buzz', if divisible by 3 and 5, print 'FizzBuzz'. For other numbers just print out the number itself."
After hearing the problem, I felt so many ideas popping out of my stressed brain.
I thought for a bit and said "ok, so if the digit sum of a number is a multiple of 3, then the number is divisible by 3, and if the last digit is either 0 or 5, it's divisible by 5."
Then I started to code out my solution until the interviewer said "there's an easier solution. Can you think of it?"
This stressed me out even more.
I thought for a bit and said "well, starting from 3, keep a counter that records how many iterations are done after 3. When the counter hits 3, that number would be divisible by 3 for sure. Should I try this solution?"
The interviewer said "Sure." So I started again.
However, I struggled for about another 3min until I realized this solution is a lot harder to implement. The interviewer probably saw my struggle too.
This was the point where he stepped in and asked me "Ummmm there's an easy way of solving this. Have you heard of the MODULO OPERATOR?"
In sheer embarrassment, I finished the code in 30s.
Of course, there was no further question after this, and I felt the need to seriously reevaluate my intelligence afterwards.11 -
Had to do the FizzBuzz test in PHP. Proceeded to creat a range(1, 100) before the for loop instead of using the loops own index #. Worst part is I realized what I had done in the parking lot after I left. They asked me multiple times how I could optimize the code too lol.
-
When the guy that works weekends can't spend 5 minutes over the last 4 days to deploy a website that is blocking his own tasks 😑1
-
Watched Tom Scott's video on FizzBuzz today. Quite interesting. Did some further reading and apparently some people either fail completely or it takes them forever to get to a solution.
And this is Computer science graduates we're talking about. Like wtf?
For those of you who doesn't know what FizzBuzz is, just Google it.1 -
I am teaching my brother about web development. He has never programmed before, doesn't know html and css and is struggling a bit. I think?
I went through basic control flows with him tonight and got him on the fizzbuzz problem just to see what would happen. An hour later I did it for him and explained it as I went.
I need an idea to get him started on. Some project that might actually be interesting or useful. Any ideas?1 -
Fizzbuzz
for (var num = 0; num <= 100; num++)
if (num % 3 == 0 && num % 5 == 0) {
console.log("FizzBuzz");
}
else if (num % 5 == 0) {
console.log("Buzz");
}
else if (num % 3 == 0) {
console.log("Fizz");
}
else {
console.log(num);
}11 -
Public static void Main()
{
wakeUp();
massiveProject.refactorLargeSwathsOfCodeForReusability();
smallerProject.findOutItCanBeDoneInOneLine();
Environment.RageQuit();
} -
There are alot of questions in the job industry I'm not aware of. job gaps, lying, job hopping, hr and little details I didn't even notice.
I have a job gap for 2 months.(Nov and December) and planning to land a job on January.
For 2 weeks, I got burned out and need to recover my motivation to move on because my employer told me the job industry of not being honest, but being a dick and slave is what it gets to keep the job.
This December, I'm just going to do my side projects and little coding challenge(not the fizzbuzz). I don't plan to create short term side projects. I have to keep on practicing.
I'll be a slave in January. But I don't want to work 48 hours a week.1 -
My student magazine will begin recruiting new members in the coming weeks. And this is the second time they will be hiring a web developer. (First being me) However, they would like me to interview and test the applicant.
What would be some interview questions you guys would suggest?
In addition, I would like to ask him to solve some programming problems in html/CSS, JavaScript , and PHP. Can you guys suggest some problems I can give them? (I will surely ask them to do FizzBuzz.)6