TFW practicing daily coding on Leetcode actually made me noticeably better at in weeks

Wheel in the whiteboard, i'm ready

Attached: 1526408236565.jpg (322x322, 15K)

Other urls found in this thread:

datagenetics.com/blog/july22012/index.html
github.com/scriptnull/compilex/blob/master/README.md#deprecation-notice
twitter.com/SFWRedditVideos

Write a program that can play and win the bulls and cows in 6 moves or less.

is this some sort of shilling attempt?

Haxing on Hackerrank(TM) Premium(C)
LIKE A BOSS!

Pop quiz hotshot.

Attached: 1528678312193.png (851x846, 573K)

>muh math questions

>1
can't do binary search tree cuz eggs may break at 50, 25. so start at one, then go up by every other floor. If an egg breaks, go down one, drop the remaining egg. if it breaks, that's the limit. Otherwise it's the previous floor.

>2 & 3

datagenetics.com/blog/july22012/index.html

How is 2nd question sci?

Egg drops, not breaks. Thus recursively determining which floor they break on is best

Shit algorithm, have fun guessing it's floor 100

Number three is very unlikely to the point of impossibility. You will run it of red once but the blue one will be forever.

So you know what recursive means? You could use many strategies recursively.

wut, if there's a single blue ball left it would get discarded.

1. Start with floor 50 then 25 or 75 accordingly and continue halfing until you reach the floor. You want to maximise your information gain from 1 egg.

2. Dunno what the problem is

3. If it doesn't matter whether the last ball is discarded then the probability is just the same as the red ball being in the last place which is 80/100 = 4/5. If it does matter then it's the probability that the previous ball is blue * the probability that the last ball is red: 20/100 * 80/100 = 4/25.

0/3

Attached: __original_drawn_by_nikaidou_kou__c370304cb6436fe7feed4b5b97712fe6.jpg (1447x2046, 374K)

>All these retards itt

You solve 1. by binary searching until one egg breaks. Only after that you start iterating upwards.

Assuming that n*log(n) is acceptable, do a binary search on each column. If the min is less than the previous min, update your minimum value - EZ. not sure how youd do it faster seeing as iterating over each element is n^2 so throwing everything into a data structure is not an option

Attached: 1509274959279.jpg (640x480, 63K)

several of my friends did around 300-500 of problems on there, then were able to get offers from places like google and fb where their salary + rsu + annual bonus give them 300k+ total annual compensation

it's definitely worth it desu

Attached: 1512837816561.gif (246x208, 747K)

Everyone can do better Ruben : )

Hope you are ready for the performance review this Thursday, Peter.

Attached: 1527704113774.png (680x618, 594K)

these are literally undergrad math problems...

If they’re so easy what’s the answer?

1. Seems impossible since the question specifies you only have 2 eggs. It's impossible to tell with only two tries

good start. you can go up by 3 at a time instead
>let's say egg breaks on 3
>test other egg on 1
>if it breaks, 0 is the limit
>else if it lives, test 2
>>if it breaks, 1 is the limit
>>else 2 is the limit

wow i was completely wrong

nice just installed 10k

github.com/scriptnull/compilex/blob/master/README.md#deprecation-notice

redpill me on leetcode vs hackerrank

leetcode has good solutions provided.
I started with hackerrank. Now im doing leetcode

>tfw good at leetcode/codefights/hackerrank
>tfw don't know anything about actual development so can't get a job

>Start with floor 50
>it breaks
>have to test floors 1-49 one at a time like a fucking chump

>Start with floor 50
>it breaks
>have to test floors 1-49 one at a time like a fucking chump

HackerRank is good for starting out.
LeetCode has focus on getting you the skillset employers want to see. They have great challenges on algorithms and data structures. Also they have lists of questions the big tech companies (Google, Amazon, M$, etc) ask. I've interviewed at Amazon and it was damn accurate.

One other thing I really liked was it shows your code's execution time vs other people. You can see what their code was and possibly learn a better technique.

Cracking the Coding Interview to start out

Then when you are comfortable swap to hardcode Leetcode, do not check solutions until you try for at least 20 minutes

Bullshit. There is a need for swdevs, to the point they have 3-month bootcamps in SF and the majority of graduates find work. If you apply to enough places, even as a junior dev, you'll find interest. You might have to relocate, but yeah.

Hell, even these products offer ways to connect you with employers.

(this is under the assumption you can beat all of leetcode)

Well, I'm in Canada and even the big tech companies here start asking behavioral questions and questions about personal projects that I can't answer. I then get rejected even after acing the technical portion.

A recruiter from codefights did contact me, but she ghosted me despite saying she'd get back to me.

Literally wrong on 1. Binary search on this will not work, and stepping by 2 is laughably inefficient.

Still laughably inefficient.

For a beginner, thoughts on
>Codewars
>Rosalind
?

I also fall apart on tech trivia questions. I only do well at algorithm and data structure type questions.

I have a CS degree, as well. I should honestly just kill myself.

wut

doesnt this just take us back to binary search?

>try 50
>if it breaks, start at 1

When you guys say binary search, are we talking algorithm or something more complex?

>questions about personal projects that I can't answer
Why can't you answer question about personal project?

I don't have any except some minor open source contributions.

It isn't stated what they mean by minimum amount of steps specifically. Minimum steps in terms of expectation or in terms of worst case? Worst case minimum is at most 24 by trying dropping from floors 5, 10, ... until the first egg breaks at floor 5*n. After that you try dropping from 5*n-4,...,5*n-1. You could try out this strategy for different steps sizes (e.g. 10 instead of 5) to the actual optimum.