You DID pass the FizzBuzz test, right Anon?

You DID pass the FizzBuzz test, right Anon?

  1. 3 weeks ago
    Anonymous

    I did fizzbuzz with a hashmap and I used to work in sales

    • 3 weeks ago
      Anonymous

      >I did fizzbuzz with a hashmap
      Christ
      >I used to work in sales
      It shows

    • 3 weeks ago
      Anonymous

      You're saying that as if it isn't completely fucking retarded.

      int feezbooz(int N) {
      struct RetardedMap {
      std::array<const char*, 16> cock;
      RetardedMap() {
      for (int i = 1; i < 15; i++) cock[i] = "n";
      cock[0] = cock[15] = "FeezBoozn";
      cock[3] = cock[6] = cock[9] = cock[12] = "Feezn";
      cock[5] = cock[10] = "Boozn";
      }
      const char* operator[](int idx) const {
      return cock[(idx + (idx / 15)) & 15];
      }
      };

      static RetardedMap cox;

      for (int i = 0; i < N; ++i) {
      std::cout << i << ": " << cox[i];
      }
      }

      • 3 weeks ago
        Anonymous

        I don't see how that's retarded, it seems perfectly modular and scalable

      • 3 weeks ago
        Anonymous

        You can just index with `idx % 15`, and then your array will only need to be 15 elements instead of 16.

      • 3 weeks ago
        Anonymous

        I don't see how that's retarded, it seems perfectly modular and scalable

        Have we forgotten the importance of code that is robust?

  2. 3 weeks ago
    Anonymous

    Nope. I just used my Chad interpersonal skills to get (and retain) my job.

  3. 3 weeks ago
    Anonymous

    being non autistic is literally life of easy mode

    I could never

    • 3 weeks ago
      Anonymous

      You can't do FizzBuzz on C? Ngmi.

      • 3 weeks ago
        Anonymous

        I can do the % 3 == 0 version and the switch version but I can't figure out the hashtable (correct) version in C

        • 3 weeks ago
          Anonymous

          Just count two numbers, one for fizz and one for buzz.
          Put this in a loop that adds 1 to fizz and buzz for each lap.
          if(buzz = 5){printf(%d, buzz); buzz = 0;}

          • 3 weeks ago
            Anonymous

            >Used = instead of ==
            It's so fucking over for me holy shit.

          • 3 weeks ago
            Anonymous

            Nawwww cuz during the interview they're gonna ask "how could you make this better and more modular and scalable and as a microservice situaaaation"

          • 3 weeks ago
            Anonymous

            I can even do without if or switch in C.

        • 3 weeks ago
          Anonymous

          Pic related is without if and switch.

          • 3 weeks ago
            Anonymous

            Why did you make it a 4 by 8 char matrix?

            • 3 weeks ago
              Anonymous

              It should be 4x9, in fact, since fizzbuzz+ is 9 letters. But it was so that I could have one position of the matrix for number, fizz, buzz and fizzbuzz. I need also to be able to access and write its address, so I couldn't use a char *fbz[4] or char **fbz.

          • 3 weeks ago
            Anonymous

            Is there computation comparable to the cost of a fews 'if's being called when using that printf syntax?

            • 3 weeks ago
              Anonymous

              I have no idea. I mostly did that to check how a non-if/switch version in C could be done.

              • 3 weeks ago
                Anonymous

                Fair.
                What does ! do to operations inside brackets?

              • 3 weeks ago
                Anonymous

                Oh it converts zero to True which is then interpreted as 1.
                Pretty slick bru

              • 3 weeks ago
                Anonymous

                It's the not operator.
                If i is divisible by 3, i % 3 == 0, so !(i % 3) == 1.
                This way I can restrict the sum:
                !(i % 3) + !(i % 5) * 2 to [0,3].
                If i is divisible by 3 and 5:
                !0 + !0 * 2 = 1 + 1*2 = 3.
                If i is divisible by 5:
                !2 + !1 * 2 = 0 + 2 = 2[In C, 0 is false and any other number is true]
                If i is divisible by 3:
                !0 + !3 * 2 = 1 + 0 * 2 = 1
                If i is not divisible by 3 or 5:
                !i + !i * 2 = 0 + 0 * 0 = 0.

              • 3 weeks ago
                Anonymous

                1337

              • 3 weeks ago
                Anonymous

                Nice.

          • 3 weeks ago
            Anonymous

            fbz should be const char *fbz[] = {...}

            • 3 weeks ago
              Anonymous

              oh wait i noticed the sprintf part.
              yeah it's retarded

      • 3 weeks ago
        Anonymous

        I can do the % 3 == 0 version and the switch version but I can't figure out the hashtable (correct) version in C

        /**
        * Note: The returned array must be malloced, assume caller calls free().
        */
        char ** fizzBuzz(int n, int* returnSize){
        *returnSize = n;
        char ** answer = malloc(sizeof(*answer) * n);
        char * buffer = malloc(n * 9);
        uint32_t bits = 0x30490610;
        for (int i = 0; i < n; i++) {
        char* p = buffer + i * 9;
        switch (bits & 0x3) {
        case 0x3:
        strcpy(p, "FizzBuzz");
        break;
        case 0x2:
        strcpy(p, "Buzz");
        break;
        case 0x1:
        strcpy(p, "Fizz");
        break;
        case 0x0:
        sprintf(p, "%d", i + 1);
        break;
        }
        answer[i] = p;
        bits = bits >> 2 | bits << 28;
        }
        return answer;
        }

        • 3 weeks ago
          Anonymous

          >Camelcasing
          Unironically hang yourself Javanagger.

          • 3 weeks ago
            Anonymous

            the function definition is from leetcode

          • 3 weeks ago
            Anonymous

            I don't give a fuck, you don't code c with camelCased variables. You use the underscore like a fucking white man.

            • 3 weeks ago
              Anonymous

              Meant for

              the function definition is from leetcode

            • 3 weeks ago
              Anonymous

              i dont think you understand, i did not write the function definition
              this is what you are given:
              /**
              * Note: The returned array must be malloced, assume caller calls free().
              */
              char ** fizzBuzz(int n, int* returnSize){

              }

              the function definition is from leetcode, i am not leetcode, i did not write the function definition

              • 3 weeks ago
                Anonymous

                I don't care. Don't fucking dare to share any C code with fucking camelCased variables again. It's a sin to do so.

              • 3 weeks ago
                Anonymous

                i dont care lol, i will probably do it again
                take care

              • 3 weeks ago
                Anonymous

                People like you is why the world is a dark, cold place.
                Next time you do it, be aware that a kitten dies.

              • 3 weeks ago
                Anonymous

                printf("%dn", 12345 / 17);
                uint64_t uhOh = 0x7878788;
                printf("%dn", uhOh * 12345 >> 31);

              • 3 weeks ago
                Anonymous

                You have a problem with quickInverseSquareRoot(float number)

              • 3 weeks ago
                Anonymous

                float Q_rsqrt( float number )

              • 3 weeks ago
                Anonymous

                >he said anonymously, to a group of unimpressed strangers

              • 3 weeks ago
                Anonymous

                [...]
                /**
                * Note: The returned array must be malloced, assume caller calls free().
                */
                char ** fizzBuzz(int n, int* returnSize){
                *returnSize = n;
                char ** answer = malloc(sizeof(*answer) * n);
                char * buffer = malloc(n * 9);
                uint32_t bits = 0x30490610;
                for (int i = 0; i < n; i++) {
                char* p = buffer + i * 9;
                switch (bits & 0x3) {
                case 0x3:
                strcpy(p, "FizzBuzz");
                break;
                case 0x2:
                strcpy(p, "Buzz");
                break;
                case 0x1:
                strcpy(p, "Fizz");
                break;
                case 0x0:
                sprintf(p, "%d", i + 1);
                break;
                }
                answer[i] = p;
                bits = bits >> 2 | bits << 28;
                }
                return answer;
                }

                char ** fizzBuzz(int n, int* returnSize){
                *returnSize = n;

                nagger what is this? n is the amount of numbers printed as a function parameter and returnSize is also the amount of numbers printed but as an output?

              • 3 weeks ago
                Anonymous

                Pretty much all C versions of leetcode problems have *returnSize, no matter how blatantly obvious it is what the size of the returned array will be.

    • 3 weeks ago
      Anonymous

      >being a woman is life on easy mode
      >being handsome is life on easy mode
      >simply not having autism is life on easy mode
      I think everyone else is living life on normal mode, and ugly autistic men are just living life on hard mode, which makes sense.

    • 3 weeks ago
      Anonymous

      >too autistic to fit into normal society
      >not autistic enough to be a savant coder
      it's over

    • 3 weeks ago
      Anonymous

      >being normal is easy mode
      the more letter combinations you have the easier it gets, nagger

      • 3 weeks ago
        Anonymous

        >letter combinations
        what did he mean by this?

    • 3 weeks ago
      Anonymous

      This. I've gotten myself hired off of charisma alone before, and I'm still intelligent despite what autists claim about "normalfags" and "autistic savantry". Autism is a mental illness that should eventually be cured, not cherished.

    • 3 weeks ago
      Anonymous

      Give a single reason why companies shouldn't only hire autists.

      This. I've gotten myself hired off of charisma alone before, and I'm still intelligent despite what autists claim about "normalfags" and "autistic savantry". Autism is a mental illness that should eventually be cured, not cherished.

      Bullshit, that's simply isn't possible.

  4. 3 weeks ago
    Anonymous

    Its not just the soft skills. The the hoard of fresh grads who like to talk about architecture, system design, load balancers, autoscaling, nosql, constexpr, new language features, allocators, FPGAs, ergonomic API design, etc. but can barely write code or debug problems.
    They are excited about graph databases but have barely ever written an sql query. Hyped to solve hardware cache false sharing problems but miss computation that can be memoized. They know a lot of interesting things lack the experience to put all this know-how into any use. And their lack of the basics means that they will struggle to accrue enough trust to work on these things.
    But they can damn sure put on a show when you are talking with them for a short period.

    • 3 weeks ago
      Anonymous

      fookin hate them graphdb wankers m8 i swear

    • 3 weeks ago
      Anonymous

      saved

    • 3 weeks ago
      Anonymous

      >FPGAs
      You can't build anything non-trivial on an FPGA without basic programming ability. In fact I've seen programmers struggle hard with the inherent concurrency of HDLs.

  5. 3 weeks ago
    Anonymous

    ```
    for i in range(100):
    print("".join(filter(None, [i % 3 == 0 and 'Fizz', i % 5 == 0 and 'Buzz'])) or i)
    ```

    • 3 weeks ago
      Anonymous

      FML

      for i in range(100):
      print("".join(filter(None, [i % 3 == 0 and 'Fizz', i % 5 == 0 and 'Buzz'])) or i)

  6. 3 weeks ago
    Anonymous

    I joined a startup when it was 30 people, it was an email, into a phone call, into a single interview, into an on site test where I had to develop a small page using the technology I was going to be working with, using the API I was going to use, into being hired.

  7. 3 weeks ago
    Anonymous

    [...]

    Least homosexual Perl5 dev.

    • 3 weeks ago
      Anonymous

      >ignores his pic
      oh anon...

      • 3 weeks ago
        Anonymous

        My point is that this guy being the least faggy makes every other perl dev a homosexual of similar or supperior caliber.
        You lack wit.

        • 3 weeks ago
          Anonymous

          There's nothing wrong with perl.
          Honestly was much easier to script in linux with perl than with bash scripts for me.

          Apparently has security issues though. Not familiar with how though.

  8. 3 weeks ago
    Anonymous

    Why are you going to Hacker News? We have our own:

    [...]

  9. 3 weeks ago
    Anonymous

    This. Got my current job by not doing the code interview, instead saying:
    >i won't code for free

  10. 3 weeks ago
    Anonymous
    • 3 weeks ago
      Anonymous

      >AOL

  11. 3 weeks ago
    Anonymous

    I genuinely can't tell if there really are people applying for dev positions that can't do simple thing as fizzbuzz or if it's some meme.

    • 3 weeks ago
      Anonymous

      Compsci is one of the most oversaturated fields, if you truly are good it's a field day cause it's full of idiots.

    • 3 weeks ago
      Anonymous

      As problems go, it shouldn't filter anyone as it is very well known and trivial. It filters lots of people, and they're all people who should be filtered.

  12. 3 weeks ago
    Anonymous

    [...]

    sir, something must've went wrong when you pasted that text, I only see mojibake

  13. 3 weeks ago
    Anonymous

    import math

    for number in [1, 100]:
    if number / 3 == round(number/3):
    print("Fizz")
    if number / 5 == round(number/5):
    print("Buzz")
    if number == round(number):
    print(number)

    • 3 weeks ago
      Anonymous

      Holy bloat

      • 3 weeks ago
        Anonymous

        And it's also wrong, it will print the number, even in the case were it also print fizz, buzz or fizzbuzz

        • 3 weeks ago
          Anonymous

          It's way more bugged than you think.

    • 3 weeks ago
      Anonymous

      array = list(range(0,101))
      numbers = [3,5,15]
      words = ['fizz','buzz','fizzbuzz']
      for num in numbers:
      for i in range(num,101,num):
      array[i] = words[numbers.index(num)]
      for element in array:
      print(element)

      Was harder to do fizzbuzz with Python than with c++ for me.

      • 3 weeks ago
        Anonymous

        >list(range(0,101))
        nice instant memory bloat

        • 3 weeks ago
          Anonymous

          Yep.
          The power of python.

        • 3 weeks ago
          Anonymous

          That's your problem with that code?

          • 3 weeks ago
            Anonymous

            I'm ashamed of that code, I have an array addiction.
            Am pleb.

  14. 3 weeks ago
    Anonymous

    [...]

    #!/usr/bin/perl
    print join(" ", 1..100) =~ s{
    (?= (?<fizz> (?&div_3*~~?
    (?= (?<buzz> (?&div_5*~~?
    d+
    (?(DEFINE)
    (?<div_5> b d* [05] b )
    (?<div_3> b
    (?: [0369]+
    | [147] (?&div_3)? (?: [258] | [147] (?&div_3)? [147])
    | [258] (?&div_3)? (?: [147] | [258] (?&div_3)? [258]))
    (?&div_3)?
    b
    )
    )
    }{
    (defined $+{fizz} && "fizz") . (defined $+{buzz} && "buzz") || $&
    }gxer, "n"

    • 3 weeks ago
      Anonymous

      This was used in prod less than 15 years ago? Shit man

  15. 3 weeks ago
    Anonymous

    What would be the 'soft-skill' equivalent of fizzbuzz?

    • 3 weeks ago
      Anonymous

      Maintaining eye contact with a woman

  16. 3 weeks ago
    Anonymous

    There's no way "fizzbuzz" is a real word. You're all nuts

  17. 3 weeks ago
    Anonymous

    >fizzbuzz test
    How is this even real? It's a problem you give on first day of school maybe.

  18. 3 weeks ago
    Anonymous

    During an interview for my first job out of college at a small company, a dev walked into the interview room and interrupted the nontechnical manager conducting the interview and asked me to do fizzbuzz. I thought it was a joke but I did easily it and he seemed really relieved and explained that >90% of their applicants who had claimed to have years of programming experience couldn't actually code at all and they kept finding out after the applicant had tricked the manager into hiring them.

    • 3 weeks ago
      Anonymous

      I haven't even done a single course on programming and I can do this.
      Jesus Christ.

  19. 3 weeks ago
    Anonymous

    Literally me, I can learn quick and interview well so I tend to be good at getting and retaining jobs. But I'm always incompetent for the role at the point of being interviewed, I can catch up later though in most cases.

  20. 3 weeks ago
    Anonymous

    >Those people get by on the job by taking a really long time to get things done, but have great excuse masking skills, so they keep their job
    Literally me. It takes me two sprints to finish a couple of 2 point tickets, yet my manager is super happy with me and says I exceeded expectations

  21. 3 weeks ago
    Anonymous

    def fizz(x):
    if x % 15 == 0:
    print "FizzBuzz"
    elif x % 5 == 0:
    print "Buzz"
    elif x % 3 == 0:
    print "Fizz"
    else:
    print x

    def buzz():
    for (100) i:
    fizz(i+1)

    buzz()

    • 3 weeks ago
      Anonymous

      That's not python, what is that?

      • 3 weeks ago
        Anonymous

        https://sourcegraph.com/search?q=context%3Aglobal+%22for+%28100%29+i%3A%22&patternType=regexp&case=yes&sm=1&groupBy=repo
        https://github.com/aardappel/lobster

        • 3 weeks ago
          Anonymous

          thank you for linking how you found it anon.

      • 3 weeks ago
        Anonymous

        Probably lua if not python

  22. 3 weeks ago
    Anonymous

    Rate,

    • 3 weeks ago
      Anonymous

      Failed. You left in unused imports, which indicates you're lazy and not a good worker.

      • 3 weeks ago
        Anonymous

        It's future-proofing.

        • 3 weeks ago
          Anonymous

          Failed because you don't understand YAGNI.

  23. 3 weeks ago
    Anonymous

    thoughts? concerns?

    • 3 weeks ago
      Anonymous

      >testing for fizzbuzz and then fizz and then buzz

      • 3 weeks ago
        Anonymous

        That's your concern? Not the fact that I started at zero?

    • 3 weeks ago
      Anonymous

      `to_string(i)` needs to allocate a new `string` for every `i` even though `cout` could encode integers to strings more efficiently if you gave it `i` directly.

      • 3 weeks ago
        Anonymous

        >even though `cout` could encode integers to strings more efficiently
        even though `cout` could encode integers to the stream more efficiently (*)

  24. 3 weeks ago
    Anonymous

    This fizzbuzz is a meme for shit programmers to make them feel good.
    There is no such thing as programmer that can't do fizzbuzz, even after they are told the operator to calculate remainder from division.

    You just want to believe in such shit, because you need to believe that there are such shit coders and at least you are not that shit.

    You are shit. Stop spreading the fizzbuzz meme.

    • 3 weeks ago
      Anonymous

      Cope

  25. 3 weeks ago
    Anonymous

    I brought my own code and they hired me

  26. 3 weeks ago
    Anonymous

    Your friendly reminder that the general populace is leagues more retarded than you would think.

    • 3 weeks ago
      Anonymous

      (defn timecode->seconds [timecode]
      (let [strings (str/split timecode #":")
      [hours minutes seconds] (map edn/read-string strings)]
      (+ (* 3600 hours)
      (* 60 minutes)
      seconds*~~

      (timecode->seconds "11:22:33")

    • 3 weeks ago
      Anonymous

      import Data.List.Split (splitOn)

      timecodeToSeconds :: String -> Maybe Int
      timecodeToSeconds = toSeconds . map read . splitOn ":"
      where toSeconds [hh, mm, ss] = Just (hh * 3600 + mm * 60 + ss)
      toSeconds _ = Nothing

      I'm a beginner in Haskell, how did I do?

    • 3 weeks ago
      Anonymous
      • 3 weeks ago
        Anonymous

        sub timecode_to_sec {
        $_[0] =~ /^(d+):(d+):(d+)$/
        && $1*3600 + $2*60 + $3
        }
        say timecode_to_sec "11:22:33"

    • 3 weeks ago
      Anonymous

      They're called wahmen

    • 3 weeks ago
      Anonymous

      i feel bad for these ppl bc what they don't realize is that competent programmers can learn everything this person knows and more, probably quicker too. you can push yourself to grow but you probably can't match the pace of some better programmers. it's fine though because even for less competent ppl there are roles (for now)

  27. 3 weeks ago
    Anonymous

    [...]

    in Jelly this is just
    3µ3,5ḍTị“¡Ṭ4“Ụp»ȯ)G

  28. 3 weeks ago
    Anonymous

    CompSci, and software development in general, should be illegal for people with an IQ south of 120. It's absolutely insane that there are actual university graduates who can't do FizzBuzz. In fact, you should be barred from having anything to do with software if you can't do it on your FIRST DAY after some light familiarization with the syntax and control structures.

  29. 3 weeks ago
    Anonymous

    it depends what the meaning of "fizz" is

  30. 3 weeks ago
    Anonymous

    He sounds like he's describing the average Indian programmer

  31. 3 weeks ago
    Anonymous

    for x in y:
    if x % 3 == 0: print fizz
    if x % 5 == 0: print buzz
    println

  32. 3 weeks ago
    Anonymous

    my very first interview for a internship, I was given a fizzbuzz equivalent problem but a bit harder. so given a time like 10:41, using only any of the digits, can reuse any digit, find the next earliest time, can roll over to next day. so for 10:41 answer is 11:00. 23:59 is 22:22. got rejected though cus the guy thought I was there for the 16 month internship my uni had for co op and not the 4 month summer I applied for lol. the rejection didnt say this but at the beginning I confirmed it was a 4 month role and he said it was 16 month.

    • 3 weeks ago
      Anonymous

      >so for 10:41 answer is 11:00
      i think it's 10:44
      no wonder you didn't get the job

    • 3 weeks ago
      Anonymous

      this makes no sense at all

      • 3 weeks ago
        Anonymous

        It actually does. Read it again as if you're retarded.

    • 3 weeks ago
      Anonymous

      >23:59 is 22:22
      Or, you know, 2:22

      • 3 weeks ago
        Anonymous

        Depends if 2:22 is meant to be formatted with a 0 so 02:22

    • 3 weeks ago
      Anonymous

      your English is really bad

  33. 3 weeks ago
    Anonymous

    nobody ever asked me fizzbizz, it's a made up problem by nerds

    • 3 weeks ago
      Anonymous

      It was made up as a very simple problem that potential hires would't have memorized, to filter out those who can't code at all.

  34. 3 weeks ago
    Anonymous

    fizzbuzz is fucking useless, it just shows you know how to write a for loop. Even then the person may not be able to apply their knowledge in other more complex applications. How can so many people not do it? They must just not know how to code at all.

    • 3 weeks ago
      Anonymous

      that's kind of the point of it being an interview question

    • 3 weeks ago
      Anonymous

      >They must just not know how to code at all.

      Correct. It's to weed out people who can sell themselves and copy answers from stack overflow but lack even rudimentary knowledge of coding.

  35. 3 weeks ago
    Anonymous

    I thought these people just go to Product Management type roles like the chicks who post tiktoks of them 'working in tech'? Are they really getting hired as devs?

  36. 3 weeks ago
    Anonymous

    array = [1, 2, 'fizz', 4, 'buzz', 'fizz', 7, 8, 'fizz', 'buzz', 11, 'fizz', 13, 14, 'fizzbuzz']
    n=0
    loop() {
    for nig in array
    if int(nig), print nig+n
    else, print nig
    rof
    n=n+15
    loop()}
    loop()
    >the above is not code

  37. 3 weeks ago
    Anonymous

    Fizzbuzz is the easiest thing to code, it's just 2 for loops and if statements, it's so simple even a toddler can do it

    • 3 weeks ago
      Anonymous

      Toddler here. 1 loop and 1 if statement.
      array = [1, 2, 'fizz', 4, 'buzz', 'fizz', 7, 8, 'fizz', 'buzz', 11, 'fizz', 13, 14, 'fizzbuzz']
      n=0
      >for nig in array, add n+nig if is_int(nig), print nig
      >n=n+15
      >repeat forever

  38. 3 weeks ago
    Anonymous

    Anyone who can't do fizzbuzz is an NPC. I could've probably done fizzbuzz when I was 12 if someone showed me what the operators of the programming language do.

    • 3 weeks ago
      Anonymous

      >needing someone to show what the operators do
      I just opened up script files for total war games and started editing them by looking around for context. Still don't know what language they were in 13 years later, don't care.

      • 3 weeks ago
        Anonymous

        For me it's the same when I did a few easy JavaScript CTFs
        I still never learned how to properly code in JS cause JS is lame.

      • 3 weeks ago
        Anonymous

        Bit scary how basic logic and pattern matching gatekeeps some people.

  39. 3 weeks ago
    Anonymous

    LMAO JUST ADD 15
    YOU GUYS ARE FIRED FOR TIME THEFT
    THE SOLUTION IS LITERALLY JUST +15
    GET ON MY LEVEL

Your email address will not be published. Required fields are marked *