Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

Due to resource constraints, /g/ and /tg/ will no longer be archived or available. Other archivers continue to archive these boards.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
File: 192 KB, 768x576, 1274742458213.jpg [View same] [iqdb] [saucenao] [google] [report]
69468679 No.69468679 [Reply] [Original] [archived.moe] [rbt]

>interviewer gives you a fizzbuzz question

>> No.69468747

>interviewer gives you a boner

>> No.69468779

>>69468679
Is this a meme or does this actually happen?

>> No.69470658

>>69468779
Only in Pokémon Heart Gold and Soul Silver

>> No.69470679

>>69468679
Just answer it in a professional way.
It is never about "do you know the answer" it is about "how do they respond"

>> No.69470766

>>69468679
I just hit them with one of these:
fizzbuzz = (lambda x:
"Fizz"*(x % 3 == 0) +
"Buzz"*(x % 5 == 0) +
str(x)*(x %3 != 0 and x % 5 != 0))

for i in range(1,101):
print(fizzbuzz(i))

>> No.69470810

>>69468779
I read an article about an interview where it happened and the person couldn't do it. So maybe it's a real thing.

>> No.69471212

>>69470766
>Python
Fucking pleb. Try this
section .data
fizz dw "Fizz", 0Ah, 0Dh
buzz dw "Buzz", 0Ah, 0Dh
fizzbuzz dw "FizzBuzz", 0Ah, 0Dh
newLine dw 0Ah, 0Dh
section .text
global _start

_start:
mov ecx, 1
loop_main:
push ecx
xor dx, dx
mov ax, cx
mov bx, 15
div bx
cmp dx, 0
jz divisb
xor dx, dx
mov ax, cx
mov bx, 3
div bx
cmp dx, 0
jz divist
xor dx, dx
mov ax, cx
mov bx, 5
div bx
cmp dx, 0
jz divisf
mov eax, ecx
call print_num
jmp resume
divisb
mov eax, 4
mov ebx, 1
mov ecx, fizzbuzz
mov edx, 10
int 0x80
jmp resume
divist
mov eax, 4
mov ebx, 1
mov ecx, fizz
mov edx, 6
int 0x80
jmp resume
divisf
mov eax, 4
mov ebx, 1
mov ecx, buzz
mov edx, 6
int 0x80
jmp resume
resume:
pop ecx
cmp ecx, 100
jz exit
inc ecx
jmp loop_main
exit:
mov eax, 1
mov ebx, 0
int 0x80
print_num:
push esi
mov esi, 0
loop_div:
mov edx, 0
mov ebx, 10
div ebx
add edx, 48
push edx
inc esi
cmp eax, 0
je print_chars
jmp loop_div
print_chars:
cmp esi, 0
je done
dec esi
mov eax, 4
mov ebx, 1
mov edx, 1
mov ecx, esp
int 0x80
add esp, 4
jmp print_chars
done:
mov eax, 4
mov ebx, 1
mov ecx, newLine
mov edx, 1
int 0x80
pop esi
ret

>> No.69471255

>>69471212
weak. I made one of these in x86 it's like a 3rd the size. If this thread is still alive tomorrow I'll post it.

>> No.69471263

I got fizzbuzz and a modified version of it for the first question of my interview. When I got the job I was told it was just to see if the interview was even worth their time.

>> No.69471316

>>69471255
I am gonna watch out fo yo shit homie. You can just make next thread tomorrow.

>> No.69471362
File: 141 KB, 500x500, tumblr_mzik0v09CX1tof9kfo3_1280.png [View same] [iqdb] [saucenao] [google] [report]
69471362

>fizz
The Tidal Trickster of course~

>> No.69471390

>>69468679
>Doing fizzbuzz with if statements
You are like babies.
#include <stdio.h>
#define MAX_NUM 100
int main()
{
const char* strings[4] = {"%d\n", "Fizz\n", "Buzz\n", "FizzBuzz\n"};
for(int i = 0; i < MAX_NUM; i++ )
printf(strings[((i % 3) == 0) + 2*((i % 5) == 0)], i);
}

>> No.69471527

>>69470766
>his solutions isn't modular
laugh at this codemonkey

mapping, maxi = {3: "Fizz", 15: "-", 5: "Buzz"}, 100
for number in range(maxi):
word = [mapping[divisor] for divisor in mapping if (number + 1) % divisor == 0]
print("".join(word) if word else number + 1)

>> No.69471587

>>69471390
based

>> No.69471628
File: 84 KB, 800x800, e0stFTO.png [View same] [iqdb] [saucenao] [google] [report]
69471628

>>69470810
i remember that she responded like this
>omg math

>> No.69471713

#include <stdio.h>

int main(void)
{
int i;

for (i=0; i <= 100; i++) {
i%3 && i%5 ? printf("%d\n", i) : puts(! (i%15) ? "FizzBuzz" : !(i%3) ? "Fizz" : "Buzz");
}
}

>> No.69471788

>>69471713
pajeet spotted

>> No.69471902

>>69471527
kek

>> No.69471926

#lang racket

(define (fizzbuzz n)
(cond
[(= n 0) (void)]
[(= (modulo n 15) 0) (display "Fizzbuzz")]
[(= (modulo n 3) 0) (display "Fizz")]
[(= (modulo n 5) 0) (display "Buzz")]
[else (display n)]))

(for ([i (in-range 1 101)])
(fizzbuzz i))

>> No.69471982

>>69471390
>implying
#include <stdio.h>
#define FIZZ 3
#define BUZZ 5
void fc();
void ic();
void zc();
void bc();
void uc();
void n();
int why(int i);
char F[256] = "F";
char i[256] = "i";
char z[256] = "z";
char B[256] = "B";
char u[256] = "u";


int main(void)

{
for(int i = 1; i <= 100; i++){
if (i % FIZZ == 0 ){
fc(); ic(); zc(); zc();
}

if (i % BUZZ == 0) {
bc(); uc(); zc(); zc();
}

if ((i % FIZZ != 0) && (i % BUZZ != 0)) {
why(i);
}
n();
}
}
void fc(){
printf("%s", F);
}
void ic(){
printf("%s", i);
}
void zc(){
printf("%s", z);
}
void bc(){
printf("%s", B);
}
void uc(){
printf("%s", u);
}
void n(){
printf("\n");
}
int why(int i) {
printf("%d", i);
}

>> No.69472126

>>69470810
>>69471628
https://css-tricks.com/tales-of-a-non-unicorn-a-story-about-the-trouble-with-job-titles-and-descriptions/

>> No.69472213

#!/usr/bin/perl

use strict;
use warnings;

for(1..100) {
my %fb = (
3 => $_ % 3 == 0,
5 => $_ % 5 == 0
);
print "Fizz" if $fb{3};
print "Buzz" if $fb{5};
print $_ unless $fb{3} || $fb{5};

print "\n";
}

>> No.69472495

>>69471212
The interviewer is an HR drone. What you wrote down doesn't look anything like the javascript code she has on paper. No call back for you

>> No.69472514

>>69472495
unironically this, as sad as it is.

>> No.69472524

>>69470658
For someone that just played blue and sapphire(just to the 3rd gym). What is the best of the new ones(except pikachu and eeve)? Plataform is not a problem because emulation exists

>> No.69472539

>>69472524
HG/SS was fun

>> No.69472627
File: 35 KB, 251x895, best solution.jpg [View same] [iqdb] [saucenao] [google] [report]
69472627

>>69468679
Just write a fizzbuzz generator

let fizBuzFactory = (lines) =>{
let fizBuzz = ""
let puts = (s) => {fizBuzz += s + "\n"}
puts("int main(){")
puts(" for(int i = 0; i < "+lines+"; i++){")
for(let i = 1; i < lines; i++){
puts(" if(i == "+i+")")
if(i % 15 == 0)
puts(" puts(\"FizzBuzz\");")
else if(i % 3 == 0)
puts(" puts(\"Fizz\");")
else if(i % 5 == 0)
puts(" puts(\"Buzz\");")
else
puts(" puts(\""+i+"\");")
}
puts(" }")
puts("}")

return fizBuzz
}

>> No.69472713

>>69472627
i need a fizBuzFactoryFactory for when the interviewer asks me to fizz every 7 and buzz every 12 numbers
and a decorator because somewhere down the line, someone might at some point in time want to fizz, buzz and bazz

>> No.69472727

>>69472713
how about you hire me first faggot

>> No.69472972

Read em and weep boys
public static void fizzBuzz(int toFizz){
for(int i = 1; i < toFizz; i++){
String wew ="fizzbuzz" + i + " ";
int w3 = ((((i-1)%3)+2) - (i%3+1)) + ((((i-1)%3)+2) - (i%3+1))/3;
int w5 = (((((i-1)%5)+2) - (i%5+1))-1) + ((i%5) + (5-(i-1)%5-1))*9/5;
int wx = (((((i-1)%5)+2) - (i%5+1))) + (((((i-1)%3)+2) - (i%3+1)) + ((((i-1)%3)+2) - (i%3+1))/3) + 8;

System.out.println(wew.substring(0, w3) + wew.substring(w5, 8) + wew.substring(wx));
}
}

>> No.69473043

>>69472524
>platinum
>HG/SS
>Black/White

Anything after not really worth

>> No.69473148

>>69472972
Impressive

>> No.69473177
File: 742 KB, 2752x4342, AllTheAnswers.png [View same] [iqdb] [saucenao] [google] [report]
69473177

>>69468679

>> No.69473190

>>69468679
is the Gyarados OK?

>> No.69473266

>>69471362
>League of Plebs

>> No.69473385
File: 45 KB, 344x374, 1527467726293.jpg [View same] [iqdb] [saucenao] [google] [report]
69473385

ive had a front end webpage artisan interview where the guy started asking me some CS bullshit that he knows i don't know because i don't have formal education. his face was pic related.
i said that i didn't know and asked why that was relevant for the position. he didn't reply and changed topics.
in the end he said "well i know you don't have any formal education in computer science despite this being an engineering (?) position *heh* but could you at least try this exercise? it's standard for the interview process and i have to ask you to do it [even though ur already fucking out lmaoooo]"

it was making an interactive fizzbuzz with javascript inputs.
"really?"
"yeah its okay, just try, at least give it a shot okay its fine"
i did it in 0.2 seconds. they called me back offering me a shit salary so i just turned them down, and his superior emailed me asking why i turned it down. "we are even willing to give you a go despite the fact that you dont have a diploma!"

>> No.69473459

>not making your own libfizzbuzz
>not doing literally
//compile with cc fizzbuzz.c -lfizzbuzz
#include <stdio.h>
#include <fizzbuzz.h>

int main ()
{
fizzbuzz_set_rule (3, "Fizz");
fizzbuzz_set_rule (5, "Buzz");
fizzbuzz_set_rule (15, "Fizzbuzz");
int i;
for (i = 0; i <= 100; i++)
{
printf ("%s\n", fizzbuzz_do (i));
}
return (0);
}

>> No.69473748

>>69473043
>Black/White
>not Black 2/White 2

>> No.69473887

>>69473459
That fizzbuzz doesn't even work concurrently,.or on arbitrary streams.
#include <stdio.h>
#include <fizzbuzz.h>

int main(void) {
int i;
FIZZBUZZ *f;
f = fizzbuzz_init(stdout);
fizzbuzz_set_rule(f, 3, "Fizz");
fizzbuzz_set_rule(f, 5, "Buzz");
fizzbuzz_set_rule(f, 15, "Fizzbuzz");
for (i = 1; i <= 100; i++) {
fizzbuzz_do(f, i);
}
fizzbuzz_deinit(f);
return (0);
}

>> No.69473905

>>69472524
>>69473043
Thx

>> No.69473944

>>69473887
his fizzbuzzlib is shit but it does work on any streams you like because it returns the string which you can later do whatever you want with.

>> No.69474019

>>69473944
Okay, I admit that. But you can't use more than one Fizzbuzz ruleset in your program (which is the only kind of state this structure would hold), and in case it writes its output to a static buffer, it wouldn't be thread-safe.

>> No.69474024

>>69474019
well i did say his fizzbuzzlib is shit...

>> No.69474375

>>69472126
Wow that was fucking cringey. Basically it's some fucker who thinks she knows js because omg I can make some animations and getting pissed when she discovers she can't even convert a fucking timestamp into seconds and then goes on to blame it on things like "there is no bachelor of science in design!"

Fucking brainlete when will they learn

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action