*wheels in whiteboard*

*wheels in whiteboard*

I'm conducting my first whiteboard interview next week? What should I ask to filter out brainlets and normies?

Attached: 1029476899.jpg (1500x1500, 129K)

not use a whiteboard interview

fizzbuzz and tree traversal. that should be enough.

Ask them to tell you who Terry Davis is and to describe his accomplishments

Attached: 1558836196271.gif (300x424, 2.56M)

Some fucking shit about hashes.

Or get them to do the whole thing with their bad hand

Just show them your gun

prove the Central Limit Theorem using the Method of Characteristics.

Have them write a function that reverses a string.
Have them write a function that determines if a string is an anagram.
Have them write a function that implements a simple sorting algorithm e.g. selection/insertion sort.
Have them write a function that implements binary search
Have them write a recursive function e.g. fibonacci

kek i solved all your problems within 1 second in my head already.
brainlets can't do this quickly.
nice set of questions.

Maybe as stage one as this will sort out the high school dropouts but any code monkey should be able to resolve this.

None of them are particularly hard but they provide a filter for liars and mommy coders who copy pasted a simple node.js app on their udemy course

Exactly. What position are you hiring for? Programmer I? My questions should be fine. Senior dev? Yeah you need to see work and ask more demanding domain-specific questions.

>Have them write a function that implements a simple sorting algorithm e.g. selection/insertion sort
Brainlet here, would a function().sort]/code] satisfy this as opposed to writing the sorting algorithm yourself?

Good god damn I actually am retarded

no
kys

Well, it's been nice meeting you, user. We'll let you know our decision within a few days.

def reverse(str):
return ''.join(reversed(str))

def anagram(str1, str2):
return {c for c in str1} == {c for c in str2}

def sort(l):
return sorted(l)

def search(tree, val):
if val == tree.val:
return tree
elif val < tree.val:
return search(tree.left, val)
elif val > tree.val:
return search(tree.right, val)

def fibonacci(n):
acc1 = 0
acc2 = 1
for i in range(n):
acc1, acc2 = acc2, acc1 + acc2
return acc2

Um, as was just said, you can leave now....

And this is how you fail the simple test :)

I'm hiring a full stack engineer for a major software company (not FAANG). Everyone has already passed an online test

Make them tell you the final solution to the jewish question.

String str1 = "hello", str2 = "";
int count = 0;
for (int i=0; i>=str1.Length()-1; i++) {

}

This is all I've got so far. What do I do next bros

you literally kill yourself.

I fixed your picture OP, no need to thank me.

Attached: 1566681184388.jpg (1500x1500, 417K)

String str1 = "hello", str2 = "";
int count = 0;
for (int i=0; i>=str1.Length()-1; i++) {
// assuming we declared the necessary api calls somewhere
__asm {
pushad
mov EAX, 0xDEAD
push EAX
call TerminateProcess
popad
}
}

Attached: 1564720310291.png (750x573, 374K)

>Have them write a function that determines if a string is an anagram.

A lone string cannot be an anagram, surly you mean palindrome?

is that the JVM instruction set?

These questions stump a lot of people, even those with degrees.

Draw a map of cyberspace

why RISC architecture won over CISC.
what's System V ABI
how to use 64 bit registers in x86_64 instructions.

They wouldn't hire you because even though your code is compact literally no other programmer that might eventually need your code would ever understand this. Also if you present this on the whiteboard they'd just look at you in utter disappointment.
Reversed string uses a predefined reversed() function, which is bad practice.
Anagram just compares two strings. anagram('banana', 'banana') would return true, even though they're not anagrams.
Sort is just a predefined function. Bad practice.
What is tree supposed to be? A class? What happens if val doesn't exist in tree?
Your fibonacci function isn't a recursive function either.
There aren't comments, which would knock you out as well. I really hope this is bait, or else I have some extremely bad news for you.

If you really want to succeed, you gotta write your (pseudo)code on the whiteboard that even somebody who never even touched a computer would understand it. Exercise 1 for example:
// Reverse a string. Complexity O(N).
string reverseString(string input) {

// Split the input to a character array.
char[] characters = input.ToCharacterArray();
// You can also splice it up using a .split('') function.
char[] characters = input.split('');

// Build a new string by doing a reverse for loop on the character array.
string outputString = "";
for(i = characters.length - 1; i > 0; i--) {
outputString += characters[i];
}

// Return this output string.
return outputString;
}

>why RISC architecture won over CISC.
Did it? It feels like we now have hybrid-architectures everywhere, which have tons of registers, but also have complex instructions like doing AES rounds and Vector instructions. It's just that intel came from a pure CISC design while ARM came from pure RISC.
Or am I wrong?

>Have them write a function that reverses a string.
function reverse(s){
var s2 = '';
for(var i = s.length - 1; i >= 0; i--){
s2 += s[i];
}
return s2;
}


>Have them write a function that determines if a string is an anagram.
I think you mean palindrome.
function isPal(s){
var s2 = '';
for(var i = s.length - 1; i >= 0; i--){
s2 += s[i];
}
return s2 === s;
}


>Have them write a function that implements a simple sorting algorithm e.g. selection/insertion sort.

function lowestFirst(a){
for(var y = 0; y < a.length; y++){
for(var x = 0; x < a.length; x++){
if(a[y] > a[x]){
var temp = a[y];
a[y] = a[x];
a[x] = temp;
}
}
}
}


>Have them write a function that implements binary search

function binarySearch(a, target, isSorted){
if(!isSorted){
lowestFirst(a);
isSorted = true;
}
var half = Math.floor(a.length/2);
if(a[half] == target){
return half;
}
else if(target < a[half]){
return binarySearch(a.slice(0, half), target, isSorted);
}
else if(target > a[half]){
return binarySearch(a.slice(half), target, isSorted);
}
}


>Have them write a recursive function e.g. fibonacci
function fibo(out, iterations){
if(out.length == 0){
out[0] = out[1] = 1;
}
out.push(out[out.length - 1] + out[out.length - 2]);
if(iterations-- > 0){
fibo(out, iterations);
}
}

Using predefined functions is good practice, but bad for interviews.

White board interviews are really only good for seeing people's thought processes, you're supposed to ask for solutions to logic problems. If this isn't an entry level position and you ask them to write correct code on a whiteboard you'll have a 60%+ wak rate

Fizzbuzz quine in C that outputs its own assembly

Good ol' binary search in sorted array makes the pajeet tremble.

>>Have them write a function that determines if a string is an anagram.
>I think you mean palindrome.
Why would you assume he meant palindrome when he said anagram?

You'd need two strings for them to be anagrams of each other. An anagram is two words that have the same amount of whatever letters they have. "dear" and "read" are anagrams, but one can't be an anagram without the other. A palindrone is the same thing spelled forward or backwards, like "racecar"

are these seriously the questions that determine if you'll get a job or not?

These questions determine if you'll get an interview

you're already at the interview if you're getting those questions though

No. These are the questions they'll ask on the online programming test site like Hackerrank. If you don't get filtered they'll call you in for a whiteboard interview

because brainlet

wch2huwdufq

for gods sake use the correct pen.

dont do fizzbuzz

it's too well known now, normies and brainlets just rote learn the algorithm and spew it out.

If you're gonna do fizzbuzz alter it slightly so you can trap the ones who rote learnt it

don't?

>Exercise 1 for example:
This is crap I'd reject in a real code review. The comments suffer from "// increments i by 1"itis, and you're allocating memory recklessly.

There lies the problem with these stupid quiz coding interviews. The interview is testing for something often orthogonal to the expected work. If I hired someone to work on my software and I found out they were writing their own sorting functions for essentially no reason, I'd have all their code re-reviewed.
A good coding interview is something close to trivial, but also something you'd encounter on the job. Give them a small project with a failing test and have them fix the bug, then commit their change. Then have them add a small feature to that same project, and write tests for it. You're looking for a solid engineering ethic. They should use a methodical evidence based approach to finding the bug. They should work within the existing framework and try to match style and testing thoroughness when adding the feature. They should write good commit messages, and ask questions about things they think are vague about the requirements. I don't give a fuck if you can reverse a binary tree. I care that you're capable of solving problems without inflicting collateral damage.

ha.
nobody would let you do that

references vs pointers
this kills the "i can program" / self teached casual shitter

>predefined function
>Bad practice
?

lmao it's easy as fuck

Tell them to write down the number of genders and ask if they drink onions.

*onions

lol newfag

>Have them write a function that reverses the string
3/5

>Have them write a function that determines if a string is a palindrome
2/5

>Have them write sorting algorithm
1/5 this is the worst sort I have ever seen. Running time is ALWAYS x^2.

>Have them write binary search
4/5

>Have them write fibonacci
If that 'out' in your function parameter in language acts like a reference then 5/5.

*soi
hmmm is this wordfilter new ? the only ones im familiar with is tb h sm h fa m

Attached: insecure_cute_cat.png (670x578, 345K)

It was here for like half a year now or maybe even more friend

im not here too often, fren
guess i missed that one so far

what do you think about

Attached: apu_lightyear.gif (871x665, 1.05M)

>splits string to chars
>not to glyphs with accents.
Enjoy fucked up Korean, hindi and few other fucked up languages.

Something completely irrelavant to the job

>thinking it's the same person
>people who are not here every day during summer are newfags
Enjoy your summer holidays.

I don't program I just lurk here so can't help you there desu.

>implying my point is invalid even if they're different people
>implying the soi filter has only been introduced this summer and hasnt been around for years

Attached: 1466971790805.png (300x300, 15K)

only ones I cant do are the binary search and the sorting algo because I'm a dumb brain who hasn't learned any of that stuff yet.

80% of applicants btfo

*wheels out whiteboard*
Allright user, please tell me. How would you approach creating a forum software, please tell me what systems, languages or other things you would use.

rate my trash Jow Forums
>Have them write a function that reverses a string.
void reverse(char input[]) {
int j = strlen(input) - 1;
for (int i = 0; i < (j + j % 2) / 2; i++) {
input[j - i] += input[i];
input[i] = input[j - i] - input[i];
input[j - i] -= input[i];
}
}

>Have them write a function that determines if a string is an anagram.
You mean palindrome? Else you just gotta sort 2 strings by character and compare them.
bool palindrome(char input[]) {
int j = strlen(input) - 1;
for (int i = 0; i < j; i++) {
if (input[i] != input[j - i]) return false;
}
return true;
}

>Have them write a function that implements a simple sorting algorithm e.g. selection/insertion sort.
meh, last one I did, got bored so half assed it.
void sort(int list[], int length) {
for (int i = 0; i < length - 1; i++) {
for (int j = 0; j < length - 1; j++) {
if (list[j] > list[j + 1]) {
int acc = list[j];
list[j] = list[j + 1];
list[j + 1] = acc;
}
}
}
}

>Have them write a function that implements binary search
Always learned this one with classes
class tree {
private:
int val;
tree* left;
tree* right;
public:
tree(int val) {
this->val = val;
}
~tree() {
if (left != nullptr) {
delete left;
}
if (right != nullptr) {
delete right;
}
}
void add(int num) {
if (val == num) return;
if (val > num) {
if (left != nullptr) left->add(num);
else left = new tree(num);
}
if (val < num) {
if (right != nullptr) left->add(num);
else right = new tree(num);
}
}
tree* search(int num) {
if (val == num) return this;
if (val > num && left != nullptr) return left->search(num);
if (val < num && right != nullptr) return right->search(num);
return nullptr;
}
};

>Have them write a recursive function e.g. fibonacci
void fibonacci(int n, int x = 1, int y = 0) {
if (n