Just bombed an interview. Got asked to implement the bubble sort sorting algorithm on a whiteboard...

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.

Other urls found in this thread:

video.cs50.net/2016/fall/lectures/
s-anand.net/euler.html
twitter.com/SFWRedditImages

kys desu oniifam

You did good user, you would have never made it there but at least you tried.
Keep looking.

But we had a thread on summing the primes below 2 million a few days ago...

>I could sum the primes if I had them
lololol

I suppose this is a reference to

Don't worry user. I love you and believe in you. You will find your path.

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.

>see shitpost on Sup Forums with 200+ replies
>make a shittier re-post

Just fucking kill yourself, you retarded fucking faggot piece of shit.

What company?

Fresh meme you got there

This is an elaborated pasta.

There is literally no reason to memorize sorting algorithms.

You don't have to memorize it. The interviewer will describe it to you. It's very easy to write.

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.

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

>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?

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.

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:
video.cs50.net/2016/fall/lectures/

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.

>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.

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.

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.

>Programming jobs
I'm just sitting here being a comfy network and Linux admin

>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?

Sending your resume out to too many places flags the system desu

>Python
into the trash it goes.

>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?

>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.

20 seconds is a long time, relatively speaking.

>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.

>greentexts about completely irrelevant topic
>still using python
fuck off retard.

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.

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.

>~20 seconds
>"not a long time"
>t. Python Developer
The memes write themselves.

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

an easier way is to simply filter out all the brown people names

indians are an exception because they're cheaper

>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.

>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.

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.

Not everybody memorizes pointless trivia out of Cracking the Coding Interview

>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!

Hey falcon why don't you offer your hires a living wage?

now you know exactly what to learn and just how well to learn it
this is the part where you practice, then try again

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.

>Python trail division: 20 seconds
>Python sieve: 2.578 seconds (from Project Euler)
>C sieve: 0.036s
Into the trash with your shitty language.

>Python sieve: 2.578 seconds
Sieves typically take under 1.5 seconds in Python.
>comparing interpreted language to C

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.

>Sieves typically take under 1.5 seconds in Python.
Got the number from here:
s-anand.net/euler.html

Is there a faster Python solution?

Pic: New number after some optimizations.

kek its just two for loops and a if statment fucking sped

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.

>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

>i know how to add numbers pls gibe job

wew lad

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

Write a nice resume, place it on [your country's preferred job sites], apply to jobs.

>Here user, show me that you know bubble sort. It shouldn't take more than 5 lines of code
>Sure, give me 30 minutes

He was asked two questions. And I said less than that time. Are you dumb?

>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?

because most people looking for jobs do, and most companies with open spots do, they're not going to have a HR intern browse Sup Forums 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.

>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.

bubble sort is taught in any intro comp sci class

you deserve it user

100% of job sites are resume black holes

if you don't know people IRL, you're not going to get a job

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.

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.

meanwhile in the real world
>write psuedocode
>user you're supposed to write it in [language]
>omit boilerplate because it's psuedocode
>user your example doesn't run you forgot a semicolon here
>i'm sorry user 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

you know, Sup Forums 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?

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.

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.

>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.

All this work for a 50k a year salary. Top kek. Sorry poor fags.

>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.

Hello, falcon, you cold machine.

You've destroyed my sides

>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.

I am updating that.

i hope you realize you're being baited

Actually autists solve these easily. It is the fratfuck cornholed brogrammers who fail.

>can't even write bubble sort
lmaoing @ your life

>all those theory questions

It's like a collection of all that bullshit Google asked at interviews that they eventually realized was completely useless

>literally learned how to do these things in AP CS back in high school
probably didn't belong there anyway user

>Never heard of bubblesort until then
Uhhhhh.

Based whiteboard doing its job!

You don't have to check every number, just those that are less than the square root of the number being tested.

you don't have to know that tho