You have no idea the delusional type of people that the money and glamor of Silicon Valley can attract, 150 years ago they’d be dying of exposure in the Klondike convinced they know how the best way to dig gold

it's also worth noting that 2 is a prime number (it is only divisible by itself and 1), so the interviewer is wrong in saying that odd numbers are 1,3,5 etc and there needs to be an extra statement stating if i == 2 print i

>the interviewer is wrong in saying that odd numbers are 1,3,5 etc and there needs to be an extra statement stating if i == 2 print i
Sorry, but we don't like know-it-alls around here, better luck next time.

I've only ever used small amounts of R or python for data analysis or running motors but wouldn't that just be something simple like (mind the pseudocode)

for number in range(1,16):
if number divisible by 3 and 5:
print("FizzBuzz")
elif number divisible by 3:
print("Fizz")
elif number divisible by 5:
print("Buzz")
else print(number)

I don't know what a timecode string is, I'm guessing something like 12:34:24 where it's hours:min:seconds? Seems like an easy enough division.

The first one only works for integers up to 10. No floats at all.
The second one works for any integers and 1 float. That's unarguably an improvement, but yes it needs to be fixed.

1 year ago

Anonymous

Well obviously they had to stop somewhere, ten just gets the point across. Code overhead is a lot but the runtime is much faster. So there are trade offs.

Use repeated doubling or a bit mask to do multi digit multiplication. Repeated doubling will be faster in general, but the bit mask has more stable run time.

This holy fuck, if you are going to write ANY code at least know basic algorithms like Russian multiplication (repeated doubling). It's the base for thousands of other similar algorithms. As long as you have a monoid you can use it.

Imagine the kind of person that posts here in a STEM career gen thread, asking if they need to get a degree in CS or if their HS experience making a couple scripts qualifies them for 80k-250k developer jobs. Those people pumped up on confidence and dunning-kruger waltz into interviews and waste everybody's time. It is usually either them, or boomers who just mass spam every single job listing and hope someone will hire them without checking into their skill level.

How do I into coding?
I'm studying chemistry but I need a backup plan because most jobs you can get with an undergrad degree pay like shit and my grades aren't looking too hot atm.

Literally just start writing shit and dicking around. Something like freecodecamp or codecadamy can give you a little structure and a nudge in the right direction.

http://101.lv/learn/C++/htm/ch01.htm
Think this is supposed to be a decent resource. I had to do some coding for embedded systems classes and the course coordinator recommended it.

I don't see the humor though. Cranking the valve open literally will ruin the entire experiment because you will get the wrong amount and over titrate it. And if you already know the amount required beforehand, then fast titrate to within 5 mL of it, then slow titrate. Literally takes less than 2 minutes to go through a 50 mL burette doing this.

This fizz buzz do you have to use (n % 3 == 0 AND n % 5 == 0) print fizzbuzz elseif n % 3 == 0 print fizz elsif n % 5 == 0 print buzz else print n
n++
or is there a compsci way of doing it

You laugh and yet my medfag job interview included(aside from med shit) basic arithmetic/algebra tasks along the lines of >how would you turn 10ml of 40% solution into 200ml of 5% solution(1% in medicine means it contains 10 mg per ml)
We are surrounded by 90iq monkeys in our daily lives, and its best not to think about it

>sharp algorithm skills

>cannot fizzbuzz

how does this happen?

by lying on their resume.

More likely not knowing what an algorithm is

You have no idea the delusional type of people that the money and glamor of Silicon Valley can attract, 150 years ago they’d be dying of exposure in the Klondike convinced they know how the best way to dig gold

I might have to start interviewing candidates this year and if I get someone this retarded I'm gonna fucking lose it.

does anyone have the one that is a notepad++ screenshot where some guy describes all the fizzbuzz interviews he did

gotcha covered

that made me start to doubt that I could actually do those

this made me feel like i could be a professional coder. Are coders really this bad or is it just people lying on their resumes about experience?

Theres a lot of bad people out there.

These people were looking for a job for a reason.

>i = i%1

>Find all odd numbers between 0-100

>for(int i = 1, i >= 100, i++)

> i >= 100

> >=

>8 years experience

kek

it's also worth noting that 2 is a prime number (it is only divisible by itself and 1), so the interviewer is wrong in saying that odd numbers are 1,3,5 etc and there needs to be an extra statement stating if i == 2 print i

um

I-

yes good point

>the interviewer is wrong in saying that odd numbers are 1,3,5 etc and there needs to be an extra statement stating if i == 2 print i

Sorry, but we don't like know-it-alls around here, better luck next time.

1 is not prime though

I'm actually curious, what's a more efficient way to make a list of all odd numbers between x and y?

for a in list(range(100)):

if a%2 == 1:

print(a)

or if you like, you can append 'a' to a list and then print the list after the loop is done

>not using

>if a&1:

dont prioritize shit that your compiler is gonna do anyway over readability

Look at the last bit of the number. If it is 1, then it is odd.

butts = x || 1

while butts < y:

print(butts)

# or append to list instead

butts += 2

If x is odd, start at x and increment by 2 until x is greater than y

otherwise, start at x+1 and increment by 2 until x is greater than y

this cant be real

Coding interviews are nothing like this.

Either this was written in 1998, or your company is paying garbage-tier wages, or they're bringing in high school students to interview.

Either way, if your interview candidates are that shitty it's totally on you.

This reads like an SCP entry listing interactions

These people should be contained for their own safety.

I feel like you could get some of these if, every time you hit newline, you weren't allowed to see any of the previous lines you wrote.

I've only ever used small amounts of R or python for data analysis or running motors but wouldn't that just be something simple like (mind the pseudocode)

for number in range(1,16):

if number divisible by 3 and 5:

print("FizzBuzz")

elif number divisible by 3:

print("Fizz")

elif number divisible by 5:

print("Buzz")

else print(number)

I don't know what a timecode string is, I'm guessing something like 12:34:24 where it's hours:min:seconds? Seems like an easy enough division.

This is the result of the bootcamps and the campaigns convincing people to learn how to write code.

Everybody get ready to laugh at the CSfags who think they can do better.

def product(a, b):

for i in range(b):

a += a

return a

Is this right? I'm a retard who's never coded.

oh I made a retard. Replace that section with

c += a

return c

right but what about 1.5?

I think the question is an esoteric computer science question - how do you teach a computer how to multiply?

You made me curious so I checked and it still works.

Ah it fails if the second variable is a float. Could fix that with a check, maybe another 3 lines?

Still much better than

I disagree, they are the same level.

The first one only works for integers up to 10. No floats at all.

The second one works for any integers and 1 float. That's unarguably an improvement, but yes it needs to be fixed.

Well obviously they had to stop somewhere, ten just gets the point across. Code overhead is a lot but the runtime is much faster. So there are trade offs.

Wtf are you high.

>Could fix that with a check, maybe another 3 lines?

Then what do you do with the fractional part of b?

Remove it, I'm a chemist it doesn't matter at our quantities when the inherent equipment uncertainties will far outweigh it :^)

I set a and b to both be 1.5:

TypeError: 'float' object cannot be interpreted as an integer

I solved it, awaiting job at MIT:

def product(a,b):

return a/(1/b)

genius

That was my first thought but isn't the challenge to avoid using any such operators?

obey the letter of the law if not the spirit

ah yes i see, 3*0 is indeed "ZeroDivisionError: division by zero"

Use repeated doubling or a bit mask to do multi digit multiplication. Repeated doubling will be faster in general, but the bit mask has more stable run time.

This holy fuck, if you are going to write ANY code at least know basic algorithms like Russian multiplication (repeated doubling). It's the base for thousands of other similar algorithms. As long as you have a monoid you can use it.

https://pastebin.com/m4s6v4QB

I didn't realize C++ doesn't rollover. Very nice.

Imagine the kind of person that posts here in a STEM career gen thread, asking if they need to get a degree in CS or if their HS experience making a couple scripts qualifies them for 80k-250k developer jobs. Those people pumped up on confidence and dunning-kruger waltz into interviews and waste everybody's time. It is usually either them, or boomers who just mass spam every single job listing and hope someone will hire them without checking into their skill level.

Listen son, you don't need a resume when you have a firm handshake. And if your a woman, all the same, except you grab the penis.

How do I into coding?

I'm studying chemistry but I need a backup plan because most jobs you can get with an undergrad degree pay like shit and my grades aren't looking too hot atm.

Literally just start writing shit and dicking around. Something like freecodecamp or codecadamy can give you a little structure and a nudge in the right direction.

come up with a fun problem and solve it

or

take classes that make you suffer and put up with the suffering

both are equally valid

http://101.lv/learn/C++/htm/ch01.htm

Think this is supposed to be a decent resource. I had to do some coding for embedded systems classes and the course coordinator recommended it.

Check this one out.

5 divided by 2 is : 2 and 1 halves

3 divided by 2 is : 1 and 1 halves

1 divided by 2 is : 0 and 1 halves

The % is counting the halves

Euclidean division, retard. 1 = 2*0 + 1.

I don't see the humor though. Cranking the valve open literally will ruin the entire experiment because you will get the wrong amount and over titrate it. And if you already know the amount required beforehand, then fast titrate to within 5 mL of it, then slow titrate. Literally takes less than 2 minutes to go through a 50 mL burette doing this.

This fizz buzz do you have to use (n % 3 == 0 AND n % 5 == 0) print fizzbuzz elseif n % 3 == 0 print fizz elsif n % 5 == 0 print buzz else print n

n++

or is there a compsci way of doing it

You can do n % 15 instead of n % 3 and n % 5

Or you could parameterize it like

Fizz : 15n, 15n + 3, 15n + 6, 15n + 9, 15n + 12

Buzz: 15n, 15n + 5, 15n + 10

n : 15n + 1, 15n + 2, 15n + 4, 15n + 6, 15n + 7, 15n + 8, 15n + 11, 15n + 13, 15n + 14

for (i = 1, i <=100, i++) {

if (i%15 == 0) {

print "FizzBuzz" }

else if (i%5 == 0) {

print "Buzz" }

else if (i%3 == 0) {

print "Fizz" }

else

print i }

in python:

def fizzbuzz(x):

string = ''

if x % 3 == 0:

string = string + 'fizz'

if x % 5 == 0:

string = string + 'buzz'

return string

for x in range(n):

print(fizzbuzz(x))

it has to print out the number itself in cases where the string is empty

A primary school boy could do this in 20 minutes if I taught him about the basics of C. How do these people exist?

>CHADdock the PUSSY slayer

>SCIENTISTdock the BRILLIANT

How the FUCK does he do it bros?

You laugh and yet my medfag job interview included(aside from med shit) basic arithmetic/algebra tasks along the lines of

>how would you turn 10ml of 40% solution into 200ml of 5% solution(1% in medicine means it contains 10 mg per ml)

We are surrounded by 90iq monkeys in our daily lives, and its best not to think about it

You realize you can't turn 10 mL of 40% into 200 mL of 5%, right? Yet you claim everyone else is the 90iq monkey.

His problem is asking how much of the 10ml 40% you combine with fluid in the 200ml container to make the 200ml container 5%. Why is that impossible?

See

1% = 10 mg/mL

40% = 400 mg/mL

10 mL of 40% = 4,000 mg

Want 200 mL of 5%, which is 5 x 10 x 200 = 10,000 mg.

Impossible to get 10k from 4k