Alright user, can you write a quicksort using any language you like. and no, you can't use any libraries

>alright user, can you write a quicksort using any language you like. and no, you can't use any libraries

Attached: interview.jpg (1023x682, 57K)

Other urls found in this thread:

rosettacode.org/wiki/Sorting_algorithms/Quicksort
twitter.com/NSFWRedditImage

Okay, here you go. And for the record, this is a bad metric for determining the quality of a potential new hire and you're lucky I just happened to have looked this up recently. It's certainly not something worth permanently memorizing when it's so easy to look up.

Does it have to be the in-place quicksort?

>Yeah but what the fuck does that have to do with gardening?

Attached: go outside.png (353x49, 24K)

I have interviewed plenty of candidates during my time. I usually just get them to solve a distilled version of a problem I'm working on.

this, and also it's much more efficient both in terms of time and in terms of code complexity to just use a built in function, even c has one for fucks sake
good post

>All taxis have GPS
>For your cab drivers license exam you still need to know every street by name and where it begins and ends, just because.

Examiners love this kind of shit because it requires zero effort from their side to come up with these tasks and to correct them, but it puts a huge workload on the examinee.
Used to drive me crazy during my PhD time when my prof would include retarded exam questions that were just "learn a bunch of pointless tables by heart" because that has fuck all to do with being competent.

*yawn*

rosettacode.org/wiki/Sorting_algorithms/Quicksort

That will be $200 000 per year, plus health insurance.

Sorry we're going a different direction. Rajesh and his ten friends are all getting free ride H1B visas to come fill this position.

This is very unfortunate. I guess I'll have to lend my PHP ninja services to the Chinese army and assist them in their attack on the Indian subcontinent then.

> #import pajeets.h

Why would I need libraries?

>I'm sorry, this company just isnt the right fit for me

>Okay, here's a bash script, it searches stackoverflow for the algorythm name of which was given to it and prints the found algorythms to text files. It uses external executables but they're not libraries, so it's alright.

haha cock ass toiet

>you can't use libraries
Well C and C++ are out of the table then because fizzbuzz prints values.

typedef std::vector list;

void quicksort (list &input)
{
if (input.size() < 2) return void();

list lesserList, greaterList;
int pivot = input[0];

for (unsigned counter = 1; counter < input.size(); counter++)
(input[counter] < pivot ? lesserList : greaterList).push_back(input[counter]);

list output;
quicksort(lesserList);
quicksort(greaterList);

for (auto &i : lesserList)
output.push_back(i);

output.push_back(pivot);

for (auto &i : greaterList)
output.push_back(i);

input = output;
}

Attached: tenor.gif (400x208, 277K)

>Why yes, I do implement quicksort everytime I need to sort an array

Attached: gigachad.jpg (1068x601, 56K)

>quicksort(a[1, m]) + [a[0]] + quicksort(a[m + 1, :])
"People" who write this Python-tier garbage and call it quick sort deserve to get killed on the spot. It's called quick for a reason.

No.

Attached: 1555527662684.jpg (831x1024, 68K)

So what fucking else do you do to make yourself more competitive?

>vector
>list
Thanks, we'll keep you informed.

This doesn't even sort

>quicksort using any language you like
I choose English via the use of african slaves
Sort this cotton nigger or ima crack you.

I will admit this is not exactly a "quicksort" but hey it's cheap at least.

y

Literally every modern language uses arrays for their default "list" type nowadays (e.g. Python, C#), because linked lists are garbage and should almost never be used in practice.

>php

Attached: forty_keks.jpg (600x528, 49K)

```
quicksort (x:y:xs) = let (l,r) = partition (

my eyes hurt
im not programmer but now i see why nobodys using php

>i have no idea what i'm talking about, but....

Reminder that it's okay to ask for a description of the algorithm you're implementing. With this in mind, the question is piss easy.

Heh you underestimate my power
(defun quicksort (lis)
(if (null lis)
nil
(let* ((x (car lis)) (r (cdr lis)) (fn (lambda (a) (< a x))))
(append (quicksort (remove-if-not fn r)) (list x) (quicksort (remove-if fn r)))
)
)
)

so ur telling me that you wouldnt be able to write a quicksort? What if he explained how quicksort algorithm is supposed to function ?

Sounds like a pretty easy task to do in some pseudo code

I'm going to wrote learn quicksort in php just on the off chance I ever get asked this question. Solely as a fuck you to the examiner

Make sure to remember to name your variables cock and ass.

sure, why not

i mean if someone tells you how an algorithm works there is near 0 effort required to implement it, it varies with how large the algorithm is but sorting is really fucking low on the totem pole for size. also that's antithetical to the entire purpose of programming, you're supposed to get a spec and produce code not the other way around. the only thing this would do is MAYBE test the persons syntax proficiency? but there are better ways to do this. furthermore it's asking the interviewee to show bad coding practice. if somebody asked me to do this i would ask them why they would like to see this and if they didn't give a satisfactory answer i'd just walk dude, i'm not desperate enough to work on that kind of dev team, not yet, and if i was i'd probably walk within 6 months

>php
Good job user, we will call you back!

>typedef
Don't call us, we'll call you.

Yeah but my Coq solution doesn't fit on your 2000 characters paper.