[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Just bombed an interview. Got asked to implement the bubble sort

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 89
Thread images: 11

File: 1458872142395.png (440KB, 645x1260px) Image search: [Google]
1458872142395.png
440KB, 645x1260px
Just bombed an interview. Got asked to implement the bubble sort sorting algorithm on a whiteboard, and sum all the primes below 2 million. Never heard of bubblesort until then, and they actually expected me to compute the primes myself. They walked me through the sorting algorithm, but I couldn't catch on and failed. Then I told them I could sum the primes if I had them, but they weren't impressed. I've never felt so defeated.
>>
>>59611004
kys desu oniifam
>>
File: 1438188382313.jpg (170KB, 500x598px) Image search: [Google]
1438188382313.jpg
170KB, 500x598px
>>59611004
You did good anon, you would have never made it there but at least you tried.
Keep looking.
>>
>>59611004
But we had a thread on summing the primes below 2 million a few days ago...
>>
>>59611004
>I could sum the primes if I had them
lololol
>>
>>59611004
I suppose this is a reference to >>59600909
>>
>>59611004
Don't worry anon. I love you and believe in you. You will find your path.
>>
>>59611004
The primes one is basic math. You need to re learn math if you failed that one.

As for the bubble sort...
Are you fucking kidding me? That shit is the easiest fucking sort that there is. It's shitty but it's easy as FUCK to implement.
>>
>>59611004
>see shitpost on /g/ with 200+ replies
>make a shittier re-post

Just fucking kill yourself, you retarded fucking faggot piece of shit.
>>
What company?
>>
File: frog.jpg (528KB, 3072x2463px) Image search: [Google]
frog.jpg
528KB, 3072x2463px
Fresh meme you got there
>>
>>59611004
This is an elaborated pasta.
>>
>>59611187
There is literally no reason to memorize sorting algorithms.
>>
>>59612024
You don't have to memorize it. The interviewer will describe it to you. It's very easy to write.
>>
>>59612024
I don't even memorize the interpolation formula, I just figure it out each time I've implemented it using the powers of knowing-what-the-fuck-I'm-doing.

The bubble sort would make for a good interview question, maybe if you had to write it out on a whiteboard in front of a panel of people who will scrutinize your problem solving and development skills, without the aids you could find on a computer. It could really help weed out the useless fucks who couldn't do it, or started complaining about it.
>>
>>59611004
hahahahHAHAHAHAHAJAJjaj
>>
im not a programmer or cs major but these feels remind me of when I was in highschool and I know I failed a math test

some things are just not meant to be

you will find your path regardless, keep your head up
>>
>>59611004
>they actually expected me to compute the primes myself
wait, so they wanted you to compute every single prime under 2 million, right there on the spot, or they wanted some code that would do it?
>>
>>59612381
are you retarded?
>write code that gives me the sum of all primes under 2 million

>do the sieve of erastosthenes whathisname some old greek fuck
>sum

it's not hard.
>>
>>59611004
Dude bubble sort is CS50 level shit, as in INTRO TO COMP SCI shit.

Look at a free class online. Fuck I'm feeling charitable, here you go from Harvard, totally free lectures:
https://video.cs50.net/2016/fall/lectures/
>>
>>59612416
>>59612381
You didn't even need to know the sieve.
It'll take a long fucking time, but you can naively compute every single prime up to 2 million by checking if it's divisible by any number other than itself.
This only requires that you understand what a prime number is, and if you don't, then you don't know basic math and don't deserve the job.
>>
You guys are fucking dicks. It's 2017 and we have google, not every programmer can be expected to remember what a Bubble Sort is.
>>
File: 1457311653242.jpg (8KB, 250x237px) Image search: [Google]
1457311653242.jpg
8KB, 250x237px
>>59611004
>Then I told them I could sum the primes if I had them, but they weren't impressed.
I haven't laughed this hard in a couple of months.

Here's 1 (you) for a wojack on hard times.
>>
>>59612821
No respectable employer would hire you if you did that. They expect you to actually know your shit. They aren't giving you the problem just to confirm you know the basic definition of a prime number.
>>
>>59612882
You're gonna memorize a fucking sieve?
What purpose does it even serve?

This is just a retard test to prove they actually know how to write code and know basic math because 99% of applicants are lying out their ass and the employer knows this.
>>
>>59611004
>Programming jobs
I'm just sitting here being a comfy network and Linux admin
>>
>>59612821
>It'll take a long fucking time
No, trail division up to 2 million in increments of odd numbers take seconds in any language, even interpreted. Where did you come to the conclusion that it'll "take a long fucking time"?
This Python code takes ~20s on my machine:
primes_sum = 2
for i in range(3, 2000000, 2):
if not any(i % ii == 0 for ii in range(2, int(i**0.5) + 1)):
primes_sum += i

>naively
Trail division is not "naive", it's a viable method for small numbers with little overhead (faster than any sieve or primality check), and guarantees primality.
>>
>literally sent my resume to 200 places this year
>not a single interview and only about 22 rejection emails.

Only 1 in 10 companies have the decency to acknowledge that they rejected you.
How do you retards like you even land interviews?
>>
>>59612940
Sending your resume out to too many places flags the system desu
>>
>>59612938
>Python
into the trash it goes.
>>
>>59612955
>Sending your resume out to too many places flags the system desu
why does this make any sense at all?

what fucking system are they using?
>>
>>59612959
>I don't know a sieve, and trial division will take a long fucking time, so I'm afraid I can't attempt a solution
Into the trash you go.
>>
>>59612938
20 seconds is a long time, relatively speaking.
>>
>>59612971
>why does this make any sense
Weeds out the tards desperate for a job and are applying everywhere in comparison to those who are talented and are selectively applying. In addition applying to the same place within ~6 months flags you too.
>>
>>59612985
>greentexts about completely irrelevant topic
>still using python
fuck off retard.
>>
>>59612906
What kind of jobs are you applying to that they have to sort out the retards this way? Usually the code test follows some kind of interview, by which point it's already established you aren't a complete drooling retard and know your abcs and basic math. In code tests where I give the stupid obvious solution and instead of something more optimal the answer is always "well that works but here's how you can improve it". They are nice about it but it's obvious they don't like it.
>>
>>59613025
You wouldn't believe the amount of unskilled laborers who fake their resumes and think they won't be tested because there's zero barrier for entry in software jobs.

There really needs to be some kind of certification process to eliminate retards, like every other "engineering" field.
>>
>>59612938
>~20 seconds
>"not a long time"
>t. Python Developer
The memes write themselves.
>>
>>59613060
I know there are fakers out there. I don't believe that this is how they weed out the fakers.
>>
>Apply for software dev position
>Interviewer asks me about my personal achievements, internships, previous jobs, projects, teamwork experience, etc.
>Go into in-depth discussions about all of these topics.
>Get hired
>No ridiculous coding questions

Why can't more companies do this? Companies hiring people that answer a question with an algorithm they memorized are doomed to fail
>>
>>59613105
an easier way is to simply filter out all the brown people names

indians are an exception because they're cheaper
>>
>>59613129
>with an algorithm they memorized
You're supposed to understand every single algorithm you use. Just like you're supposed to understand every single arithmetic operation you use in your code.
>>
>>59613129
>Why can't more companies do this?
would probably go bankrupt.

apple can hire shitters because most of their money comes from manufacturing.

also post your resume.
>>
>>59613129
I'd fail these right away because I have no internships, previous jobs, or teamwork experience.

I'd also have nothing to talk about because my hobby is playing japanese rhythm games and I'm sure he wouldn't give 2 shits about that.
>>
>>59611187
Not everybody memorizes pointless trivia out of Cracking the Coding Interview
>>
>>59611004
>they asked me to compute primes!
This is absolutely terrible. I cannot believe that these interviewers could be so cruel and heartless. You should sue!
>>
>>59613260
Hey falcon why don't you offer your hires a living wage?
>>
>>59611004
now you know exactly what to learn and just how well to learn it
this is the part where you practice, then try again
>>
>>59613280
I have checked the salaries of fresh grads, and mid-level programmers, and I offer above what they would earn if they worked somewhere else. I cannot offer USD$300k/year, because I can only afford to pay a middle-class SEA wage.
>>
>>59612938
>Python trail division: 20 seconds
>Python sieve: 2.578 seconds (from Project Euler)
>C sieve: 0.036s
Into the trash with your shitty language.
>>
>>59613348
>Python sieve: 2.578 seconds
Sieves typically take under 1.5 seconds in Python.
>comparing interpreted language to C
>>
>>59613348
>>59613419
this doesn't really matter until you try summing all primes under 20 billion.
It takes a whole minute in C even with memory optimizations.
>>
>>59613419
>Sieves typically take under 1.5 seconds in Python.
Got the number from here:
http://www.s-anand.net/euler.html

Is there a faster Python solution?

Pic: New number after some optimizations.
>>
>>59611004
kek its just two for loops and a if statment fucking sped
>>
>>59613445
OH! That sounds like a challenge :-)

If the thread is up later tonight I'll let you know if I managed to beat it.
>>
I've been programming for 2 weeks and could solve both of these, and write them in 2 languages.
Because both of them are in chapters 7 and 8 and I have fresh memory of the algorithm.
What a useless fucking test.
>>
>>59611004
>Then I told them I could sum the primes if I had them, but they weren't impressed.

HAHAHAHAHA

ohgod i'm so sorry OP, i know that feel
>>
>>59611004
>i know how to add numbers pls gibe job

wew lad
>>
>>59611004
I wish I could even get an interview. Questions like those would be so fucking easy. Even if I didn't know how to solve it before, there's no way I wouldn't be able to work out the problem in <30 minutes
>>
>>59613893
Write a nice resume, place it on [your country's preferred job sites], apply to jobs.
>>
File: 1478667684302.gif (2MB, 320x240px) Image search: [Google]
1478667684302.gif
2MB, 320x240px
>>59613893
>Here anon, show me that you know bubble sort. It shouldn't take more than 5 lines of code
>Sure, give me 30 minutes
>>
>>59613928
He was asked two questions. And I said less than that time. Are you dumb?
>>
>>59613907
>place it on [your country's preferred job sites]
Why do I have to sign up for and use glorified social media and tracking sites just to get a job?
>>
>>59614111
because most people looking for jobs do, and most companies with open spots do, they're not going to have a HR intern browse /g/ to offer applications
>>
These whiteboard tests are always so fucking simple and yet autists reeee about them all the time.
You don't deserve a job desu. You probably cheated your way through a degree.
>>
>>59614111
>Why do I have to sign up to a job search site just to search for jobs?
Continue with your logic:
>Why do I have to sign up to a email site just to send and receive emails?
See how that sounds retarded?

If you do not want to search for jobs, don't.
>>
>>59611004
bubble sort is taught in any intro comp sci class

you deserve it anon
>>
>>59614368
100% of job sites are resume black holes

if you don't know people IRL, you're not going to get a job
>>
File: Untitled.jpg (268KB, 1196x988px) Image search: [Google]
Untitled.jpg
268KB, 1196x988px
>>59614381
That is correct and 100% factual. When you put your resume on a job site, you will get emails about potential jobs. Those emails are, of course, fake emails, and must be deleted. Also, you can search for jobs and find them on job sites... but these are fake jobs that do not really exist.

Pic related. It is all fake.
>>
>>59612882
>>59612821
The point of these interviews is to understand your thought process, not to show how much trivia you know.

It's alright if you don't know about the Sieve, or don't have a fizzbuzz program memorized, or whatever. It's great if you do, but what's more valuable to the interviewer is seeing how you handle something new, and how you communicate while working on problems.

>"Hm, yeah I think I see how we could do this. Let's just start by iterating through all the values from 1 to 2 million, and then for each one dividing by every smaller number to see if it's prime. Obviously that's not the most efficient algorithm, haha, but it would get the job done, and I can already see ways to make it faster. Like what if we skipped the even numbers? And we don't need to divide by every smaller number to check primeness."

You wanna prove that you can not only solve problems, but communicate well about these problems, too. Compare with the autist who stares at the chalkboard and then gives up after a few minutes of silent thinking. Or the autist that silently steps up, rights a solution, and mumbles that he's done.
>>
>>59614413
meanwhile in the real world
>write psuedocode
>anon you're supposed to write it in [language]
>omit boilerplate because it's psuedocode
>anon your example doesn't run you forgot a semicolon here
>i'm sorry anon but that doesn't match the example I have on this sheet of paper
>thank you for your time we'll call you dont call us
>>
>>59614138

you know, /g/ could potentially be a source of cheap labor, for companies who don't want to hire street shitters. how many NEETs here would jump at the opportunity to work for literally free, to have something to put on their resume?
>>
>>59611004
>>59613893
>>59614581

Getting an internship is easy as fuck I don't know what you guys are doing wrong. I was a business major my freshman year, switched to CS my sophomore year and now it's my junior year so i'm only one year into my CS degree and I already secured an internship for the upcoming summer, I accepted my position in December last year and started applying in November, only took a month.
>>
>>59614679

My situation precludes an unpaid internship, and that's all that I can find where I live. I've applied for them anyways, but haven't gotten any calls back.
>>
>>59614368
>Why do I have to sign up to a email site just to send and receive emails?
What kind of bullshit fallacy is this? You have an option to host your own email, or choose any email provider you deem fit. The same can't be said with what you're implying, because in that scenario you don't have an choice besides what's popular in the short list of viable job sites, or don't have a job at all. Certain email providers respect your privacy. But every major job site I've looked at 1) collects user data as per their privacy policy, 2) shares it with third parties in many instances, and 3) no option to opt-out, e.g. by using the site you agree to their user agreement which includes privacy policy policy. This isn't fair.
>>
>>59611004
All this work for a 50k a year salary. Top kek. Sorry poor fags.
>>
File: 1487647496529.png (207KB, 600x635px) Image search: [Google]
1487647496529.png
207KB, 600x635px
>>59611004
>Got asked to implement the bubble sort sorting algorithm on a whiteboard, and sum all the primes below 2 million
It's like people forgot this thread about primes already.
>>
File: 1490331675910.png (196KB, 1282x1055px) Image search: [Google]
1490331675910.png
196KB, 1282x1055px
>>59613260
Hello, falcon, you cold machine.
>>
>>59611004
You've destroyed my sides
>>
>>59614943
>But every major job site I've looked at 1) collects user data as per their privacy policy, 2) shares it with third parties in many instances
Wait, so your data, which yourself upload to the site, should not be collected? Also: A job site's function is to let third parties (employers) view your data. How would they know if they want to hire you otherwise?

>3) no option to opt-out
That would be bad.

>>59615365
I am updating that.
>>
>>59615919
i hope you realize you're being baited
>>
>>59614215
Actually autists solve these easily. It is the fratfuck cornholed brogrammers who fail.
>>
>>59611004
>can't even write bubble sort
lmaoing @ your life
>>
>>59615365
>all those theory questions

It's like a collection of all that bullshit Google asked at interviews that they eventually realized was completely useless
>>
File: yugoho.jpg (60KB, 480x600px) Image search: [Google]
yugoho.jpg
60KB, 480x600px
>>59611004
>literally learned how to do these things in AP CS back in high school
probably didn't belong there anyway anon
>>
>>59611004
>Never heard of bubblesort until then
Uhhhhh.
>>
>>59611004
Based whiteboard doing its job!
>>
>>59612821
You don't have to check every number, just those that are less than the square root of the number being tested.
>>
>>59622900
you don't have to know that tho
Thread posts: 89
Thread images: 11


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.