[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]

>fizz buzz on the whiteboard >traverse a binary tree on

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: 285
Thread images: 28

File: Der_ewige_Weisswandtafel.png (406KB, 518x691px) Image search: [Google]
Der_ewige_Weisswandtafel.png
406KB, 518x691px
>fizz buzz on the whiteboard
>traverse a binary tree on the whiteboard
>sum all primes under 2 million on the whiteboard
>>
>memes on the whiteboard
>>
>>59762534
The only arguments against whiteboards are from people who think orgasming is about copying and remembering solutions.

A lot of them aren't even aware that some people actually invent solutions. They think everyone just copies someone else.
>>
>>59762578
>we'll let you know
>>
>>59762591
>orgasming
How Freudian
>>
>>59762591
no job that interviews with a whiteboard can afford someone who invents solutions
>>
>>59762596
I know that fapping while coding was gonna have consequences in the long term.
>>
>go into interview
>"alright so far everything looks pretty good, we just have one task before the interview is over"
>rolls out whiteboard
>40 different marker colors
>ohboy
>"please write an assembly program that will render out a photorealistic Pepe, and then compute the code yourself and render the Pepe to the whiteboard as though it was a screen and you are the CPU"
>give it my best shot
>tell them the Pepe isn't supposed to be like the original, it's a super rare one
>we'll let you know
>>
>>59763341
>assembly
>Compile
>>
int size = 2000000;
long sum = 0;

int[] primes = {2,3,5,7};

boolean[] isPrime = new boolean[size];
Arrays.fill(isPrime, true);

for(int i = 0; i < primes.length; i++){
for(int j = primes[i]*2; j < size; j+=primes[i]){
isPrime[j] = false;
}
}

for(int k = 2; k < size; k++){
if(isPrime[k] == true){
sum += k;
}
}

my code finds all the primes but for some reason the sum is 457143142877. Anyone know why?
>>
>>59762591
Nah...code on a whiteboard sucks. Give me a computer and an IDE. It's fine if you watch to make sure I don't open a browser and copy anything. But fucking give me an IDE.
>>
Not sure if you guys are serious but if you're ever in one of these types of interviews for a software position you can just use pseudocode and talk through the problem as opposed to being 100% syntactically correct
>>
>>59762534
>whiteboard
>not a SMART board
red flag
>>
why is this shitty meme taking off
reee
>>
>You can't just give me a laptop with a terminal open? Seriously now.
>>
>>59763885
For one, your i-loop stops at 7...
You need to keep adding primes, or just use isPrime

isPrime[0] = false;
isPrime[1] = false;
for (int i = 2; i < size/2; i++) {
if (!isPrime[i]) continue;
for(int j = i*2; j < size; j+=i){
isPrime[j] = false;
}
}
>>
>>59764308
Weird. Didn't think I needed any more multiples other than core 2,3,5,7.
>>
>>59764009

No you're a retard. Whiteboard interviews verify that you're experienced enough to master the syntax and also that you are capable of reasoning and figuring out things. For example, you don't know the code for a bubble sort, but you understand how a bubble sort works, therefore you can write some code based on your understanding of the method.

On the other hand an IDE will correct your syntax and it will allow you to use trial and error; of course you could say that it doesn't matter because that's a tool available for daily work, but if I compare one who figured the solution on a whiteboard with one who used trial and error and syntax handholding, it's obvious who's a superior programmer.

>wahhh I'm entitled to a job. employers should favor me over the more capable candidates because I can't into whiteboard. whaaaaah

Just kill yourselves already.
>>
>>59765108
t. ableist
>>
>>59762534
step aside peasant
use strict;
use warnings;
use v5.10;
use List::Util qw(sum);

my $n = 2_000_000;
my @arr = (0, 0, map { 1 } 2..$n);
my $factor = 2;
my $cursor = 2;

while ($factor <= sqrt($n)) {
while ($cursor <= $n-$factor) {
$cursor += $factor;
$arr[$cursor] = 0;
}
$factor++;
while ($arr[$factor]==0) {$factor++}
$cursor = $factor;
}

my @primes;
for my $i (0 .. $#arr) { push@primes, $i if $arr[$i]; }

say sum(@primes);
>>
>>59765108
>write document.getElementByID instead of document.getElementById
>this proves you are incompetent
>>
>>59762591
>orgasming
>>
>>59763885

1) You're trying to sum all primes below 2 million.

2) You're using data type "long" which can hold about 4 billion.

3)
>>
>>59765294
>types it into a comment and submits it to a /g/ thread

You don't understand the purpose of a whiteboard question in an interview. Everyone/anyone can write a solution to this trivial problem, that's not the point.
>>
>>59762534
OP, 'Weißwandtafel' is feminine and therefor takes 'die' instead of 'der'.
>>
>>59765108
>No you're a retard. Whiteboard interviews verify that you're experienced enough to master the syntax

Opinion discarded
>>
>>59762534

print (142913828922);
>>
>>59764092
this
>>
>>59763341
Next time make sure they sign an NDA for your rare peps dude, that shit is your intellectual property and such a pepe could be priceless
>>
>>59765108
this isn't 80s anymore grandpa
>>
>>59764497
169 is not a prime
>>
>>59765782
The point is this is how googled did it and everyone now copies it.
>>
>>59762591
> there are people on this board RIGHT NOW who cum while programming
>>
>>59766641
This.

>back in my day all we used to program were whiteboards, handheld calculators, and text editors that amounted to nothing more than a glorified notepad!
>>
>>59762534
Have Fizzbuzz and primes on my Github already. Just gotta do the second. Should be easy using array list.
>>
>>59762534
int main()
{
unsigned int limit = 2000000;
unsigned long long sum = 0;
unsigned int i, j, bytes = (limit >> 3) + (limit % 8 ? 1 : 0);
unsigned char primes[bytes];
memset(primes, 255, bytes);
for(i = 2; i < limit; i++){
if((*(primes + (i >> 3)) & (1 << i % 8 )) > 0){
sum += i;
for (j = i << 1; j < limit; j += i){
*(primes + (j >> 3)) = (*(primes + (j >> 3)) & ~(1 << j % 8 ));
}
}
}
printf("Sum is %lu\n", sum);
return 0;
}


D-did I get the job?
>>
>>59768767
>we'll let you know
>>
>>59768565
>using arraylist
How about using the tree?
>>
>>59768767
>1 is not a prime number
don't call us, we'll call you
>>
>>59762534
>traverse a binary tree

What does this mean? Take user input and find something in a tree?
>>
>>59769591
not sure probably just print elements in order
It wouldn't surprise me if it was that simple since there are a lot of people who can't even comprehend recursion
>>
>>59762534
 
int size = 2000000;

long sum = 0;



boolean[] isPrime = new boolean[size];

Arrays.fill(isPrime, true);



isPrime[0] = false;

isPrime[1] = false;



for(int i = 2; i <= size/2; i++){

if(isPrime[i]){

for(int j = i*2; j < size; j+=i){

isPrime[j] = false;

}

}

}



for(int k = 2; k < size; k++){

if(isPrime[k] == true){

sum += k;

}

}

32ms
Can we stop posting this thread every day now
>>
>>59765377
that's not how whiteboard interviews work

they don't care about minor syntax errors if your logic is sound
>>
>tfw never had to do a whiteboard interview
>tfw when hardest technical question was about the 4 pillars of OOP

Work for a non-tech company if you don't want the whiteboard meme, they literally don't give a shit.
>>
>>59762534
>rollable white board

lmao you're kidding right? you need to have whiteboard paint on your walls. at the VERY least put an actual fucking whiteboard on the wall. this is unacceptable and i will not waste any more of your time.
>>
>>59765108
>No you're a retard.
Says the retard.

>Whiteboard interviews verify that you're experienced enough to master the syntax and also that you are capable of reasoning and figuring out things.
But writing code in an IDE doesn't??? God you are fucking stupid.

>On the other hand an IDE will correct your syntax and it will allow you to use trial and error;
"Trial and error" would be obvious to any interviewer who wasn't himself an idiot. As for syntax correction: I have never seen a whiteboard session where anybody caught minor syntax errors, or where they counted against a candidate. It's all pseudo code bullshit. Fairly incompetent people can talk their way through a whiteboard session, but an interview with an IDE means you are going to compile that shit and make it run fucker.

>but if I compare one who figured the solution on a whiteboard with one who used trial and error and syntax handholding, it's obvious who's a superior programmer.
The one who wrote something that compiled and solved the problem. The IDE would be MORE pressure in that respect, not less. I want someone who can write working code, not someone who can talk good shit in a meeting while scribbling bullshit on a whiteboard. I hate meetings.

Let's take it a step further: put candidates in a room with an hour, a couple algorithm problems, computers, and no Internet access. The one who writes the fastest solutions wins.
>>
>>59769455
>he included 1 in the sum
We'll get back to you.
>>
>>59766011
>>59764092
So, what you are saying is, this actually a test to make sure you aren't an autist who can't explain himself to others?! Preposterous.
>>
>>59762534
For all my C# fags out there

            int size = 2000000;
long sum = 0;
var isPrime = Enumerable.Repeat(true, size).ToList();

for (int i = 2; i < size; i++)
for (int j = 2; j <= Math.Floor(Math.Sqrt(i)); j++)
{
if (i % j == 0)
{
isPrime[i] = false;
}
}

for (int i = 2; i < size; i++)
{
if (isPrime[i] == true)
sum += i;
}

Console.WriteLine("{0:0,0}", sum);


>142,913,828,922
>>
Pajeet coming through
<?php
header("content-type: text/plain");
define("MAX_PRIME", 2000000);
$iSum = 0;
for ($i = 0; $i < MAX_PRIME; $i++) {
$iCheck = intval($i * 0.5);
for ($j = 2; $j < $iCheck; $j++)
if ($i % $j == 0)
continue 2;

$iSum += $i;
}
print("The Sum of all Primes below ".MAX_PRIME." is: ".$iSum);
?>

Result: Fatal error: Maximum execution time of 30 seconds exceeded
>>
>>59771280
>$iCheck = intval($i * 0.5);

for why?
>>
File: efficiency.png (7KB, 208x109px) Image search: [Google]
efficiency.png
7KB, 208x109px
This REALLY activates my almonds. Any one know of a better way? I can't find a correct way of using ||. I want to combine the else with the if else-to be more clear.

pls no bully syntax
>>
File: 1484983107648.png (540KB, 618x822px) Image search: [Google]
1484983107648.png
540KB, 618x822px
>mfw my friend just got recruited through hacker rank
>mfw I solved all the interview problems
>mfw he paid me $500
>>
>>59771352
yeah, could've left out the intval. haven't written php or any other language without strict typing in ages.
>>
>>59765108
>trial and error
>bad

Get fucked you cuck.
>>
>>59771165
>not using a sieve
>taking 22.7275 seconds on a Core i7
>pic related: it's a C sieve algorithm running on the same CPU
We'll get back to you.
>>
>>59771462

When you're solving problems on the company's dime it sort of is. An analytica; approach costs fewer man hours than brute force.
>>
>>59771165
>using trial division
We'll get back to you
>>
>>59771683
Trial and error is a legitimate problem solving method you non-engineer

Programmers do it all the time and many actual algorithms are trial and error
>>
ITT: Retards who don't know their algorithms and blame it one MMMUH WHITEBOARD
>>
>>59771683
Trial and error on small shit in an interview would be a negative.

In real life analysis of complicated problems is no guarantee of coming to the best solution, and I've seen people analyze their way to a slow or incorrect solution on a number of occasions. Hell, there's a Google video about interviewing at Google where the two Google employees acting out the scene analyze their way to a solution that would be slower in most real world use cases.

Use careful analysis to weed out paths which will obviously lead to an incorrect or slow solution. Then test, test, and test. Trial and error.

This is ESPECIALLY true with modern computers. Guys analyzing their way to an algorithm in a high level language are often clueless about instruction timings, branch prediction, cache behavior, predictive cache loading, memory access patterns, etc, etc.
>>
>>59771680
I can write you a code that utilizes openCL and will do it in 0.00000072 seconds
>>
>>59771924
I think your claimed time is bullshit because I doubt you've done it and have a proven time. HOWEVER...it should be possible to parallelize a sieve thereby reducing the time.
>>
>write a program that sums all numbers under 2 million
>subtract the values of all the non-primes

This is the most efficient way of doing it. Prove me wrong.
>>
>>59762534
sieves are for faggots
import math

def main():
sum_of_primes = 2
# range (start, end, increase by 2)
for i in range(3, 2000000, 2):
if is_prime(i):
sum_of_primes += i
print(sum_of_primes)

def is_prime(number):
if number == 2:
return True
elif number == 1 or (number != 2 and number % 2 == 0):
return False

for i in range(3, int(math.sqrt(number)) + 2, 2):
if number % i == 0:
return False
return True


if __name__ == '__main__':
main()
>>
>>59772061
I've worked with software that cracks hashes at something like 94billion per second on just one gpu.
It will literally take longer to put the job on the gpu then to calculate it.
>>
>>59772092
Addition and subtracting are just as expensive, and there are more non-primes than primes under 2 million, so you are proven wrong.
>>
File: 1491188514748.gif (897KB, 800x430px) Image search: [Google]
1491188514748.gif
897KB, 800x430px
>download a data table of all prime numbers under 2,000,000
>dump them right into my code
>use the precompiler to sum them

MAXIMUM PERFORMANCE
>>
File: face.gif (2KB, 250x230px) Image search: [Google]
face.gif
2KB, 250x230px
>>59772157
>download the answer
>printf("%d", answer);
WHERE IS YOUR GOD NOW?
>>
>>59772108
>slllooowww
>>
>>59772290
Name a single real life application in which you would need to rapidly sum all prime numbers under 2000000
>>
>>59771680
cute story, code or get the fuck out
>>
>first job interview
>really fucking nervous
>please explain a sorting algorithm on the whiteboard
>black out, fail utterly
>second job interview
>guy just let's me talk about project
>hired as a senior engineer
Fuck whiteboard
>>
>>59764092
Not for top tech companies though. Companies like Google and FB expect real syntax.
>>
>>59772505
>top tech companies like google
Kek
>and fb
FB is written in PHP, they don't really have any authority on anything
>>
>>59772460
I even commented it for you faggot. XCode, all compiler optimizations, core i7...you're looking at low 0.007s to high 0.006s.

Note: this isn't the fastest possible. After writing this for a challenge I Googled and there are a couple more optimizations which could be made. Not to mention parallelizing it across multiple cores or a GPU.

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>

#define max 2000000

int main()
{
// Start the clock.
static double time_consumed = 0;
clock_t start, end;
start = clock();

// Initialize array.
char a[max];
memset(a, 1, max*sizeof(char));

// Sieve array.
unsigned long long psum = 0;
unsigned int sieveMax = floor(sqrt(max));
for (unsigned int i = 2; i <= sieveMax; i++){
if (a[i] == 1){
psum += i;
for (int j = i+i; j < max; j += i){
a[j] = 0;
}
}
}

// Finish the sum.
for (unsigned int i = sieveMax+1; i < max; i++){
if (a[i] == 1){
psum += i;
}
}

// How long did it take?
end = clock();
time_consumed += (double)(end - start);
printf("%f\n", time_consumed / CLOCKS_PER_SEC);

// Answer
printf("%llu\n", psum);

return 0;
}
>>
>>59772464
yep, only neckbeard autists like the white board because they can just go full aspie mode and recall random ass algos from 5 years ago
>>
>>59772505
Not according to Google's own "interviewing for Google" videos.
>>
How come nobody mentions design patterns in these kinds of threads? I get asked these all the time.

https://en.wikipedia.org/wiki/Design_Patterns#Patterns_by_Type
>>
>>59772633
If you get asked to recite fucking design patterns I'd avoid that workplace if I were you
>>
>>59772559
Nice, same algorithm with Pajeet# takes ~0.0552618
>>
File: ultimate badass.jpg (60KB, 496x505px) Image search: [Google]
ultimate badass.jpg
60KB, 496x505px
I've been working for one of the big tech giants now for about 2 years and in the process of becoming a technical leader to my pears I've become addicted to whiteboards.

Whenever I'm explaining something I don't waste time doing it only with words, because people are visual creatures, and just grab the nearest whiteboard to draw diagrams/pseudo code/whatever.

I find it absolutely essential to explaining things.

Where I work we don't require people to use the whiteboard during a job interview but when I do them I give extra points to people who instinctively make use of it when trying to explain something. To me it's a mark of someone that already has a good picture of what they want to say in their mind, and they know that language is bad at explaining complex structures.
>>
>>59772646
Why? For a lot of code proper design patterns and OOP is more important than algorithm implementation.

Not that the latter is unimportant, it's just that so much code in the world is CRUD that most functions are trivial. But proper overall architecture is critical for performance, testing, and future changes.
>>
File: 1491389171187.jpg (76KB, 568x700px) Image search: [Google]
1491389171187.jpg
76KB, 568x700px
>>
>>59772794
kys my man
>>
>>59772782
Pajeet# ???
>>
>>59772794
you sound like an insufferable faggot
>>
File: 1299255323302.jpg (86KB, 703x648px) Image search: [Google]
1299255323302.jpg
86KB, 703x648px
>>59772960

Fuck you too buddy. Thanks for contributing to the discussion.
>>
>>59772960
Nah...the average IQ of his team just isn't that high so he has to draw everything for them using crayon colors.

High IQ types generally hate fucking meetings. They prefer to write, prefer to read, and prefer to get shit done, not endlessly discuss it on a white board. UNLESS of course the white board is covered in math and not useless kiddie diagrams.
>>
>>59772559
Just one thing.
memset(a, 1, sizeof(a)


You COULD parallelize it using the prime number theorem too.
>>
File: 1295121143419.jpg (167KB, 850x1220px) Image search: [Google]
1295121143419.jpg
167KB, 850x1220px
>>59773058

I'd agree, I do hate meetings, but explaining things to people doesn't have to be a meeting. It can be just me having a quick chat with someone explaining something I'm working on or helping them out.

And yes, my team is not that amazing, but that's good, because it helps me learn how to teach. And really, the best way to learn something is to teach it.

In my office pretty much every room and most walls are covered either in whiteboards or glass that can be written on, so i'm always few steps away from a writing surface. It's a great aid.
>>
File: mrw.webm (92KB, 500x280px) Image search: [Google]
mrw.webm
92KB, 500x280px
>>59762534
no problem
>>
how do you sum all prime numbers when atheists can't even define what a prime number actually is
>>
>>59773118
What kinds of problems do you have to solve daily that require you to use a whiteboard?
>>
File: g.jpg (29KB, 722x384px) Image search: [Google]
g.jpg
29KB, 722x384px
done
give me another 8 hours to solve the other 2
>>
File: 1447665367916.jpg (43KB, 535x765px) Image search: [Google]
1447665367916.jpg
43KB, 535x765px
>>59773189

Well, I could argue that pretty much any problem in computing can be made easier to explain by a whiteboard, but in my case it's especially useful because I do a lot of operations/architecture work, especially in scaling.

It's very useful to draw out all the load balancers, caches, frontend/backend fleets, various proxies, whatever authentication gateways we have and so on.

I don't touch networking that much but whenever I go through the netops guys part of the office all of their whiteboards are 100% covered in diagrams.
>>
>>59762534
ok, no problem
fizz buzz:
void main(){
int i=0;
while(1){
i++;
if(i == 'fuzz') prrintf("fuzz\n");
else if(i == 'buzz') printf("buzz\n");
else printf("fuzzbuzz");
}
}

>there you go sir
>smiles

traverse binary tree:
void main(){
int i = 0;
while(++i){
printf("i is: %d\n", &i);
if(i == 'next')
printf("you are on child branch\n");
else printf("you are on parent branch\n");
}
}

>reads code out loud
>maybe I got something wrong but you get the point

sum all primes under 2 million:
void main(){
int i=0, sum=0;

while(i < 2 000 001){
sum += i;
}
printf("sum: %u\n", sum);
}


>there you go sir
>great job anon, you are HIRED
>shake hands
>>
>>59773261
I see, makes a lot of sense to use a whiteboard then.
>>
>>59773090
This is why I forced myself into the habit of always using count * sizeof(type).

#include <stdio.h>
#include <stdlib.h>
int main()
{
char a[256];
char* b = (char*)malloc(256);
printf("%lu %lu\n", sizeof(a), sizeof(b));
return 0;
}


You'll get 256 and 8.

If you initially declare an array in the function, but later change it to a memory pointer, it's easy to forget that you have to look for and change any calls to sizeof.

Example: you want the sum of all primes below 1 billion so you change max in the algorithm. Now it fails due to EXC_BAD_ACCESS. You can't allocate a 1 billion char array on the stack. But you can malloc/calloc a 1 billion char array in the heap. Using sizeof the way I did you only have to change one line.

It seems trivial but I ran into it one time too many and now religiously count * sizeof(type).
>>
>>59773261
only autists like white boards
>>
>>59773276
So you don't know what a prime number is?
>>
>>59771862
this so much
>>
>>59773276
YOU'RE FIRED
>>
>>59762591
Nah, it's about writing speed. I write at ~2% of the speed that I type at.
Test my programming ability on the spot, but don't give me a marker to determine it.
>>
File: Misato.Katsuragi.258673.jpg (79KB, 488x640px) Image search: [Google]
Misato.Katsuragi.258673.jpg
79KB, 488x640px
>>59773298

Then I guess I'm a proud autist.

Whiteboards are great. The moar colorrs the better.

This is especially useful when talking to management because they fucking LOVE colourful graphs and diagrams.

I always say that management has a colourful graph fetish.
>>
>>59771008

>But writing code in an IDE doesn't???

It doesn't. All you have to do is look through the existing classes for the sorting methods and then write something like that from scratch. Also it fixes syntax errors if you double click on them. IDEs are for idiots.

>I have never seen a whiteboard session where anybody caught minor syntax errors, or where they counted against a candidate.

And you have never seen them in IDEs either because the software fixes them for you.

>Fairly incompetent people can talk their way through a whiteboard session

Wrong. It is important to show that you have a level of understanding high enough to communicate your ideas. Social intelligence is a very important skill and it's valued more than the technical skills of a code monkey.

>an interview with an IDE means you are going to compile that shit and make it run fucker

A thing that any Pajeet can do. Are you somehow proud of this? The other guy can write code that compiles on a whiteboard without needing any handholding and then he could explain how it works in a way that common people can understand, while you on the other hand had to use trial and error to figure out how petty stuff works. I don't see how that makes you a better candidate, it just makes you unemployable to be honest.

>I hate meetings.

Precisely proving your poor interpersonal skills. Again, the other dude can also do it on an IDE (as anyone else in the Earth), but he has the advantage of not being a muh-social-skills snowflake believing himself a tortured genius of sorts. You're butthurt because you fail whiteboard interviews, and from what you wrote I definitely can see why.

Either man up or look for another line of work.

>>59771462
>>59771844

Trial and error is a legitimate thing, but there are superior ways. Why should I hire a candidate that can only do it with trial and error over a candidate who can nail a more efficient solution (and even using less advanced tools and facing more difficulties)?
>>
>>59773276

Thanks, we'll be in touch

>notes: incapable of following basic instructions. May be mentally retarded? Consider as an outreach diversity hire.
>>
>>59773276
i wonder if some pajeet actually managed to get hired by using this technique
>>
>>59773362
sure if the guy interviewing him didn't know what he was doing either
>>
>>59773346
please stop posting you're making me ill
>>
>>59773362
pajeet here
I got a job like that
the technique is confirmed
>I don't poo in the loo either
jk
but I don't flush my shit in the company toilet (old habbits never die)
>>
File: IMG_0010.png (6KB, 390x470px) Image search: [Google]
IMG_0010.png
6KB, 390x470px
>>59773276
This is hilarious.
>>
>>59773385

You say that as if I give a fuck what you feel like.

>>59773276

This is great. I'm not sure how I would respond if any of those ended up on a whiteboard during an interview.

I guess I would just let them move on to less complex questions or scale the current task down to match their skill level. If that didn't do I could always cut the interview short.

People like that are a great waste of time. I've interviewed too many people who list multiple languages on their CV and then refuse to do a coding challenge during a phone screen. Sad.
>>
>>59773354
t. autist who can only communicate by sperging out reguritating random algos he's memorized just for this occasion and will never use again because he's a good goy and loves that corporate cock.
>>
>>59773296
If.

Your point is rather valid, but consider the following: How often do you make a change this radical?
>>
>>59772092

Gay. What >>59772156 said. Also you first would have to sum all numbers up to 2 million to get the value from which you will perform the subtraction:

>sum 1 + 2 + 3 + 4 + ... + 2000000 (a)
>subtract the non-primes (b)

Compared to:

>sum prime1 + prime2 + prime3 + ... + primeN as long as the value of the prime isn't over that of the last prime before 2000000 (c)

There are more operations in (a) alone than in (c). Your method was already more inefficient than (c) before you even started doing the actual work.

>inb4 I know the value of 1 + 2 + 3 + 4 + ... + 2000000 by memory and I can store it in a variable from the beginning

Well then you're a fucking idiot because if you knew the value of the sum of all primes under 2 million by memory, you could just store than instead and show it with a printf and it would still be more efficient.
>>
>>59773437
nice LARPing mate. made me reply
>>
File: 1486957759781.png (291KB, 600x512px) Image search: [Google]
1486957759781.png
291KB, 600x512px
>write #BlackLivesMatter on the whiteboard 100 times
>get hired
>>
Damn, all these buttmad autists ITT who are scared of whiteboards lmao. You're no better than Pajeets.
>>
>>59773490
I don't have any black privilege so I'm not allowed to do that
>>
>>59773437

Do you actually ask for a specific language on their resume or let them pick?
>>
>>59773473
>>>sum 1 + 2 + 3 + 4 + ... + 2000000 (a)
Found the Pajeet.

>>59773492
You should match the difficulty of the question to the tools at hand. You wouldn't ask a Pajeet to write a two-way merge-sort in MMIX assembly on a whiteboard and you wouldn't ask to read two numbers from the standard input and print their sum using an IDE either.
>>
>>59773504
the kid was arab or something. he just did it because he had been doing activist shit for a while. if you did activist shit you could write whatever the fuck you wanted.
>>
>>59773492

They are the Pajeets. Only people from shit universities where the programming exams aren't done on paper complain about this stuff. These fuckers went to a 2 week codecamp with Karly and they think they're hot shit that should be working for Google.
>>
>>59773526
I bet he couldn't if he wanted a software engineer job

unless the company just wanted to pay him for existing
>>
>>59773534
Everything Google does is programmed by 2 middle aged white men. All other employees are hired merely to fill diversity quotas.
>>
>>59773553
lol
>>
>>59773524

>not knowing how processors break down the instructions into aritmetical operations
>calling other people Pajeets
>complaining about whiteboard question difficulties and trying to rationalize a middle ground, but conveniently ignoring that THERE ARE PEOPLE WHO INDEED ARE ACTUALLY GOOD ENOUGH SOLVE THOSE QUESTIONS without the crappy affirmative action he's trying to push

Your post sums up what's wrong with your kind and with this thread. Whitheboards filter the trash programmers just like math filters the dumb people out of getting certain college degrees. I'm thankful for whiteboards.
>>
>>59773492
good goy, keep trying for those big 4 jobs by practicing on Mr. Schlomo's white board. meanwhile after you getting denied 6 times the rest of us get jobs after answering a few behavioral and technical questions.
>>
>>59773593
Nice projection, Pajeet.
>>
>>59773593
Found the Pajeet. Can't communicate through words so he has to scribble his pooinloo arms on a white board to get hired lmfao.
>>
>>59773517

We say they can write the solution in any language they feel most comfortable with, or even use pseudo-code if that's what they want. As long as I can see them think, and the solution makes mathematical/logical sense I don't care about language semantics that much.

We also don't care about looking stuff up online, if they want we have a laptop they can use to research while coding.

Whether you get hired or not depends on how I and other interviewers perceive the candidates competence, not on whether whatever they wrote on the whiteboard/laptop compiles.

Nitpicking syntax errors is retarded. I want to see the candidate think.
>>
>>59773623
actually whiteboard interviews go 100000x better if you explain what you're doing while you write
>>
>>59773602
>>59773623

You guys sure are buttmad as fuck. I am Chinese and I am in charge of whiteboard interviews. Neither of those things will change, and the fact that programmers who can pass whiteboard interviews are superior isn't changing either. Just give me one sound reason why I should hire the code monkey instead of the whiteboard guy.

>>59773596

>keep trying for those big 4 jobs by practicing on Mr. Schlomo's white board

There's always a candidate who makes it; the best one. If your advice is to aim lower, that might be a realistic thing to do depending on your skill level, but a winner is one who aims high and has the skill to earn his place. You're mad that you've got none.
>>
>>59773693
Do you have a single fact to back that statement up?
>>
>>59773693
rekt
>>
>>59773693
Wew, I can smell the curry from here
>>
>be left handed
>scared as fuck of writing in a whiteboard
I'd just get the hell out of there desu
>>
>>59773708
Logic.
You just look worse if you deny or fail at doing something on a whiteboard when asked. You might still get the job if you're the best otherwise. But if there is someone just as good (or slightly worse) than you, who masters the whiteboard challenge, they'll be the one getting picked.
>>
>>59773749
why
>>
File: Efficiency.jpg (61KB, 667x562px) Image search: [Google]
Efficiency.jpg
61KB, 667x562px
>>
>>59773749
switch to arabic. they write from right to left.
>>
>>59764009
If you need an ide to solve small interview puzzle, you shouldn't get the job. Now a text editor, I can understand, because it can be hard to get your mind in the right place for programming when you're not using a keyboard, like you're used to using.
>>
>>59773785
>But if there is someone just as good (or slightly worse) than you, who masters the whiteboard challenge, they'll be the one getting picked.
That's the part where whiteboards are fucking bullshit.
>>
>>59773354
>lol the other guy regurgitated a syntactically correct implementatiom of a common problem on a whiteboard
>he must be superior

Stop posting any time you pajeet.
>>
>>59773785
Not an argument.
>>
>>59773811
>>59773834
But it's true. If you're not good at one part of the interview, you're not good at it. No matter how you spin it. And someone who is good at it will get free bonus points here.
>>
>>59773858
It's not delimited by ANDs you retarded slanteye.
>>
>>59773823

Allow me to interject. I'm not a coder and I don't really get this whole thread, but if the white board thing is easier than the other thing, why aren't you going with the white board instead? I mean, the superior candidate should be able to outmatch the inferior one in either the easy thing or the hard thing, then why don't you just meet him in the withe board and defeat him there? Also the posters talking about the white board have explained their reasons and stuff, but the other ones have only called names... from here it looks like you guys are on the wrong side and posting out of rage.
>>
>>59773593
>interview for a carpentry job
>this cuck wants to see my hammer technique
>but get this: he doesn't want to let me use an actual hammer on an actual nail
>he hands me a stone instead and tells me to hit the table with it
>that's gonna break things... "if you're good enough you won't break anything"
>question the validity and need for this bullshit
>LOL ANON LOOK AT ALL THOSE PEOPLE OVER THERE
>THEY WERE ALL SUCCESSFUL AT STONING THE TABLE WITHOUT BREAKING IT
>YOU SAYING YOU CAN'T DO IT PAJEET
>YOU'RE FIRED EVEN THOUGH WE HAVEN'T HIRED YOU
>>
>>59773693
>chinese
>calling others code monkey
>>
>>59773933
the only people who use white boards are the major tech companies who are trying to find that special autistic savant programmer.
>>
>>59773823
nobody cares if your code works 1:1 error-free
what matters is the thought process and you writing down your solution while explaining why you've chosen to do it this way.
>>
>>59773960

Wrong equivalence and strawman. A more precise thing would go like this:

>interview for a carpentry job
>I can hammer stuff like any other carpenter can
>they want to see my skill at technical drawing and furniture design
>they ask me to draw a plan for a chair
>I can't really do that because my understanding only goes as far as hammering wood together
>other guys do the stupid drawing and they get better jobs
>some of them even end up not doing carpentry themselves, but doing higher tasks like telling the carpenters how to do their jobs
>fuck the carpentry industry for valuing the people who have 2 skills more than the ones who can only hammer wood
>give me the job I'm entitled to or I will call you Pajeet anonymously (but act meek IRL when you tell me that I didn't get the job, lol)

You fucking cucks are so deluded it's sad.

>>59773981

I'm still the boss of half the people ITT. The other half don't have jobs because they can't pass whiteboard interviews.
>>
>>59774042
This would never happen in carpentry though and is a perfect example of how broken industry jobs are.
>>
>>59774042
>interviewer monkey
>boss to anyone
KEK
E
K
>>
>>59774042
keep on LARPing chink. maybe Mr. Schlomo will give you a job some day.
>>
>>59774042

SAVAGE
A
V
A
G
E
>>
>>59773933
I don't even have to interview in order to get a job. I just give the right people a call and I'm in.

The fact is none of these "challenges" prove anything but people's capacity to pass the challenge. There is no guarantee any of those candidates will turn out to be great programmers.

This isn't really something you can just measure in a couple interviews. People will figure out what you're up to, and they will whisper the exact sequence of sweet nothingd that you want to hear.

>>59774017
And yet there are cucks in this very thread arguing that passing that challenge makes you a better candidate. It doesn't, really.

I'd rather you prospectively hired someone and let me spend time working with them.
>>
>>59774072
Naw, I need people with emotions.
>>
Guys this is really important do I need to remember quicksort or mergesort??
>>
>>59774114
Yes, in MMIX assembly. All of them. If you make one unnecessary instruction you're off to swipe the poo off the designated shitting streets.
>>
>>59774114
neither. If they ask you to write on a white board just walk out.
>>
>>59774102
You have to narrow down all the applicants somehow. Can't just let hundreds of people work with you and see how is worth something and who isn't.

>I just give the right people a call and I'm in.
That's another issue. Getting a job isn't only about skill. It is often also about who you know. But if you have no connections, you'd better do well in a job interview.
>>
>>59772108
This is literal shit. You could have just done:
sum_of_primes = 2
for i in range(3, 2000000, 2):
if not any(i % ii ==0 for ii in range(3, int(i**0.5) + 1, 2)):
sum_of_primes += i
print(sum_of_primes)

The point of trial division is to use any and all trivial optimizations you can. But you fail at that. Your code is more bloated, complex, and slower than a sieve.
>>
>>59762534
I'm 92% certain that employers who REALLY need programmers will not know enough to test the l33t haxor skills of programmer applicants. Besides, fizzbuzz is an illogical means of filtering the qualified from the unqualified considering that everyone learns it.

Why even bother living if the only thing that keeps you going is the perpetuation of this /g/ tier meme?
>>
>>59771008
>>59773354
>Also it fixes syntax errors if you double click on them.
Most of the time the proposed corrections, if there are any, don't fix the problem. If you were missing a {, the compiler will very likely have no fucking idea of what to suggest.

To avoid using IDEs because other people who are perceived as less capable is like avoiding the usage of screw-drivers as a construction worker because some people aren't good at building. The fact is, IDEs are tools and are only as good as the person who uses them.

Fizzbuzz is not an accurate means of determining whether an applicant is qualified to be a company programmer. If you believe this, you need to step outside your room and make your own tendies because I am 99% certain there is poison, planted by mommy, in your tendies.
>>
>>59773490
>>59773504
Someone has clearly been reading too much /pol/.
>>
>>59774159
I don't really think having connections is an issue. Trust is way more valuable than some flimsy interview process. My company's interviews are just for show; we already know who's gonna get hired in advance. When I tell them a candidate looks good, they take it really seriously.

Truth be told, good programmers can weed out the shitty ones with a 15 minute conversation about technology. Their ability to learn new foreign topics and their enthusiasm in general detects wizards with high sensitivity and specificity. Those programmers have better things to do, though.
>>
>>59774331
>Fizzbuzz is not an accurate means of determining whether an applicant is qualified to be a company programmer
No shit. These tests are to weed out the really unqualified programmers. Nobody is going to be picked because he has provided the best FizzBuzz solution. But if you cannot actually do a FizzBuzz, you will definitely fail.
>>
>>59773998

If it's so very extremely rare, then why are so many people here mad?

>>59774102

>I don't even have to interview in order to get a job. I just give the right people a call and I'm in.

Then why are you all butthurt ITT posting against it? Something ain't adding up.
>>
>mfw I work security, dont have to do this whiteboard bullshit and just get to tell all your betters how you fucked up
but silicon valley is a cool show i guess.
>>
>>59775066
Because you interviewers are responsible for the shitty programmers I have to deal with.
>>
>>59774331
>Fizzbuzz is not an accurate means of determining whether an applicant is qualified to be a company programmer.
It's not meant to be. It's meant to be used as a quick way to filter out people who have no chance of passing the rest of the interview.
>>
Well, it makes fewer candidates cry than my previous approach.

>I see you have Haskell on your resume. Tell me what a monad is.
>>
>>59773354
Using IDE's is good for time efficiency, you're retarded
>>
>>59775400
>spend 20+ minutes downloading and setting up your IDE
>in the meantime another candidate has already solved 5 problems on the whiteboard
>>
>>59775367
A monad is a person who roams from place to place in search of farmland to sustain their cattle
>>
>>59775420
Thank you for your time, I'll show you the way out.
>>
>>59773461
That's just it. I don't consider changing an array declaration (stack) to a pointer (heap) that radical. It happens from time to time, and I don't see the advantage to typing sizeof(a) which can break.

Don't get me wrong, I don't flip out if someone else does it. Just explaining why I do count * sizeof(type).
>>
>>59765108
>No, you can't use a calculator, you won't always have one in life
>literally never without some sort of device that has a calculator

Your logic
>>
>>59769785
probably knock off 20ms without all that whitespace I mean DAYUM
>>
>>59775367
>asking a question that's impossible to answer
>>
>>59773693
>There's always a candidate who makes it; the best one.

LOL if you think your snowflake process finds the "best" candidate.

* Being good at your job != being able to design a process to find people who are good at a similar job.

* You simply lack the manpower to sufficiently review a large enough sample of candidates to say you have a candidate in the top 10%, much less the "best" one.

* Unless you are a gifted person (IQ >140), and odds are you are not, you would most likely reject a gifted candidate. The speed and manner in which they process information and form solutions is off putting to 'normies.'
>>
>>59775549

>a candidate can use a calculator
>another candidate can also use a calculator on top of being able to performing 9 digit operations in his mind fairly fast
>better hire the first one because he's so much better than the second one

Better kill yourself already.

>>59775604

So basically what you're saying is that:

"*Interviewers can't see how good I am at my job.

*My greatness is lost in a sea of other applicants.

*I am so gifted that they world doesn't understand how amazing I am; that's why I can't find a job."

?

Stop deluding yourself with your gay SJW narrative. The fact is that some people perform excellent at the whiteboard. If you're so great why can't you do it?

>inb4 tfw too smart to do simple things and talk with people

Unemployable then.
>>
>>59775604
Can confirm. The best programmers I've ever met look like lazy slobs at a first glance. They'd refuse to do stupid interview shit based on pride yet they're the ones who pulled through for us in the toughest of times. They were the ones who refused to go home until the shit was fixed because it was their code.

When I see someone that takes great pride in what they do, I stop and listen for the signs of greatness. I often find them.
>>
>>59775674
I have never had to perform 9 digit operations in my head in my work.
>>
>>59775684

>Can provide confirmation from anecdotal sources. The few programmers I've met in my shitty career are a representative sample of all the programmers in the universe. That's why when I meet a programmer that's somewhat like those, I start wanting to see certain attributes in them and I try hard until I see them, thus confirming the bias.

Solid research bro, Nobel prize when?
>>
Had a real whiteboard test today. Discussing what the signature for a sorting algorithm should look like. Can /g/ do it?

It doesn't need an IDE. It's harder than you think.
>>
>>59773354
>It doesn't. All you have to do is look through the existing classes for the sorting methods and then write something like that from scratch.
>implying they didn't do that at home already

>Also it fixes syntax errors if you double click on them.
And you ignore syntax errors on a white board. So what's your beef?

>>Fairly incompetent people can talk their way through a whiteboard session
>Wrong.
I've watched it happen. Guy got hired, over my objections, and it took management 8 fucking weeks to figure out he couldn't code and fire him.

>>an interview with an IDE means you are going to compile that shit and make it run fucker
>A thing that any Pajeet can do.
Now you just sound stupid trying to defend your position after you've lost. A whiteboard doesn't even involve the pressure of making sure it actually works. It involves "let's see how he thinks" magic feelings. Pajeets can talk their way through a whiteboard. Doesn't mean they can write code that even compiles, much less is readable or runs worth a damn.

>The other guy can write code that compiles on a whiteboard
You wouldn't know because you don't try and you've admitted that syntax doesn't matter on the WB.

>>I hate meetings.
>Precisely proving your poor interpersonal skills.
No. My problem with meetings is that other people operate at too slow of a pace. It's painful watching them go round and round simple shit.

>You're butthurt because you fail whiteboard interviews, and from what you wrote I definitely can see why.
I've never failed a whiteboard interview in my life. That's not why I despise them or meetings.

>Either man up or look for another line of work.
Fuck off. I could out code you while drunk.
>>
>>59775714
>talk about my personal experience
>LOL NICE SCIENCE ANON
>SHOW ME THE NATURE ARTICLE YOU PUBLISHED
>>
>>59775727
(Ord a) => [a] -> [a]
>>
>>59775751
No. How can you define what order to sort by?

Also, it was in C.
>>
>>59775727
Signature as in method signature? The API?

I could go on for hours talking about this subject.
>>
>>59775762
Method signature. For any form of sorting, there can be one answer.
>>
>>59775758
Which order to sort by is determined by the Ord instance, which is in turn determined by the type a.

You should have said that it had to be in C.
>>
I'm an undergrad who has grown through a couple whiteboard interviews for internships already for some top tech companies. I initially thought that whiteboards were outdated but never bothered me. After reading this thread and seeing people say things like "idk what traversing a binary tree is" and claiming that google and fb make you have exact syntax when using a whiteboard made me realize something.

I support whiteboarding 100% just so none of my coworkers / future coworkers hold this idiotic belief. Interviewing in Software engineering is not perfect. But its testing your ability to pass a test that requires preparation, critical thinking, and a well built study plan. So many of you are entitled so you believe it should be easier to get into the unicorns of our field.

People on /g/ complain about indian "code monkeys" stealing their jobs when it reality a bunch of people are fake good programmers. They hate this style of testing because it weeds out not only the code monkeys but also just the average crowd who can't believe for a second they're average because of their huge egos.

These top tech companies have so much talent and draw they would rather lose out on a good candidate then let in a piece of shit time waster. If you want a cushy six figure job out of college with insane benefits stop whining and start learning about how the interview process works. So many people in this thread were talking out of their ass.

None of the places I interviewed at cared about perfect syntax or what language was used and now I have a Facebook offer where I'll make 200k first year not factoring in stock. First offer out of a no name state school with a shitty gpa.
>>
>>59775774
>Which order to sort by is determined by the Ord instance, which is in turn determined by the type a.
What if it's something more abstract than eg. numerical? Some arbitrary way of describing some data. You can't have that described inside ord.

I should have, I apologise.
>>
>>59775787
excuse my shitty spelling. Mobile keyboards have a long way to go.
>>
>>59775793
>What if it's something more abstract than eg. numerical? Some arbitrary way of describing some data. You can't have that described inside ord.
Ord isn't limited to numeric types.
>>
File: 1422763898590.jpg (180KB, 534x627px) Image search: [Google]
1422763898590.jpg
180KB, 534x627px
>>59771844
>Trial and error is a legitimate problem solving method you non-engineer

CODEMONKEYS ACTUALLY BELIEVE THIS.

HAHAHAHAHHAHAHAHH
>>
>>59775826
That doesn't matter, I said abstract. This isn't a one-case method, it covers all bases for one form of sorting (eg. quicksort).

You need to be able to define what you're sorting by when you call it.
>>
>>59775674
>So basically what you're saying is that:
No, I'm saying exactly what I did say. If you can't grasp what I wrote and have to build strawmen or personal insults to "win" an Internet debate then you've got some major fucking issues.

>*My greatness is lost in a sea of other applicants.
Identifying truly gifted candidates is a problem across professions and industries. No, you are not finding the "best" candidate. Neither is Google. You don't have time / money / manpower to do that. Pure numbers mean you cannot do this. (If you understand statistics at all.)

On the flip side, most job positions only require a "good enough" candidate. But it's cringe worthy when a recruiter, interviewer, or company claims "we've got the best candidates!" No you don't, and claiming otherwise just revealed something about your quality to me.

Oh, and regarding my comment about gifted individuals:
http://polymatharchives.blogspot.com/2015/01/the-inappropriately-excluded.html

IQs above 133 are inversely correlated with successful entry into the intellectual professions. The Mensa garbage collector is a meme for a reason. I wasn't joking when I said you are likely to pass over a truly gifted and high IQ candidate. The math says you are.


>The fact is that some people perform excellent at the whiteboard. If you're so great why can't you do it?
I can. I just think it's a shitty waste of my time if I'm the candidate, or a poor filter if I'm on the team evaluating candidates. It's the meme right now because "hurr durr Google does it."
>>
>>59775770
Even something as simple as a sort() method on a collection can be bike shedded to death. How customizable must it be? There are many sorting algorithms, is there a need to select between them? If so, what is the best way to signal which algorithm is to be used? Depends on the features of the language... Sorting can also take parameters such as ascending or descending order, or even an extremely general custom comparison function. How much flexibility to allow? I know for certain that first class functions have saved my ass more than once.

That's just the start of the conversation
>>
>>59775839
Still not seeing anything you can't accomplish with the type I gave you.
>>
>>59775742

>[snip]

All wrong. In my whiteboard interviews I copy the code to my compuer ad litteram and compile it. If it doesn't compile I give them one chance to correct it (if they have the right attitude) without telling them what's wrong, and if it doesn't compile on the second chance I thank them for their time. I don't know why you assume that all whiteboard interviews are the way you claim they are; all of mine and my colleagues' require perfect syntax and functionality.

>No. My problem with meetings is that other people operate at too slow of a pace. It's painful watching them go round and round simple shit.

Yet, the company isn't about you. I'd rather hire a slightly less qualified applicant that isn't a special snowflake pretending to be hot shit. Not that I'd need to, because chances are that there will be an even more skilled applicant (top skill usually comes with emotional maturity) that will be also a people person.

>I've never failed a whiteboard interview in my life. That's not why I despise them or meetings.

Yet here you are, whining like a bitch about witheboard interviews. You have the wrong attitude and it makes you unemployable. Whiteboard interviews exist precisely to filter people like you, no wonder you're so assblasted.

>I-I c-can code while drunk! I'm better than the others, h-hire me.

I'd call security on you. You're fucking unhinged if you think this is good.
>>
File: 1477349339216.jpg (31KB, 638x540px) Image search: [Google]
1477349339216.jpg
31KB, 638x540px
>>59764497
>>
>>59775890
>I'd call security on you.
Pathetic.

>S-security! The interviewee said something that I found offensive!
>>
>>59775832
Top physics professors believe in it.
>>
File: FJ0Hfys.jpg (138KB, 838x638px) Image search: [Google]
FJ0Hfys.jpg
138KB, 838x638px
>>59767349
Are they c-cute boys?
>>
>>59775880
Ok, I'll define it as follows:

A C function for quicksort. It takes an array and returns an array sorted by some definition decided when it's called. This can be something like ascending/descending alphabetical, like you said, or something unusual (maybe the array is full of films and you're sorting by number of actors whose names begin with E).

If you already have the knowledge you need to answer this, you'll know what to do. If you don't, you'll still be thinking what you've already said.

>>59775882
For one thing I don't know what language it is. Is that passed by reference or value? What if you're sorting arrays of image data by descending luminosity? And luminosity isn't defined in Ord. What if you need to be able to adapt it to an unknown sorting order?
>>
>>59775876

>I just think it's a shitty waste of my time if I'm the candidate

I'm so sorry for wasting your time before approving you for the job you're entitled to, your majesty. God forbid you walk out and go to some of the other Fortune 500 that are literally begging you to work for them! Please don't shun my company and go to work as a Google advisor instead, since you clearly know how to do what they do better than them.
>>
>>59775787
>blah blah blah
Your reading comprehension sucks. I, for one, hate whiteboard "interviews" because there's no need to make something that works or prove it's a good solution. And I've watched people walk through them because they were good at talking.

Using a site like HackerRank would be MUCH better. Yeah even their web code editor will correct some shit for you (OMG!). But your code has to work. It has to past the test cases, and for harder questions, do so in the time allotted.

Real code. Solving actual problems. Not some fucking game with markers on a board. Might as well pull out the construction paper and the Crayola while you're at it.
>>
>>59775926

it's the millenials and the codecamps dude. even the pm of canada and his dog are coders now.
>>
>>59775925
>For one thing I don't know what language it is.
Haskell.

>Is that passed by reference or value?
Yes.

>What if you're sorting arrays of image data by descending luminosity?
Then you choose a type a that yields a suitable instance of Ord, for example ImageByLuminosity.

>And luminosity isn't defined in Ord.
It doesn't need to be.

>What if you need to be able to adapt it to an unknown sorting order?
I just did that.
>>
>>59775947
Then you're most of the way. Do it in C.
>>
>>59775930
If you can find someone that could cheat through a Google or Facebook whiteboard interview that would be amazing. Big companies can actually afford good interviewers but even then some of them are shitty. Like I said its not perfect but if idiots can "talk" their way through these then why can't everyone else figure out a way to do the same?

Some big companies already do this but then you move on to onsites because, shocker, its easier to cheat on HackerRank then it is for whiteboard testing. So just because people can cheat onsites do you really think less people can cheat using online tests?

Come on now. If I want to hire someone to solve actual problems then I expect them to figure out how to whiteboard.
>>
>>59775890
>>[snip]
>All wrong. In my whiteboard interviews I copy the code to my compuer ad litteram and compile it.
>compuer
>ad litteram
LOL you can't even write English and that's with a keyboard and a web browser that auto corrects. I'll give you one chance to correct your post, if you show the right attitude, and if you can't spell it right the second time then GTFO this board.

>If it doesn't compile I give them one chance to correct it (if they have the right attitude) without telling them what's wrong, and if it doesn't compile on the second chance I thank them for their time.
So you have a process that will weed out any programmer who is good but also nervous, or suffers from any kind of handwriting issue yet can type just fine. It will also weed out a good programmer who happens to make two minor mistakes yet only corrects the first one, even though that's human nature and even the very best engineers in the world have done that while writing functions.

Way to go, you are a BRILLIANT interviewer, the best in the world! Truly the top 1/10 of 1%!

>>No. My problem with meetings is that other people operate at too slow of a pace. It's painful watching them go round and round simple shit.
>Yet, the company isn't about you. I'd rather hire a slightly less qualified applicant that isn't a special snowflake pretending to be hot shit.
Then you're an idiot and your company should replace you at its earliest convenience.

>Yet here you are, whining like a bitch about witheboard interviews.
Telling you what's wrong with your process is not "whining like a bitch." And since you brought up the point about snowflakes: you are the most defensive, entitled little snowflake in this thread.

>Whiteboard interviews exist precisely to filter people like you, no wonder you're so assblasted.
Except I've never been "filtered" by one. Sorry to burst your little bubble there.

>>59775909
Kek
>>
>>59775956
GHC can output C. Done.

I think really you just need to pass a function from elements to {LT, EQ, GT} to the sort function along with the input collection. Something like this? I can barely remember C, I haven't used it in years.

void sort(void *input, size_t num_elems, size_t elem_size, int (*compare)(void *a, void *b))


The function you pass in determines the order used.

If you were using C++ you could use templates and avoid all the casting/pointer horribleness.
>>
>>59775983
>If you can find someone that could cheat through a Google or Facebook whiteboard interview that would be amazing.
How so? They are going to ask some simple, common shit and give fucking hints during the interview.

See: https://www.youtube.com/watch?v=XKu_SEDAykw

There are plenty of Pajeets who could have talked their way through that.

>Some big companies already do this but then you move on to onsites because, shocker, its easier to cheat on HackerRank then it is for whiteboard testing.
Not while the interviewer is watching.
>>
>>59775909
Get off your high horse man. Not sure what's up with your obsession about working code. It does not even matter in what programming language its written since only the syntax is different. Heck you could have a script which translates it for you.

People are not ment to be 100% correct. We try and struggle until it works. And there is nothing wrong with that. I don't see why it should be different when you are coding, of it works at the end of day who cares how fast you completed it?

But you don't seen like a reasonable gut it all. Even of given the chance to work for your company I would rather go to another place. Peace man
>>
>>59776056
Did you mean to reply to a different post?
>>
>>59776024

>LOL you can't even write English and that's with a keyboard and a web browser that auto corrects. I'll give you one chance to correct your post, if you show the right attitude, and if you can't spell it right the second time then GTFO this board.

You're clearly mad and clinging to petty shit to try to get back at my. I'm still you're boss and your still unemployable.

>So you have a process that will weed out any programmer who is good but also nervous

Wrong. The best candidates aren't nervous at all, there's no reason to be unless you think you can fail.

>any kind of handwriting issue

He wouldn't make it that far. I don't hire people with health issues because the insurance is more expensive.

>It will also weed out a good programmer who happens to make two minor mistakes yet only corrects the first one

And I will keep a good programmer who makes two minor mistakes and corrects them both, way superior to the first one.

>Then you're an idiot and your company should replace you at its earliest convenience.

Wrong. People skills and emotional intelligence are worth way more than technical skills and knowledge. I know it hurts you because you clearly lack in that department, but it's the truth. A person with the wrong attitude even hinders the productivity of others because it creates an environment where they're not conformable, you clearly don't know shit about managing personnel.

>Telling you what's wrong with your process is not "whining like a bitch."

There is nothing wrong with the process kid. You just don't like it because you suck, stop bitching and man up.
>>
>At a job interview
>Boss asks me to write something called "Fizz buzz" on the whiteboard
>Write #Blacklivesmatter 100 times
>Get the job
>>
>>59776081
>Wrong. The best candidates aren't nervous at all, there's no reason to be unless you think you can fail.
So you only hire people who think they're infallible? That's idiotic.
>>
File: epic_lulz.jpg (61KB, 600x582px) Image search: [Google]
epic_lulz.jpg
61KB, 600x582px
>>59776081
>You're clearly mad and clinging to petty shit to try to get back at my.
>get back at my.
Thank you for your time.

>I'm still you're boss and your still unemployable.
>unemployed
>has a boss
Thank you for your time, we will get back to you.

>Wrong. The best candidates aren't nervous at all,
>gifted people are never nervous, never have a bad day, etc.
We appreciate your time, but the interview is over.

>He wouldn't make it that far. I don't hire people with health issues because the insurance is more expensive.
>admits publicly to breaking the law
No, I have a copy of your resume, I don't need another one.

>Wrong. People skills and emotional intelligence are worth way more than technical skills and knowledge.
>says the guy getting flustered on an anonymous anime board
Sir, I'm going to have to ask you to leave now.

>There is nothing wrong with the process kid. You just don't like it because you suck, stop bitching and man up.
SECURITY!
>>
>>59762534
good thing there banning whiteboard
>>
>>59776094

so. fucking. brave.
>>
>>59776137
>SECURITY!
Are you a man or a mouse?
>>
>>59776101

Nice strawman Pajeet. If there's a candidate that isn't nervous because he knows he's got the basics down, what's wrong with that? I have got as many as 31 who passed the same whiteboard interview, that time I picked the one who was the most confident and had a way with words; the only thing with that is that you don't like it because you're not him. Stay mad.

>>59776137

I take it that you concede then.
>>
>>59776094
>>59776152
#include <stdio.h>
#include <stdlib.h>
int main()
{
for (int i = 1; i < 101; i++){
int m3 = (i%3 == 0);
int m5 = (i%5 == 0);
if (m3 && !m5)
printf("Black\n");
else if (m5 && !m3)
printf("Lives\n");
else if (m3 && m5)
printf("Black Lives Matter\n");
else
printf("%d KANGZ!\n", i);
}
return 0;
}


>you're hired!
>>
>>59776050
Do you really think cheating a hackerrank while the interviewer is watching is harder then cheating a whiteboard interview question while the interviewer is watching... if that is the case whats stopping you from doing the same.

Or do you hate them because you can't pass them? Wouldn't make sense though since you said they're easier to cheat.. I guess this means you might be worse then these Pajeets?
>>
Guys World War III just started. You're all losing your jobs soon anyway.
>>
>>59776191
No snowflake interview man. Earlier I thought it would be interesting to point out some flaws in modern interview methodology to someone who claims to perform interviews and see the response, counter arguments, etc.

Now I just think you're an idiot.

And you're breaking your own rules. You fucked up spelling and syntax in your post. I gave you one chance to correct it. You fucked up again. Now leave.
>>
>>59776191
>31 who passed the same whiteboard interview
Sounds like you need to make your questions harder if you're left having to decide based on which one you'd like to fellate the most.
>>
>>59776203
How the fuck do you even cheat hackerrank? You have full access to any reference materials and the problems are honestly quite easy
>>
>>59776203
>>59776203
>hackerrank
Nice meme. I automatically penalize anyone with hackerrank, topcoder etc. on their resume because they're clearly timewasters.
>>
>>59776203
>Do you really think cheating a hackerrank while the interviewer is watching is harder then cheating a whiteboard interview question while the interviewer is watching...
Yes. Once again, the code in any environment like HackerRank has to compile and run and solve the problem. You can talk your way through a whiteboard interview.

>Or do you hate them because you can't pass them?
This again? For the nth time, no, I do not hate them for that reason. I have never failed a WB interview.
>>
>>59776258
So you've clearly never tried any of the higher point problems at HackerRank.
>>
>>59776307
>trying to justify wasted time
>>
>>59773341
would you be willing to walk out of an interview if they asked to put it on a whiteboard which would take you 20-40mins +?

I don't program but something like this would trigger me enough to walk out
>>
>>59776356
I try to keep my whiteboarding problems to a dozen short lines of code at most.
>>
#ORIGINAL CODE DO NOT STEAL
#COPYRIGHT ANONYMOUS DISTRIBUTED EXCLUSIVELY ON /g/
#IF FOUND ELSEWHERE CONTACT [email protected]
from math import sqrt
from time import time
max_n = 2000000

def find_primes(n):
primes = [True]*(n+1)
for i in range(2, int(sqrt(n))+1):
if primes[i]:
for j in range(i**2, n+1, i):
primes[j] = False
return primes

def sum_primes(max_n):
primes = find_primes(max_n)
psum = 0
for i in range(2,max_n+1):
if primes[i]:
psum += i
return psum

niggers = time()
print(sum_primes(max_n))
print(time()-niggers)
>>
>>59776249

That time it was for a very specific position, people from over 20 countries came to interview. There were only 38 applicants but they were the best there is; skilled programmers don't fail the whiteboards as much. For entry level positions there's like one flawless pass for every 60 applicants. The other 59 are garbage that will never amount to anything.
>>
>>59776317
>practicing algorithm design is a waste of time
So you want Pajeets?
>>
>>59776406
>There were only 38 applicants but they were the best there is
You're either trolling or delusional.
>>
>>59776416
I want people who can build software, not just write algorithms.
>>
>>59776406
>There were only 38 applicants but they were the best there is;
>t. Never Took Statistics
>>
>>59776437
>I want people who can build software, not just write algorithms.
That's fair, but it still doesn't mean HR or sites like it are a waste of time. The ideal software engineer can architect an application (classes, APIs) AND implement efficient functions (algorithm design).
>>
>>59771372
Hello sir

I am hire you sir

Get job at Google? Difficult question sir many
>>
>>59776455
And HR teaches you none of one and very little of the other.
>>
>>59776483
Thanks for confirming that you haven't spent any time at all at HR.
>>
>>59776524
Have fun with inefficient learning methods. In the meantime, I'll keep ignoring your resume :)
>>
>>59776550
Implying I would give you my resume.

You've never tried the site yet you're talking shit. For anyone who takes it seriously and honestly tries to solve the problems it's an excellent chance to learn and practice. It does not replace college (or self directed study for gifted individuals), but it's a damn fine addition.

And if you know your shit? Solving the higher ranked challenges is just satisfying. It feels good to solve a challenge that only 5% or 10% of participants solve.

Then again, I'm guessing you couldn't solve the tougher challenges. So maybe you shouldn't "waste time" there.
>>
>>59772505
Nope. You can go as 'pseudo' as just drawing the answer to a problem out as a finite state diagram if you really want to. You just have to demonstrate problem solving abilities and prove that you're high functioning enough to verbalize solutions.
>>
>>59764009
The whiteboard isn't just for testing your coding skills. It's also to test your communication skills. You're supposed to explain each step of your solution. An employee that can't communicate well is useless to the company no matter how skillful he/she is.
>>
>>59775930
LMAO, you need a fucking compiler to know whether or not your solution works?
>>
>>59776900
>implying

If the problem is dead simple, no.

If the problem has any complexity, anyone would. Even Linus. Even Stallman.

Which is why Pajeets can talk their way through WB interviews. You only have to memorize a few common, simple things.
>>
>>59772991

I very much appreciated what the anon you're bitching about had to say.

I'm willing to bet that evey time you haul out the whiteboard at work, every one of your co-workers wishes you were dead. Faggot
>>
>>59773118

Stop making your employees watch you draw on things with a marker. You're like a shitty kid who draws on the walls with a crayon.
>>
>>59776921
Many interviewees struggle even with simple problems. Without google, they're like fish out of water. No, you can't talk your way through it. You have to actually solve them.
>>
>>59773346

This guy has to be baiting us. Noone is actually like this, he wouldn't have survived middle school.
>>
>>59776392
>contact [email protected]

My sides
>>
>>59776921
it's common knowledge that WB interviews weed out pajeets just fine, any person conducting a whiteboard interview can easily testify to this and they have throughout this thread

>Which is why Pajeets can talk their way through WB interviews. You only have to memorize a few common, simple things.

They don't though.
>>
>>59775890
>all of mine and my colleagues' require perfect syntax and functionality

I'm assuming that your company is a higher tier niche, most whiteboard interviews I've been in just require an understanding of how to form and complete a solution, then to explain it to the interviewer step by step. Not sure why you'd require perfect syntax, care to explain why they need to write syntax perfect code first time every time?
>>
File: 5_1.jpg (52KB, 640x480px) Image search: [Google]
5_1.jpg
52KB, 640x480px
>>59769861
>master the syntax

>don't care about minor syntax errors

pick one
>>
>>59769455
1 can't be prime, it's the unit identity. By definition it isn't.
>>59769591
Of course it means finding an item in a binary tree and return True if the item exists, else False.
>>59769679
The elements of a binary tree are already in order you dingleberry.
>>59766641
Kill yourself idiot, people who can't write code without help from their favorite IDE are worthless. You should be able to write simple stuff like this in just a few moments.
>>59773459
If you can't explain quicksort to a 5 year old, congratulations you're retarded.
>>59774102
>The fact is none of these "challenges" prove anything but people's capacity to pass the challenge. There is no guarantee any of those candidates will turn out to be great programmers.
True, this kind of stuff doesn't really have any weight on if you will be a great programmer. But if you fuck up the whiteboard really badly, chances are pretty high that you're at least a garbage programmer.
>And yet there are cucks in this very thread arguing that passing that challenge makes you a better candidate. It doesn't, really.
It does by virtue of proving you're not completely retarded. This is all stuff you should have learned in first year, it's fucking trivial shit. But companies still get people applying all the time who can't do any of it. It's a weeding out process.
>>59774114
What is there to remember exactly? Both algorithms only have a few steps.
Merge:
>Split until each element is trivially sorted
>Merge each trivially sorted list
Quick:
>Pick a pivot and find it's sorted position
>Do this for each list slice greater than and less than the pivot
Seriously, how is this hard to remember?
>>59774220
That isn't the point of this shit though. It's not to find the best candidate. It's just to easily weed out shitters.
>>
>>59778657
>pajeets have flooded the profession
>"it's common knowledge that WB interviews weed out pajeets just fine,"
You're an idiot.
>>
File: 1477586611039.jpg (101KB, 1280x720px) Image search: [Google]
1477586611039.jpg
101KB, 1280x720px
>>59775917
Yes
>>
File: 1488557565188.jpg (50KB, 449x642px) Image search: [Google]
1488557565188.jpg
50KB, 449x642px
I deliver features consistently and with quality at my job, people recognizes me as a good programmer, but I'm sure I would fail miserably in a white board. I am simply not used to it and I would probably not write compilable code.

Actually I would probably freeze and achieve little to nothing.

If you can do it, that's really great, but don't act like this is the utmost test.
>>
>>59780383
I think it's supposed to be a test of how you go about reasoning about a new problem, rather than some kind of "did you memorise the language syntax" competition.
>>
https://medium.freecodecamp.com/why-is-hiring-broken-it-starts-at-the-whiteboard-34b088e5a5db
:^)
>>
whiteboard might have been good 50 years ago. where you had to code on a punchard and a compile took the whole night. where if you made a mistake a whole day's worth of work was lost. but in this day and age it's antiquated.
>>
>>59781789
This guy nailed it. Maybe our resident chip-on-shoulder WB defender can come back and yell at us about how he interviewed the very best 39 candidates in the world.
>>
>>59762534
KILL WHITEY
>>
>>59783774
This guy ignores one core part of interviewing though. When you're working for a company you don't only need to be a good programmer. You are working in a team. As such it is important to be able to work in a team. To express yourself, to share your thoughts, with others. I know this is a foreign and intimidating thought for the countless NEETs in this thread who are scared of social interaction and blame the whiteboard for it. But your ability to code really isn't the only thing that counts.
>>
>le me :&)
>in train
>some faggot next to me with a thinkpad (T series lmao) was watching anime (not even the cute kind just like normalfag dragonball z tier shit)

I used to like anime and weeb culture ironically but after encountering one of these fucks in the wild I can only feel disgust

Thank you for reading my blog
>>
>>59783915
Could be better evaluated by asking questions about code samples or past projects.
>>
>>59766641
what are you going to do when the electricity runs out? checkmate idefag.
>>
what about blackboards though
>>
>>59785834
those are ok
>>
>step up to white board
>look through collection of colored markers
>choose red
>scrawl nineteen huge letters
BLOOD FOR THE BLOOD GOD
>shoot one interviewer in face
>chop another interviewer's head off
>continue frenzied melee au elan
Regards from /tg/.
>>
>>59768767
>Wasting cpu cycles

for (i = 3; i < limit; i += 2) {
>not jump by 2 instead, even numbers cant be prime

printf("Sum is %lu\n", sum + /*skipped primes*/ 2 + 1);
>>
>>59763639
I mean, you do have to compile assembly to a binary...
>>
>>59773058
Everybody hates fucking meetings. Who would want to fuck a meeting?
Thread posts: 285
Thread images: 28


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