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

Dumb Java shitskin gets buttblasted because job interviewer required

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: 234
Thread images: 17

Current state of the software industry: this so-called "OOP-design expert programmer ;^P" couldn't do something as simple as TRAVERSE A FUCKING BINARY TREE!

http://www.yegor256.com/2017/02/21/say-no-to-google-recruiters.html

This is almost as bad as that "gurrll programmer XD" who couldn't even do FizzBuzz and wrote a wild rant about how rectally pained she was.

YOU CAN'T MAKE THIS SHIT UP!
>>
you sound like a cunt OP shut the fuck up
>>
File: NUMBERS_NUMBERS_NUMBERS.png (84KB, 233x251px) Image search: [Google]
NUMBERS_NUMBERS_NUMBERS.png
84KB, 233x251px
>>59079653
Found the pajeet who can't traverse a binary tree.
>>
>>59079636
fizzbuzz is an incredibly basic test that anyone who has ever developed anything will know how to do

nobody gives a fuck about traversing a binary tree
>>
>>59079725
Nigga, traversing a binary tree is literally 5 lines of code.

Pre-order:
void print (link h) { 
if (h == NULL) return;
printf("%d\n", h->item);
print(h->l);
print(h->r);
}


In-order:
void print (link h) { 
if (h == NULL) return;
print(h->l);
printf("%d\n", h->item);
print(h->r);
}


Post-order:
void print (link h) { 
if (h == NULL) return;
print(h->l);
print(h->r);
printf("%d\n", h->item);
}


I hope you were just pretending to be retarded...
>>
>>59079636
I actually rode the entire thing and I frankly root for him.
He just says that he know nothing about algorithm and that he's a litteral OOP code monkey, and that big companies waste his time by interviewing him while they don't need him.
>>
>>59079636
traversing a binary tree is as easy as fizzbuzz
>>
>>59079636
"There is no point in giving me binary-tree-traversing questions; I don't know those answers and will never be interested in learning them."

Holy fucking shit.

It's not about memorizing them it's about understanding what a fucking tree is, so when you get a problem in the future, you can say "oh, I can use a tree to help solve this"

What a retard
>>
this is good new for me. and you.
>>
>>59079815
Yeah basically this. What the fuck is an "expert in object-oriented design." Like, knowing how to use multiple inheritance? Does he think that makes him an expert somehow?
>>
>>59079636

That's exactly what happens when you jump into pratice without learning the theory first.
>>
>>59079836
He can probably write entreprise quality fizzbuzz
>>
>>59079725
I was taught binary trees and tree traversal on my freshman year, right after I was taught linked lists and sorting algorithms. This is ridiculously basic. One could even argue Fizz Buzz is actually harder than tree traversal, since it's very easy to get the "Fizz Buzz" case (divisible by 15) wrong due to distraction - I've seen people do it many times.
>>
>>59079848
this

My degree was dogshit so even though I've been a dev for years I had to look binary trees up again because I haven't seem them since high school

>>59079822
What kind of problems could you use a tree to solve?
>>
>>59079996
Your compiler or interpreter heavily relies on trees to understand what the fuck you're telling him
>>
>>59079725
Oh cute a freshman who has never done any programming outside of creating a fizzbuzz. Binary trees are regularly used outside your university bubble.
>>
>>59079996
>What kind of problems could you use a tree to solve?
Parsing, displaying and storing any kind of hierachical data. Compression. Sorting and ordering multidimensional data.
>>
>>59079653
Get fucked, niglet.
>>
>>59080125
depends on your job

The guy in OP's link would never have to use or understand them for his job.
>>
>>59080400
>"Oy, could you implement this GMail tree view?"
>"Gllp"
>>
File: 1484788018366.jpg (103KB, 540x720px) Image search: [Google]
1484788018366.jpg
103KB, 540x720px
>>59079636
>>
>>59080431
>"sure!"
>$ npm-install imap-tree-view
>>
>>59080451
>"This one isn't compatible to our angular meme structure and there isn't a compatible one. Better start writing our own or take your leave."
>>
>>59079996
How about your text editor undo tree?
>>
>>59080686
How about you're momma?
>>
>>59079636
Hes not buttblasted and his post is honest you faggot
>>
>>59081212
t. mathlet
>>
>>59079636
whether this guy is or isn't retarded, Google's recruit process can be retarded.
for example when it screened out Max Howell the developer of homebrew (which Google uses very extensively) because he couldn't invert a binary tree.
>>
>>59081283
sauce?
>>
>>59081283
Homebrew is dogshit though.
>>
>>59081270
Le programming requires advanced math meme
>>
>>59081327
>Le
t. brainlet confirmed
>>
Ok I looked up Fizzbuzz and I am not a programmer but couldnt someone that is of a basic level of understanding do it in a round about way
like define all the numbers and assign them a value?
Am I stupid? am I not getting something
>>
>>59081426
>Am I stupid?
No, you're just a woman "programmer"
>>
Ah, yet another "I'm a student" thread.
>>
>>59079636
Why is /g/ so racist now?

A lot of the Indians at my school (admittedly an elite CS university) are pretty damn good at math and algorithms.
>>
>>59079636
basement dweller spotted
>>
>>59079636
>tfw learned how to traverse binary trees in first year
>tfw forget it all
>>
>>59079636
the most valuable skill in a programmer is the ability to learn new things

your CS class shit would take anyone mere minutes to pick up

it's painfully obvious that you have zero work experience
>>
When they mean "traverse a binary tree", do they mean traversing a tree of pointers or a binary tree in an array?
>>
The NSA wants shitskins so they datamine our phones better.
>>
>>59081283
I work at Google. Nobody I know uses Homebrew, development is done on Linux. There's a lot of retarded shit that goes on here, but the interview process is not that hard. They literally tell you ahead of time what to prep for the interview.
>>
>>59081426
It's fine, just don't feel entitled to a job at a software company.
>>
I'm not a programmer just a lowly IT tech guy. Should I be laughing at this person?

Is there a comparison to be made that I'll understand?
>>
>>59081473
I have no problems with the color of someone's skin if they have desire and work towards self improvement. Its the phone center and java monkeys I have issues with. Most others would agree.
>>
>>59081653
Hmm not sure, maybe if someone applied to a Windows company as an administrator of some sort and then felt smug enough about not understanding group policy that he wrote an article about why no one should ever apply to that company.
>>
>>59081473
because pajeet took their jobs
>>
>>59080032
Creating an AST is trivial. I'm just not motivated enough to implement a few hundred node types.
>>
>>59081522
Doesn't really make a difference.
>>
>>59079848
Where do you learn the theory?
Because all that seems to be passed around on /g/ are resources on how to jump in practice head first.
>>
>If she would have started her email with "We're looking for an algorithm expert," we would never have gotten any further and would not have wasted our time. Clearly, I'm not an expert in algorithms. There is no point in giving me binary-tree-traversing questions; I don't know those answers and will never be interested in learning them. I'm trying to be an expert in something else, like object-oriented design, for example.

Nothing I could add would make this any funnier.
>>
>>59079636
>using the smiley with a carat nose
>>
>>59082011
An algorithms text or online course, dummy

CLRS is well worth the money as a reference
>>
File: 134141801599.jpg (93KB, 300x300px) Image search: [Google]
134141801599.jpg
93KB, 300x300px
I failed FizzBuzz last week.
>>
>>59082037
Show us what you can do. Mr. so called algorithm expert.

Give me a hardcore fizzbuzz.

numbers from 1 to 100
if divisible by the following number print the following word
3 fizz
5 buzz
7 fuck
11 butt
17 negr

if divisble by multiple numbers print them the lowest divisor first (fizz then buzz then fuck, etc)
>>
>>59080686
This is usually two stacks, not a tree
>>
>>59081373
<implyieng
>>
>>59079636
import co.stateful.RtSttc;
import co.stateful.Sttc;
import co.stateful.cached.CdSttc;
import co.stateful.retry.ReSttc;
import com.google.common.collect.EvictingQueue;
import com.jcabi.aspects.Cacheable;
import com.jcabi.aspects.Tv;
import com.jcabi.dynamo.Credentials;
import com.jcabi.dynamo.Region;
import com.jcabi.dynamo.retry.ReRegion;
import com.jcabi.github.Github;
import com.jcabi.github.RtGithub;
import com.jcabi.github.mock.MkGithub;
import com.jcabi.github.wire.RetryCarefulWire;
import com.jcabi.log.Logger;
import com.jcabi.manifests.Manifests;
import com.jcabi.urn.URN;
import com.rultor.cached.CdTalks;
import com.rultor.dynamo.DyTalks;
import com.rultor.spi.Pulse;
import com.rultor.spi.Talks;
import com.rultor.spi.Tick;
import com.rultor.web.TkApp;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.TimeUnit;
import org.takes.http.Exit;
import org.takes.http.FtCLI;

Jesus fucking christ
How come retards like this get recruiters that suck their dick while i am stuck with research?
>>
>>59082233
It seems that you are too clever to get a job. Sad!
>>
>>59082233
>How come
Retards like this get their job done. Degenerates like you - don't.
>>
>>59082233
Probably depends on your location.
>>
Itt. butthurt self-important students that wonder why they don't get a job to pay for their meme degree while Pavel and Pajeet have the luxury to turn down google and amazon jobs.
KEK
>>
>>59082284
Which job?
Importing stuff and hoping there is a library to exactly fit your problem?
I dont see how any company would need somebody like that i have even seen pajeets that could do more than that.
>>
>>59081854
Trivial or not, it requires a tree....
>>
>>59082352
There is one 90% of the time. Of course if you're deving some embedded systems or an os and that kind of shit prolly not but if you were doing that kind of work you wouldn't be posting here would you ;] ?
>>
>>59081426
now do it for 1->10000
>>
>>59081699
But I thought they were lazy welfare bums. Which is it?
>>
>>59081560
Hi, moot!
>>
>>59081502
It would also take mere minutes to figure it out by yourself even without prior knowledge given that it is so simple, as long as you are not a double-digit brainlet. Look at the solution, faggot: >>59079781
>>
>>59082676
Suk a dolphin u fag
>>
>>59082653
Not moot, but I'll forever kick myself for not going to his presentation when he visited my office.
>>
>>59080125
>Binary trees are regularly used outside your university bubble.

I have never had need to use it desu
>>
>>59081473
>racism to slavs
what are you implying, angloshit?
>>
>>59079636
A shitload of people want to work at Google. You do end up interviewing with your direct manager, but only after you get through the technical interview.
>>
>>59082352
Exactly why he has a job and you don't. Importing the library takes seconds.
>>
>Doesn't even instantly google how to do the task

what a fucking retard
>>
File: girls_laughing.jpg (43KB, 600x363px) Image search: [Google]
girls_laughing.jpg
43KB, 600x363px
>>59083904
>he doesn't carry a copy of Sedgewick's Algorithms around at all times
>>
>>59079781
no arrows pls senpai
>>
>>59079636
>"I'm also not saying that I'm a good programmer—let's face it, I didn't pass the test"
he didn't say he's expert programmer faggot shill
>>
>>59081426
the whole point of programming is to get the computer to do the work for you, not just give it a list of things to print out because that's useless. what if you need to fizzbuzz numbers above 2 billion, are you going to define 2 billion numbers?

as other poster said there's nothing wrong with not understanding this as long as you accept that not understanding this means you probably shouldn't be hired as a computer scientist, just as somebody that doesn't understand what an element is shouldn't be a chemist
>>
>>59079781

And it's useless in the real world you fucking retarded.
>>
>>59085997
>binary trees are useless in the real world
I am a laughin!
>>
>There is no point in giving me binary-tree-traversing questions; I don't know those answers and will never be interested in learning them. I'm trying to be an expert in something else, like object-oriented design, for example.
>object-oriented design
Is this one of those idiots who try to shoehorn factories and visitors and other shit "design patterns" around everything they see?
>>
>>59086085

>this is the level of comprehension a retard has

Implying I said that you inbred.
>>
>>59082037
He's not wrong. Modern languages abstract away most details, while it's useful to know how the inner data structures are implemented, it's not necessary to use. The same way it's not necessary to know how the electrons flow in transistors to program on a computer.
>>
>>59087161
>i literally didn't say what i literally said

Not him, but lolwut?
>>
>>59081426
To write fizzbuzz from scratch you must first invent all the numbers.
>>
File: 55593577.jpg (58KB, 400x400px) Image search: [Google]
55593577.jpg
58KB, 400x400px
>>59087268
>>
>>59087346
At least you didn't try to backpedal. That's good, I guess.
>>
>>59079636
Well he kind of makes some good points. The recruitment/interview process is bullshit, but I'm a firm believer that companies can (or should be able to) hire and fire whoever they please. Even if you're perfect for the job but seem like a really lame person to work with, tough shit, its not your company. Its still bullshit though
>>
>>59087207
That's true. But would an elite engineering firm hire an EE that didn't know about transistor logic and how transistors work?

>ok draw me a schematic for an XOR gate using ttl
>"WTF THAT'S CRAZY I DON'T KNOW THAT ARE YOU LOOKING FOR SOME SUPER GENIUS HUH?"
>>
File: 1487646555931.png (1MB, 3400x8800px) Image search: [Google]
1487646555931.png
1MB, 3400x8800px
>>59082144
>>59080686
>>
>>59082141
#include <iostream>
#include <vector>
int main() {
std::vector<int> divisors({3, 5, 7, 11, 17});
std::vector<std::string> strings({"fizz", "buzz", "fuck", "butt", "test"});

for (int i = 0; i < 100; i++) {
std::string result;
for (int j = 0; j < divisors.size(); j++) {
if (i % divisors[j] == 0) {
result += strings[j];
}
}
if (result.length() == 0) {
result += std::to_string(i);
}
std::cout << result << std::endl;
}
}



//fizzbuzz_elements = {3: "fizz", 5: "buzz", 7: "fuck", 11: "butt", 17: "test"}
//for i in range(100):
//result = ""
//for divisor, string in fizzbuzz_elements.items():
//if i % divisor == 0:
//result += string
//if len(result) == 0:
//result += str(i)
//print(result)
>>
Okay, students, so here I've written a supposedly fizzbuzz solution and I had never ever heard about this thing in my entire life, including 2 years of working as a developer.
Please, enlighten me - what's wrong with it and why do I require education?

    class Program
{
static void Main(string[] args)
{
Console.WriteLine("FizzBuzz from 1 to 100000 by 3 and 5");
int total = 100000;
string fizz = "Fizz";
string buzz = "Buzz";
bool isFizz;
bool isBuzz;
for(int i=1; i<= total; i++)
{
isFizz = isDividableBy(i, 3);
isBuzz = isDividableBy(i, 5);
Console.WriteLine();
if (!isFizz && !isBuzz) Console.Write(i);
if(isFizz) Console.Write(fizz);
if(isBuzz) Console.Write(buzz);
}
Console.ReadKey();
}
static bool isDividableBy(int target, int divider)
{
int remainder = target % divider;
return remainder == 0 ? true : false;
}
}
>>
>>59088472
is this bait? I'm not falling for it.
>>
>>59088548
>is this bait?
Nope.
>>
>>59085997
Because Fizz Buzz is sooooo useful, right?
>>
>>59085794
He's not a programmer at all, fampaichan.
>>
>>59087707
Why not use a map instead, you fucking beginner?
>>
>>59082037
>>59087207
Reminder that this nigga is unironically trying to create his own programming language:

https://github.com/yegor256/eo

He doesn't know freshman year algorithms, but he wants to create his own programming language. You can't make this shit up.
>>
>>59087527
Yeah, I guess I was wrong, I admit.
>>
#include <iostream>

int main()
{
for(int i = 1; i <= 100; i++)
{
if(i%3 == 0) std::cout << "Fizz";
if(i%5 == 0) std::cout << "Buzz";
if(i%3 != 0 && i%5 !=0) std::cout << i;
std::cout << std::endl;
}
return 666;
}
>>
>>59088810
How the fuck will he accomplish that without knowing anything about trees? Just import antlr?
>>
File: 1485563184056.gif (402KB, 211x199px) Image search: [Google]
1485563184056.gif
402KB, 211x199px
>>59089709
>endl
the only moment /g/ wants you to endl is when the barrel is loaded and aimed in and at your cranium.
>>
http://notlaura.com/blog/
>>
>>59082233
kys
>>
>>59088472
It just roots out the """"""developers"""""" from the people who know some basic schitt
>>
>>59088728
That nigga couldn't pass the online w3schools test if his balls were twisted around it.
>>
>>59088472
>dividable
>i
>v
>i
>d
>a
>b
>l
>e

stopped reading here desu
>>
File: jigs up.png (19KB, 434x192px) Image search: [Google]
jigs up.png
19KB, 434x192px
jigs up lads
>>
>>59079636
>I'm not an expert in algorithms

How does one claim to be a programmer then?
>>
File: huehuehue.jpg (104KB, 750x500px) Image search: [Google]
huehuehue.jpg
104KB, 750x500px
>>59090888
>kill yourself shaking my head
>>
>>59090894
You don't have to be an expert in algorithms to be a programmer or even a good programmer, but binary trees aren't expert stuff and tree traversal is something you can figure out without prior knowledge as long as you have a basic understanding of pointers and data structures.
>>
Reminder that moot works at Google at this guy doesn't.
>>
>>59090888
Go on their and fucking present them with the brain cells they lost from the paint chips they dined on.
>>
>>59079636
Anyone else honestly enjoy programming but feel like they would mess up even basic ass stuff like fizz buzz if asked in an interview ? Like in college when the professor was watching me write code it was like the hardest thing in the world even though I knew what I was doing, you over think everything and look like a tard.
>>
>>59090894
well it depends what you do for a job exactly. plenty of jobs you could be assigned as a programmer that don't involve you writing your own algorithms.
>>
>>59079923
That assumes you went through a university computer science program. I real world programming, that kind of problem is unlikely occur. Most of the software I've worked on doesn't implement any kind of binary tree, except maybe as part of some low level language feature that isn't visible to the user. Sure there is some software that has to implement a binary tree, but basically someone writes it once and you just call the code that uses it.

I'd say only half the people I've worked with over the years actually did a CS program. Some did other degrees like physics, math, or bioinformatics while others are completely self taught.
>>
>>59091247
>I real world programming, that kind of problem is unlikely occur.
Nonsense. Have you never deleted a directory and everything in it?

>I'd say only half the people I've worked with over the years actually did a CS program. Some did other degrees like physics, math, or bioinformatics while others are completely self taught.
Turns out rolling into the vocation without the necessary not-very-sexy-yet-still-important background leaves huge gaping holes in your understanding, causing you to not understand very basic points. Who'd have thought?
>>
>>59079636
An interview for a java job would never ask you that. They woukd ask you about spring, interfaces, jms, hibernate, applications servers and dbs questions. You know things actually related to enterprise software development.
>>
>>59079848
You get free plane rides and hotel rooms? Most the complaint seemed to be they could easily have known he didn't know that shit before throwing money at him.
>>
>>59081560
>They literally tell you ahead of time what to prep for the interview.
When do they do this?
>>
>>59091441
When your interview is scheduled.
>>
>>59091488
Oh cool, how much time did you get to prep?
What topics did they tell you?
>>
>>59079653
>t. Rajesh
>>
>>59091497
About a week and a half, but I was travelling internationally to interview and we were rushing things because of visa deadlines, no idea what people usually get. desu tho I only reviewed B-trees for 30 minutes the day before at the hotel (which I ended up not using at all) and just winged it otherwise.
>>
File: 1484832507812.png (17KB, 270x195px) Image search: [Google]
1484832507812.png
17KB, 270x195px
>>59091538
>tfw nervous
Did you get a good team?
>>
>>59091563
It's ok. They're all nice people and trend to the older side a little bit so I don't really have any dumb college grads and we have good work-life balance. My manager is awesome. I'm in SRE which I feel is in general a somewhat more interesting area than just doing product development.

The bad part is that there's no one else in the team I feel I identify with (no turbo-weeb 2hu fanatic) and I kinda wish I could have that sort of interaction at work. There's one guy I feel is definitely a stealth channer of some sort.
>>
can anyone give me an example in python 2? interested in learning. I don't even know what a tree is, but from this thread I gather that it's simply an object with left/right branches, right? so you have one tree class and somehow recursively call it to create every branch/sub-branch... correct?

would appreciate working example code from a knowledgeable person. thanks in advance
>>
>>59082141
More cases is not more hardcore
>>
>>59082255
Stop typing like trump / a dumb, emotional and self righteous white trash soccer mom.
>>
>>59079636
>implying you wouldn't flunk this
https://www.youtube.com/watch?v=XKu_SEDAykw
>>
>>59091931
That's more or less it, a regular binary tree is a data structure where each node stores one data item along with links to "left" and "right" tree branches so it is recursively defined

# basic binary tree for storing numbers
class Tree:
def __init___(self, data):
self.data = data
self.left = None
self.right = None

# Insert a single data node in O(log N) time
def insert(self, data):
if self.data == data: # incoming data already exists
return
elif self.data > data: # incoming data is lesser; goes in left branch
if self.left is None:
self.left = Tree(data)
else:
self.left.insert(data)
elif self.data < data: # incoming data is greater; goes in right branch
if self.right is None:
self.right = Tree(data)
else:
self.right.insert(data)

# Lookup a data node in the tree in O(log N) time
def find(self, data):
if self.data == data: # successful lookup
return data
elif self.data > data: # search the left branch
if self.left is None:
return None
else:
return self.left.find(data)
elif self.data < data: # search the right branch
if self.right is None:
return None
else:
return self.right.find(data)


Wikipedia's articles on algorithms and data structures are actually fairly solid if not slightly dense on the math part sometimes, they're not a bad place to start
>>
>>59092357
Traversal methods:

    # Print the data content of this node
def dump(self):
print(self.data)

# In-order traversal
def traverse(self):
if self.left is not None:
self.left.traverse()
self.dump()
if self.right is not None:
self.right.traverse()

# Pre-order traversal
def preorder(self):
self.dump()
if self.left is not None:
self.left.traverse()
if self.right is not None:
self.right.traverse()

# Post-order traversal
def postorder(self):
if self.left is not None:
self.left.traverse()
if self.right is not None:
self.right.traverse()
self.dump()


There are numerous variations on the basic idea of trees, most of them address the problem of how to keep a tree from becoming unbalanced (where one branch has a lot more data nodes under it than its sibling branch does) as you insert more nodes since insert/lookup become much slower if the tree is allowed to become unbalanced
>>
>can't do a binary tree traversal
How the fuck is this chucklefuck approved in CS 101
>>
>>59092357
>>59092392
This may seem like a ridiculous or stupid question, but I'm a complete beginner. How would you actually create the tree / initialize the objects, and under what circumstances would this actually be used? Just to be clear, my biggest accomplishments so far are hello world and hangman.py--I'm just trying to wrap my head around the practical application.

Would I create branches during some other part of my program? And does each branch simply contain a reference to the "connected" node objects? Also, why do you place smaller on the left and larger on the right?
>>
>>59092406
it's probably some self taught normie casual
>>
File: file.png (5KB, 645x593px) Image search: [Google]
file.png
5KB, 645x593px
>>59092420
One of those examples is of a Binary *Search* Tree. It's a kind of tree used to store sorted data for quick lookup. The choice of left being smaller and right being larger is arbitrary. (In fact, "left" and "right" are also arbitrary, you could just call them "smaller" and "larger" sides.)

Trees in general can be used to represent any sort of hierarchical structure, like for example, directories on a filesystem. A math expression. A programming langauge program. A natural language sentence. Objects in a game. There's literally too many applications to list.

Example of using a tree to represent a math expression:

4 + 6 * 2 + 3 / (3 - 2)

To calculate this expression, you'd traverse the tree from the bottom, computing each operation and using that result to compute the other operations that depended on it in turn.
>>
>>59092420
You should be able to look up some examples of all the code for creating a tree. It depends on the language, but usually you have some sort of function you can call that will create a tree for you, which you can then insert objects into, most languages will have a library that has trees.
>>
>>59092420
You simply initialize an empty tree and insert the desired elements one at a time, trees are used in numerous situations where you generally want to be able to insert as many items as you like (compare to an array with a fixed size) and maintain an upper bound on the time it takes to insert and search items sorted correctly (may take O(N) with an array vs. O(log N) at most for a tree)

Placing smaller data nodes on the left and larger on the right effectively sorts the incoming data for you, it also makes O(log N) lookup/insert possible since you're able to rule out half of the tree (and half of that, then half of that, etc.) with every step instead of potentially checking all of the nodes in the tree

Again, this assumes that the tree remains balanced which is why variations such as red-black trees are preferred in practice; unlike a basic tree, these variations are able to auto-correct and ensure that they stay balanced and thus don't run the risk of performance dropping off sharply
>>
>>59092458
Most "normie casuals" are more knowledgeable and better programmers than most graduates I know.
>>
>>59092521
college kids can be normie casuals too

look at GDC talks... those people are almost always casual as fuck. they can be decent at the one thing they do but their knowledge and general brain sharpness tends to be lacking.
>>
>>59079996
Traversing a sorted list you fucking moron. Have you ever read a single book in your life?
>>
File: mad.png (331KB, 900x900px) Image search: [Google]
mad.png
331KB, 900x900px
>omg inverting binary trees so hard

YOU LITERALLY JUST SWAP A COUPLE POINTERS AND MAKE A RECURSIVE CALL!!! HOW HARD CAN THAT BE?!?!?

I SWEAR MODERN PROGRAMMERS ARE CANCER AND NEED TO BE LINED UP AND SHOT!!!!1
>>
>>59092937
Literally when would you invert a binary tree?
>>
>>59092937
And he's still literally better than you. ^;)
>>
>>59079923
Nobody uses trees or linked lists any more.
>>
>>59092937
recursion is slow
>>
just make a system call to open a browser and stream it the HTML page to do it in jQuery.
>>
>>59093039
Well that's too bad, because recursion is used everywhere inside your computer software.
>>
>>59093013

Modern code to solve the problem:

npm install binary_tree
npm install tree_algos
>>
I study life sciences and even I had binary tree traversal.
>>
>>59093083
thanks for sharing this valuable info.
any other revelations you stumbled upon recently?
>>
>>59092234
>what if the input is billion numbers
in theory the solution shown is still O(n) but the lookup will become slow as hell
>>
>>59082638
Who said H-1B workers were welfare bums?
Get fucked, apologist
>>
>>59093090
They wouldn't even use tree libraries because what ever they are trying to do with trees have been done before and they just need to create the objects and never have to worry about which algorithm is implemented in the background.
>>
>>59081473
this
i work at a shit state uni right now
my research team is 2 indians, 3 whiteys, and a chink

tier ranking is:
whitey a
indian a
chink
whitey b
indian b
whitey c
>>
>>59082233
because you're autistic
autism is expected in academia
>>
>>59093224
>tier rankings from self-professed shit state unitard
what a valuable anecdote, thanks anon
>>
>>59093260
whatever fagit, i'll just be chilling in office hours getting my penis touched by dumb sorority girls who are failing in my introduction to INTERNET pop culture class
>>
I wrote a linked list and a binary tree in C. Is that enough algorithms to get through a job interview?
>>
>>59093224
and you are a nigro
which make you all The Retardengers
>>
>>59079636
Have you just discovered Yegor256?
The entire place is a hilarious treasure trove.
>>
>>59093224
>>59093276
so you're the chink?
>>
>>59093361
>>59093326
i'm a whitey
i didn't include myself in the list simply because they're masters students and i'm a prof
>>
>>59079836
Read his code samples and bee amazed. How can you not know about this guy?
>>
>>59079996
>What kind of problems could you use a tree to solve?

A tree is merely a directed graph with the special case that there's a single root node. Any algorithm that you can run on a graph can be ran on a tree. It turns out graph algorithms are really useful things. A* is one such algorithm, used for pathfinding.
>>
>>59082141
How is that supposed to be hardcore?
Any decent programmer would make their FizzBuzz work dynamically by using some kind of array, list or dictionary to host every single possibility, so all you had to do was add your shitty new words to those containers without having to change any logic and it would work instantly.
>>
>>59081426
within a couple hours of learning to program you would know the solution and you'd realize how stupidly easy it is. That's all there is to it, it's not a hard problem if you have basic knowledge of programming - which is the point, if the person can't do fizzbuzz they can't do anything else.
>>
>>59088472
> return remainder == 0 ? true : false;
just return remainder == 0; dummy
>>
>>59079781
>traversing a tree recursively
>>
>>59079725
I've done fizzbuzz with my first Java class in college. It was literally the first program we were assigned to write. If someone trying to get a job can't even fizzbuzz then I'm certainly more qualified than they are.
>>
>>59088472
this has to be the most shit fizzbuzz I have ever seen my man, but I guess it works.
>>
>algorithms
useless shit. dev for 2 years now. everythings on stack overflow anyways. the art is piecing it togehter and making decent overall architecture
>>
>>59089709
>clearing the buffer every line
Disgusting
>>
>>59093491
Thank you, friend, you're completely right here.
>>
>>59079836
>What the fuck is an "expert in object-oriented design."

http://www.yegor256.com/2014/11/20/seven-virtues-of-good-object.html

http://www.yegor256.com/2014/10/29/how-much-do-you-cost.html

tl;dr he has Certificates in java (#wow #whoa) and rubbed a few neurons together to develop the idea that data being const is a benefit sometimes and you shouldnt expose literally everything with getters and setters

I bet he can write a mean enterprise fizzbuzz with no less than 5 interfaces
>>
>>59092937
You described reversing a binary tree you moron. Inverting a binary tree means turning it upside down. (child to parent instead of parent to child) You're fired.
>>
Checked his work, found this gem : http://www.zerocracy.com/
>>
>>59094377
What about turning it inside-out?
>>
>>59094377
but a node can't have 2 parents
>>
>>59087346
Nice argument
>>
>>59079636
if it was a ML derived language, traversing a binary tree is piss easy

I'd never do it if it was a c-tier language
>>
>>59087527

what book is this from?
>>
>>59092986
Keep telling yourself that, Yegor.
>>
>>59095494
>Yegor
It's Maksim actually.
>>
>>59095576
>shitskin names
All sounds same to me.
>>
>>59079851
lol
>>
>>59095607
>shitskin
isn't it a slavic name or something
>>
File: huehuehue.png (523KB, 456x600px) Image search: [Google]
huehuehue.png
523KB, 456x600px
>>59095813
>implying slavs are white
>>
>>59093549
literally why wouldn't you do it recursively
>>
>>59091247
NTFS uses B+ trees.
Quake used BSP trees or whatever they're called.
A lot of game engines use compex data structures.
>>
>>59096035
What do you mean?
What are they if not white?
>>
>>59096128
trash.
>>
>>59079636
>TRAVERSE A FUCKING BINARY TREE
I've been programming for years and have never had to do this.

I can do it, of course; it's trivial. However, it seems silly to ask someone to whiteboard.
>>
File: huehuehue.png (535KB, 600x456px) Image search: [Google]
huehuehue.png
535KB, 600x456px
>>59096128
>they
You're not fooling anyone, Sergey!
>>
>>59081473

we're /pol/ now
>>
>>59091026
I do the same, but it's a personality problem. I hate having people behind me because I know they can watch my screen and I can't concentrate.
>>
>>59079636
>russian hacker
>shitskin

?
>>
>>59079636
>TRAVERSE A FUCKING BINARY TREE
what does this mean? is this part of data structures?
>>
>>59085997
Grasping at straws, eh Pajeet?
>>
>>59096277
>'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''hacker'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
>>
>>59096283
- t. Pajeet
>>
>>59096401
mR/ well yes but please. always aer a good idea to learn
>>
>>59093549
>tree without recursion
You're retarded.
>>
>>59082141
I'll do you one better, nigger.

https://gist.github.com/LandonPowell/aeacf1f02b49fdb96ba2f7607d5baf27

A FizzBuzz to end all FizzBuzz.
>>
>>59088472
First, use a better language.
Second, just use remainder is 0 or not remainder, not if remainder is zero true else false.
Third, stop using all those god damn variables. It makes my head hurt.
Fifth, you don't need to use "is divisible by 3 and is divisible by 5". You can just use "is divisible by 15". That's optional though.
>>
>>59096300

>mfw I'm employed and you're not

Please continue to spew your retardation about binary trees in interviews so I can get the job easier.
>>
[1 to 100]map ->[k+\zz for k,v of{Fi:3,Bu:5,Ba:7}|it%v<1]*''||it

Fucking easiest problem to solve on this earth.
>>
>>59097797
What esoteric programming language is that?
>>
>>59097808
Livescript
>>
>>59096480
You would never use recursion in real code, bringing it up in an interview is just dumb.
>>
>>59097876
kys
>>
>>59097876
are you a dreamweaver babby?
>>
It's clear that he was never really the guy they were looking for, and he admits it, his only beef is that they bothered to waste everyone's time and money. They paid to fly him out there and put him in a 5 star hotel so they could invite him to a room and blindside him with questions that he didn't know the answers to. That could have been avoided if they had read the guy's profile.
>>
>>59082233
Recruiters for programming are people who failed even doing ENTERPRISE QUALITY - but since al lthey know is enterprise shit, that's what they hire based on.

Your code probably looked like goobledy-gook that could never work, since the recruiter is too dumb.

You don't have to import everything under the sun, but make sure your example code is readable by even the stupidest of plebs (since that's who you're trying to impress)
>>
>>59085997
Are you implying that binary trees are useless because they only have 2 children, or are you implying trees are useless in general?
>>
>>59097876
Isn't the whole point of trees is that they offer an efficient way to recursively traverse them?
>>
>>59092986
>using the smiley with a carat hat
>>
>>59098352
>having your eyes underneath your nose
>>
>>59098244
>efficent
>recursively
full kek
>>
>>59098870
>his programming language of choice doesn't have TCO
O I AM LAFFIN
>>
File: 1468219187177.jpg (21KB, 622x433px) Image search: [Google]
1468219187177.jpg
21KB, 622x433px
>>59097614
>Being this assblasted
>>
>>59097876
for an interview question that just wants you to show basic knowledge it's ok to use recursion. but i agree that in real code you should never use recursion. you could point out that it's just one way to do it and you would rather use an explicit stack.
>>
>>59098870
Premature optimization is the root of all evil, nigger.
>>
I hate hate that java is such a pajeet meme. Theyre ruining its reputation
>>
>>59098223

Another one!1!1!1
>>
>>59079636
Who else read this guys book Elegant Objects? I dont feel in power to underestimate it writers skills and cleverness but this guys ideas are truly retarded.
>>
>>59100462
You have to be a special kind of retard to take OOP seriously let alone wanting to take it to the extreme.
>>
>>59100551
At least im an employed retard being awared of extremes when seeing them.
>>
>>59100551
You'd also want a job. Thankfully /g/ doesn't seem to worry about that.... at all.
>>
>>59099085
go back to stackoverflow and get your upboats there. The meaning of the quote was that optimizing without understanding the problem is wrong, that's what "premature" means. premature doesn't mean before you write the code. Of course you stackoverflow kids keep abusing it for anything that someone wants to make efficient. anon there wants to optimize for recursion because not all languages have tail-call optimization, thus as n recursive calls grows large you will run into a stack overflow because the program is creating many stack frames for each function call.

Understand the problem, understand the solution.
>>
>>59100551
People tend to fear what they don't understand.
>>
>>59100462
yeah ok ,back to your fizz buzz monkey
Thread posts: 234
Thread images: 17


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