Job interview for basic dev position

>job interview for basic dev position
>"solve these random obscure algorithm and math problems"
AAAAHHHH

Attached: 1517897557954.png (967x954, 554K)

Other urls found in this thread:

khanacademy.org/
datagenetics.com/blog/july22012/index.html
npmjs.com/package/is-odd
twitter.com/SFWRedditVideos

programming is math you fool

>updating and writing stupid CRUD apps
>math

>people don't want a retard on their team
>he gets mad about it
you for real, brainlet?!

Attached: 1516353232799.gif (500x258, 661K)

shit deal bro -- fortunately there are a ton of resources to bolster your math skills khanacademy.org/

Oh?

Attached: FizzBuzzed.png (1848x2018, 391K)

programming is not math, cs and game development is math

I'm not one to yell "shill" at everything, but this one is just obvious

>implying you can solve obscure algorithms on the spot

>fizzbuzz pseudocode due next week
>haven't even started
fml

>fizzbuzz is the same as obscure numerical integration algorithms

OP did not specify. We have had tonnes of "FizzBuzz-is-too-hard" types before. Until OP tells us otherwise, he is one of them.

Attached: 1513308792562.png (679x769, 58K)

I'm not an idiot it was harder than fizzbuzz.

I believe you.

I can. I graduated with a CS degree.

>Shilling a free website

Bazinga.

>Tripfags being retarded as usual

BAZINGA.

Attached: 1524901487054.gif (255x192, 460K)

I've been making small projects for 2 years now, I just learned off youtube and I google most of my shit, I don't think I even know how to code yet these dumb asses pay me to spend the day googling and copy pasting

>t. cs major

Attached: CS math skills.png (596x443, 46K)

I once made a maze solver that imitates the slime mould. I'm happy to know that I'm at least smarter than CS majors.

You either know the algorithms and solve the real problems or compete with Indians for the lowest price. Simple as that.

Prove me wrong.
1. You have two eggs and there is a 100 story building. The eggs will only break if they are dropped at or above a certain floor. How should you find this floor with smallest number of egg drops?

2. You have an nxn grid of distinct numbers give an algorithm to determine a local minimum in O(n)

3. An urn containing 80 red balls and 20 blue balls. The balls are removed one by one. If a red ball is taken it is discarded. If a blue ball is taken it is put back in the urn and the following ball taken is discarded regardless of color. How likely is the last ball to be red?

Attached: angr.jpg (707x500, 71K)

these are BASIC interview questions. every fucking book has them. go search for solutions retard.

>Prove me wrong.
>solve these problems

>solve my interview homework questions for me
1st one is especially easy btw

>implying you can do the urn problem in an interview without having seen it ahead of time
What's the answer genius?

You should've seen it ahead of time though. I've definitely had the third in some CS class before.

Then do it.

you have a mouth containing 80 balls you fricking nerd

haha blue balls

>those positions are already filled
delusional

Not doing your homework. I thought you were gonna post some Google interview style questions.

It's not homework retard and you can't do it.

>n-no but it's really hard
You should study programming interview questions. These will literally be in the first chapter of any book on the subject.

You don't know the answer lol, find me a programming interview book with the urn problem in the first chapter or any chapter.

I'm glad you didn't get the job, you probably wouldn't have solved shit. This post reminds me of the guy bitching about not knowing how to reverse a binary tree.

Why are you acting like you know the answer when you don't?

I'm feeling nice so I'll do your homework.

Drop at floor 14, 27, 39, 50, etc until the first egg breaks. Start going up 1 floor at a time starting with the last floor before the first egg broke.

Start from the top left and just go in the direction of the lowest gradient until you find a local min.

Markov chain with each state being the probability of N number of red balls remaining.

>1. You have two eggs and there is a 100 story building. The eggs will only break if they are dropped at or above a certain floor. How should you find this floor with smallest number of egg drops?
Do you have 2 eggs or the minimum amount needed?

t. rajeesh

Attached: 1471975645935.png (1000x1000, 112K)

>Start from the top left and just go in the direction of the lowest gradient until you find a local min.
no hire

Guaranteed to complete in linear time. If you disagree then prove it by giving an example where it doesn't.

Well, the first one is binary search, ez.

Second one... It's basically a* right? Just go to the lowest value around you?

pretty unlikely?

And yet I managed to bullshit my way to system administration for a small school. How are you brainlets so easily defeated?

36 35 34 33 32 31
36 36 36 36 36 30
24 25 26 27 28 29
23 36 36 36 36 36
22 21 20 19 18 17
36 36 36 36 36 16

>Well, the first one is binary search, ez.
no hire

>Markov chain with each state being the probability of N number of red balls remaining.
Don't think so.

>1. You have two eggs and there is a 100 story building. The eggs will only break if they are dropped at or above a certain floor. How should you find this floor with smallest number of egg drops?


drop from 50th
no break -> drop from 25th (middle of 0 and 50)
break -> drop from 75th (middle of 50 and 100)
do this recursively

If the floor is below 25 you die.

>no hire
Binary search is the correct answer.

evading the problem. you cant do it.

No it's not.
Binary search is not the answer to number 1.
Greedy search is not the answer to number 2.
The urn problem is fucking hard and anybody who get's it on an interview is a wizard or has seen it before.

I figured them out after failing and not getting the job.

Not the same user. So what is the answer to number 1?

>3. An urn containing 80 red balls and 20 blue balls. The balls are removed one by one. If a red ball is taken it is discarded. If a blue ball is taken it is put back in the urn and the following ball taken is discarded regardless of color. How likely is the last ball to be red?

50% likely. The last ball is either red or not red.

Yup, and the odds of winning the lottery are 50%. Either I win, or I don't.

Another brainlet, well didnt expect much anyway.

Attached: 1508894141936.jpg (645x588, 57K)

Jump up floors a decreasing amount until your egg breaks then scan the interval you just jumped with final egg.

Ok. I guess you have to use a divide and conquer approach then. Find the minimum in the middle row/column depending on whether the width or length of the current search area is higher. If it's not a local min, split the area and recurse on the side with a smaller number.
Linear scan at each iteration, problem size halves in each iteration, so the reccurence is linear.

That's... super vague and wrong?

The correct answer is binary search. Start at 50, if it breaks, go half way down to 25, if it doesn't go half way up to 75, then repeat. This will take at most 7 eggs/tries.

Please explain your solution in detail, showing that it takes less tries.

lazy description, no hire

You have TWO eggs.

>what are jokes

whats the middle of 0-25?

im getting at the problem that you need round numbers for the floors right?

its wrong. that way youre determining only your own interval

Oh, I see. You can reuse the eggs if they don't break.

Well, guess it's a good thing I'm already employed as a programmer at a bit multinational.

so?

>big*

punch a hole in the wall strongman

This board is more retarded than I thought.
datagenetics.com/blog/july22012/index.html
You can't just do a binary search. If it breaks at 50 and 25 both eggs are down.

not OP and not even cs but got really curious of problem, but all i see no real answer and everyone calls each other brainlets and reply with stupid wojak pics

...

This kills the user.

Attached: urn.png (1000x474, 174K)

that's kind what you get when you search for "designers" or "ui programmers".
People that only played a bit with JS and actually believes that is a real programming language. But man, they are so creative!

Attached: ui designer.jpg (610x406, 72K)

>But man, they are so creative!
Their CVs are creative if nothing else.

>apply for an dev job
>be asked dev-related questions
what a twist!

1. It's fucking binary search

It was pencil and paper problem and 19/99 isn't correct.

Are there problems like the egg that are huge traps for people who half know what they are doing?

Attached: 1474941664043.jpg (248x187, 11K)

(╯°□°)╯︵ ┻━┻
I give up, I'm a brainlet
How do you do the urn?
Couldn't find the anything on google

0.000152062631737
memo = {}
def f(r, i):
if i == 0:
if r == 20:
return 1.0
return 0
if (r, i) not in memo:
t = 101.0 - i
b = t - r
memo[(r, i)] = f(r, i - 1) * (b / t) ** 2 + f(r + 1, i - 1) * (r / t) * (1 + b / t)
return memo[(r, i)]

print(f(1, 99))

Reminder that this exists:
>npmjs.com/package/is-odd
>3,072,250 weekly downloads
And people wonder why Fizzbuzz screens out so many people.

Attached: peak webdev.png (615x449, 90K)

The answer is 0.000152062631737.

How can people get the egg one wrong? It's literally kindergarten logic.
Start from first floor, drop the egg, if it doesn't break you can reuse it. Go up one floor at a time. As soon as the egg breaks you have your solution without even using the second egg.
Bonus: hardboil the egg you can gain some more floors before it breaks, and you can tell the interviewer "this solution is both optimized and robust".

That's wrong. You can reduce it by jumping say 5 floors at time. Then when it breaks, start dropping the from the base of the interval.

Attached: 1225785877026.gif (344x326, 4K)

On the other hand most programmers can't do UX for shit, whatever they tell themselves.
It's more about HR wanting one guy to do every job.

simulate it 10000 times

>drop from 50th
>the egg breaks
>you now have to do all the 49 floors carefully because it's possible the eggs break at the second floor or 49th floor
This is just gamble. If you would take 10 floors at a time you could only go as high as 20 tries. One egg for narrowing the right floor range and one egg to go through that range.

Should be a good bit higher.
Why are starting a recurrence at (1,99)?

My guess with the egg one is you would test with gaps at of the square root size of n. So every ten floors you would drop an egg. When it broke, you would then test the floors one by one starting at the floor you dropped the egg and it survived.

input sanitisation

THREE FUCKING MILLION DOWNLOADS
W E E K L Y

Attached: all hope lost.gif (309x313, 2.91M)

This is just evidence that JS is fucked.
module.exports = function isOdd(i) {
if (!isNumber(i)) {
throw new TypeError('is-odd expects a number.');
}
if (Number(i) !== Math.floor(i)) {
throw new RangeError('is-odd expects an integer.');
}
return !!(~~i & 1);
};

Let's say the egg would break at the second floor because it's a fucking egg and eggs are frail. You start at floor 5, it breaks, so you go with the second egg starting from floor 1.
You go 5-1-2 and break both eggs, while with my method you go 1-2 and break one egg only.
Of course if the egg breaks at floor 50 your solution is faster, but these interviews keep count of the train of thought that lead you to the solution. You can get the "theoretical" solution, but if you say "it's unlikely an egg will survive more than one floor", or ask things like "is the floor concrete or grass?" to the interviewer, you can get many more points for your answer. Optimization isn't always the best algorithm, it's also thinking about the environmental conditions and some practical evidence.

t. a relative of mine told me these things about the "how many tennis balls can you fit into a boeing airplane?" problem

The absolute state of Node.

Attached: Screen Shot 2018-04-30 at 3.29.41 AM.png (1066x522, 39K)

>You can get the "theoretical" solution, but if you say "it's unlikely an egg will survive more than one floor", or ask things like "is the floor concrete or grass?" to the interviewer, you can get many more points for your answer. Optimization isn't always the best algorithm, it's also thinking about the environmental conditions and some practical evidence.
This isn't MBA interviews user CS people are too autistic for those answers.

Nevermind it's 0.00246913580247. I typed the recurrence wrong.

>apply for an internship for a dev position
>go to the job interview expecting obscure algorithms and math
>they ask me to do build a project instead
>fail miserably because I couldn't really build anything after setting the db

I ragequited hard and told the HR woman that if I actually knew how to actually build something I wouldn't be applying for an internship position.
Then I spent the next weeks building all kinds of small commercial system so I'd never be caught off guard.

Attached: 1475719391145.gif (287x713, 320K)

this must be fake
tell me it's fake... please

higher
what's your recurrence?