IT/Software career thread: Invert binary trees for dollars.

  • Guest, it's time once again for the massively important and exciting FoH Asshat Tournament!



    Go here and give us your nominations!
    Who's been the biggest Asshat in the last year? Give us your worst ones!

Lendarios

Trump's Staff
<Gold Donor>
19,360
-17,424
Has anyone has any experience bypassing captchas?
I need to build an HTML scraper for a page that is behind a captcha. Im thinking having a human reading the cpatha and then after have some sort of greasemonkey script start the process of scraping
 

ShakyJake

<Donor>
7,963
20,076
Oh, man, i feel like an idiot. I've been looking atLeetCode Online Judgeand attempting some of the algorithm problems. I've been able to craft solutions but often not within the time frame they allow. And this is for the "easy" ones.
 

Khane

Got something right about marriage
20,597
14,323
So the purpose of that site is supposedly to help people find good interview questions. I looked to see what some of the problems were and they are all ridiculous. Shit like this:

Implement Queue using Stacks | LeetCode OJ

Seriously? They think that's a good interview question? Da Fuq?
 

Vinen

God is dead
2,791
497
So the purpose of that site is supposedly to help people find good interview questions. I looked to see what some of the problems were and they are all ridiculous. Shit like this:

Implement Queue using Stacks | LeetCode OJ

Seriously? They think that's a good interview question? Da Fuq?
My rule for interviews is a max of one dumb technical coding problem. This exists to make sure that people can actually code. Preferably a question like FizzBuzz where it is not complex and just makes sure people know loops.
It should be purely a filter question.

Based on what they are stating this question looks pretty damn easy. (and dumb as shit since you aren't building a data model just manipulating a pre-existing one)

1 minute of effort. I guess this would be a good interview question to see how people think. (Fucking lol that this what a Stack is fucking for anyhow... why abstract it. I assume that is why you said this was a dumb question)

NOTE: I left out the instantiatation of the queue object out of extra laziness.
public class Queue {
// Push element x to the back of queue.
public void Push(int x) {
list.Insert(0, x);
}

// Removes the element from front of queue.
public void Pop() {
list.RemoveAt(0)
}

// Get the front element.
public int Peek() {
return list[0];
}

// Return whether the queue is empty.
public bool Empty() {
bool isEmpty = false;
if(list.Count == 0) {
isEmpty = true;
}

return isEmpty;
}
}
 

Noodleface

A Mod Real Quick
38,360
16,251
Wow that site sucks. It doesn't even tell you anything remotely helpful about what you did wrong.

I just keep getting "Runtime error" on a solution, gee thanks!
 

Tuco

I got Tuco'd!
<Gold Donor>
47,915
82,545
Having a function with just one line, is counter productive. You lose more coding real state by declaring it, than just using it on the first place.
Look at this. example
You are not gaining anything by declaring this function. You are not checking parameters validation, you are not doing anything to the parameter, you are not modifying them, nor doing anything algorithmic wise. You are just duplicating and bloating the code.
"You should make things simple, but not simpler".
If you really wanted to make it more readable you can use consts for the string and just pass those around.
here is my first version.

I want to point out something that i do, or rather avoid and the reason behind it. The chaining of functions. I avoid the chaining of functions because it makes debugging easier. When going step by step, I can see exactly the parameters that are going into the function, and without going into the subfunction.
For example.
if there is an exception thrown on bug on this line "appendTearDownPath(buffer, PageCrawlerImpl.getInheritedPage(SuiteResponder.SU ITE_TEARDOWN_NAME, wikiPage ));" Object is null. You literally have no idea where is it, since the line covers two completely separated functions, and then if you place a break point on that line, you sort of have to manually exit the first one, and then go into the second one.

In other words, having the output of the function in a variable by itself, makes the debugging so must easier as all the values are in your watch or local window,
I agree. Good improvements. I notice chaining a lot more in Javascript than other languages. Probably because a null javascript value isn't nearly as catastrophic.
 

Asshat wormie

2023 Asshat Award Winner
<Gold Donor>
16,820
30,968
My rule for interviews is a max of one dumb technical coding problem. This exists to make sure that people can actually code. Preferably a question like FizzBuzz where it is not complex and just makes sure people know loops.
It should be purely a filter question.

Based on what they are stating this question looks pretty damn easy. (and dumb as shit since you aren't building a data model just manipulating a pre-existing one)

1 minute of effort. I guess this would be a good interview question to see how people think. (Fucking lol that this what a Stack is fucking for anyhow... why abstract it. I assume that is why you said this was a dumb question)

NOTE: I left out the instantiatation of the queue object out of extra laziness.
public class Queue {
// Push element x to the back of queue.
public void Push(int x) {
list.Insert(0, x);
}

// Removes the element from front of queue.
public void Pop() {
list.RemoveAt(0)
}

// Get the front element.
public int Peek() {
return list[0];
}

// Return whether the queue is empty.
public bool Empty() {
bool isEmpty = false;
if(list.Count == 0) {
isEmpty = true;
}

return isEmpty;
}
}
Some languages might require logic for resizing the underlying container (hence the reference in the instructions to size variable). Maybe thats the point, otherwise it seems kind of silly. Anyway for shit like this i prefer UVa, SPOJ, HackerRank and TopCoder.
 

Obtenor_sl

shitlord
483
0
"Can you implement a maximal sum equation in Ruby in under 30min!?!?!?"
English is not my first language so I'm guessing you mean you want to sum all numbers from say an array? array.inject will do anything in one line.
smile.png
 

Asshat wormie

2023 Asshat Award Winner
<Gold Donor>
16,820
30,968
English is not my first language so I'm guessing you mean you want to sum all numbers from say an array? array.inject will do anything in one line.
smile.png
Its a tad more complicated. Given an array of positive and negative integers, you need to find a continuous subarray with the largest sum.