Final interview stage

>final interview stage
>whiteboard rolls out
>asked to invert binary tree

I have no trouble solving maths problems, but questions like these always strike me down on the spot.

It's no different to IQ tests: beforehand you look up other peoples answers to better understand the question. Regurgitate if you're shit, rewrite if you're not

thx fr this life tip

>go through company's online application form
>digital whiteboard appears
>asked to implement a hash table while minimising collisions

>invert
>DRAW BINARY TREE ON WHITEBOARD
>FLIP WHITEBOARD UPSIDE DOWN

doesn't that just mean restructure it so that whatever sort operator was used to define it is reverse?

nigger, just mirror the fucking thing left to right. where the fuck did you go to school? fuck off, pajeet.

>Binary tree
I assume this means binary seach tree. In which case you probably don't even need to touch the underlying data structure, just swap the left/right node accessor methods.

You're in the club and this guy slaps your gf's ass. What do?

Can someone explain me this meme please?

which one?

>have real career
>don't have to do any of that nonsense

for each node
swap left child node with right child node

wow that was so hard

>read up on interview questions
>master summing up primes to 2 million
>get to interview
>asked to sum all primes up to THREE million

kek

>read up on interview questions
>memorize fizzbuzz
>get to interview
>asked to buzzfizz

>ate final tendie
>tendies gone
>have to do something for myself but can't

>final interview stage
>this man rolls out whiteboard
>asked to give a quick rundown

>enter interview room
>employer sees Im not black
>get job

>Presidential race almost over, last TV debate
>SUDDENLY, DEBATE MODERATOR WHEELS OUT A WHITEBOARD
>"The President has to be able to show how to invert a binary search tree."
We wouldn't have needed to worry about Trump becoming president.

>shout WRONG in the face of the interviewer

>enter interview room
>employer sees Im not black
>didn't get the job

Serioulsy, what kinds of jobs are you guys applying that require you to do this shit? A fucking binary tree, sum prime number, fucking why?

Familiarity with the basics of data structures and algorithms. And the ability to solve simple problems yourself.

Too smart not to work

>final interview stage
>whiteboard rolls out
>asked to prove the Goldbach conjecture for the first 2 million integers

It's funny all the delusional fantasies you bernouts think of.

>based whiteboard keeping women and niggers out of programming jobs
Thank you based -WHITE-board

what was the answer to this one again?

Lol we did that at 3rd year in High school.

That's easy.
import irrelevant_library
irrelevant_library.library_specific_function (":^)")

hahah

LMAO.

kek'd

>tfw can't sum all primes above 2 million

>final stage of the interview
>whiteboard rolls out
>asked to draw the HR manager's fursona

>fail because I forgot to draw the diapers

Rotchilds bow to Bogdanoffs something something

What does even mean? Just recursively swap left and right nodes?

>enter interview
>go straight to whiteboard
>cd
>cd code
>ls
>hired

MADMAN

Congratulations, you got the job.

The whiteboard meme

some faggot was asked to do a binary tree

There is a whiteboard interview study group at my school. They are really good at these types of questions, but some of the worst programmers I have ever met. Feel bad for whoever hires them.

>final interview stage
>memorized my fizzbuzz pretty well
>asked to do a weird variant of fizzbuzz where fizz is on divisible by 5 and buzz at divisible by 4
They did it on purpose because they want to hire a fucking pajeet instead

>asked to fizzbuzz the inverse of the prime tree
I'm not going to get this job, am I?

>gf
>your

just because shes 2d doesnt mean shes not real

>get asked technical question in interview
>pull out my pocket-whiteboard TM
>get job

Explain?!??

>mfw I literally got asked to sum all primes below 2 million

Study up nigs

I still don't understand what is even meant by inverting a binary tree.

That's why pajeets and rajets get you job, murica.

I see it like this
>traverse tree
>get some array as output
>traverse the inverse tree
>get same array as above but in inverted order
>find the inverted tree

yeah, thats probably what would have happend

That's possibly the most CS-student thing ever

>Final interview stage
>Asked to sum all prime numbers
>Forget the last one

Sum of natural numbers is -1/12, sum of all primes must be lass than that, coz you know, less numbers to sum.

This

Kode with user

t. CTR millennial anal gay cunt cuck kike
fuck off back to /utg/

>white women don't exist
???

Sum of natural numbers is not -1/12, it's just a silly trick you can do with sets.

isn't that just a notepad?

This happened to me. Implemented a sieve, then was asked to sum 1 trillion. My sieve crashed with memory error building the array at around 2 billion, using over 8GiB of RAM, and I couldn't optimize it on the spot.

>optimize
There's no optimizing to do, you just wrote a worthless sieve. Every natural number up to 2 billion should only take up about 8MB of RAM.
1 trillion should take up about 4GB.

You were probably storing duplicates of numbers or passing things around by copy instead of reference.

You're supposed to use a mirror, dumbass

It's just a different summation technique. It's only useful if you're trying to categorize divergent sums or if you need to come up with a crazy physics theory to keep the grant money coming.

>1 trillion should take up about 4GB.
1 trillion is 1*10^12. Using truth testing, and the smallest array possible in Python of an unsigned char of 1 byte, then the array would consist of 8*10^12 bytes = 8*10^12 / 1024^3 = 7451 GiB, minimum. Now a byte array is what you're talking about, but the fact still remains no arrayed sieve bytes array or not is able to sieve 1 trillion. If you look at all the implementations out there, like, say, primesieve, they all use segmented sieves with wheel factorization, and segmentation and wheel rolling optimized for specific limit.

Wouldn't a 2 billion entry bitmask take up around 250 MB?

I still think it's funny that Trump faced far more significant challenges that Bernie and that communist kike still got BTFO. And paid less taxes than Trump lmao

Have you ever had a job interview for a technical position?

Never had an interview for a position

>Python
there's your problem

...

Are we getting all that threads because of the folks graduating soon and are currently interviewing

yep

Is this really that difficult? I'm pretty sure this is correct.

public Node invertTree(Node node) {
if (node == null) return;
// Invert
Node tmp = node.left;
node.left = node.right;
node.right = tmp;
invertTree(node.left);
invertTree(node.right);
}

...

invertTree(root);

Whoops, it's a void function but anyways

itt: user doesn't undestand scope

I'm pretty sure that it works just fine. What could have been changed is that it would return the Node after the two invert calls, and then below assigned the new root to the inversion of the tree.

If fellating rednecks is a challenge, yes.