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

Tenks

Bronze Knight of the Realm
14,163
606
I don't know why people list SQL off like it is a separate language to learn. The actual language of SQL is really small and stupid simple. The difficulty in RDBMS is the actual table structure, table layout and fine tuning it for performance. Knowing SQL is about the same as me saying I know how to use Apache's StringUtils.
 

Deathwing

<Bronze Donator>
16,427
7,439
How is that establishing a base technical level if any programmer can do it?

I disagree about manually reversing a string though. Proper string manipulation requires guarding against some not so obvious edge cases. It's not as simple as just writing a simple backwards loop.
 

moontayle

Golden Squire
4,302
165
How is that establishing a base technical level if any programmer can do it?

I disagree about manually reversing a string though. Proper string manipulation requires guarding against some not so obvious edge cases. It's not as simple as just writing a simple backwards loop.
Not to mention most languages have probably built in something to handle it without any fuss. Java does (and by extension Android). Even Kotlin has a basic function for it.

I'm with Noodle, there's better ways to suss out competency.
 

Deathwing

<Bronze Donator>
16,427
7,439
At this point, yes, most languages have good and *SAFE* string manipulation functions. Take a look at C/C++'s functions to see how many iterations some string functions had to go through before they arrived at a safe spot.

The company I work for sells a static analysis tool mainly for C/C++ and a good chunk of our warnings, after improper memory management, is about unsafe string functions.
 

Tenks

Bronze Knight of the Realm
14,163
606
I find probably one major memory management bug here every week. A lot of dangling mallocs
You should see our search engine. It is the most mis-managed thing on the planet. They actually have cases where they divide by zero to crash the partition and have it auto-recover so the memory gets auto-managed on loadup instead of having actual good ways of allocating and freeing the memory. The authors considered this good practice. The partitions crash all the time.
 

Tenks

Bronze Knight of the Realm
14,163
606
Also for whatever reason search at my company is extremely, extremely political. They are refusing to put a bullet in the head of the search engine because it was originally written (and then bastardized over 10 years) by an extremely high up now. So he's trying to write ANOTHER home brewed search engine instead of using an off-the-shelf search like Elastic or Solr. The most maddening part is we use HBase as our backstore for our stuff so instead of using a logical setup like Flume reading off HBase to write to Kafka to index to Solr (which is what we're actually just working on because fuck that guy) the next proposed solution still requires HBase and the search indexing to be divorced. I have a run-every-day cron job that dumps our HBase to HDFS, dumps parts of our search engine's indicies to HDFS and runs a Map/Reduce to compare differences. Every single day there are about 10k items which are out of sync between the two. Its madness. I think I've said this before also but our current engine uses memory 100% as its store. Yes everything is in memory. That item that hasn't been retrieved in 5 years? In memory. For whatever reason the politics go so far as people high up here are saying no matter what engine we select it won't be cheaper than our current solution. Despite us requiring 1m dollars to buy new servers because our engine is at memory capacity.

Oh yeah and relevance searching sucks balls too. Despite there being 100,000 LOC for the engine relevance is about 30 lines of that.
 

Deathwing

<Bronze Donator>
16,427
7,439
Real search engines store results in L1 cache. Permanently.

What's the politics behind objectively stupid programming?
 

Tenks

Bronze Knight of the Realm
14,163
606
Real search engines store results in L1 cache. Permanently.

What's the politics behind objectively stupid programming?
Much of it happens well above my pay grade but the guy who used to be in charge of search here was an extremely polarizing person. So people chose sides long ago. These divisions still run. There are people who think an off-the-shelf search engine simply could never do the type of searching we need. There are people who think the current engine is fine. There are people who want to responsibility of the new engine on their team. But honestly it comes down to people being set in their ways and way too much management.

Honestly why the concept of an engine being 100% backstored to memory EVER got the green light is beyond me. But the engine is like 10+ years old at this point so I have no idea about it's roots.
 

moontayle

Golden Squire
4,302
165
You've mentioned it before Tenks and it's still madness.

I'm kind of glad I'm in a position to change some of the things that are wrong with the platform I'm working on since the people who originally wrote it all aren't around anymore. The design decisions across the board are mind boggling.
 

Lendarios

Trump's Staff
<Gold Donor>
19,360
-17,424
How is that establishing a base technical level if any programmer can do it?

I disagree about manually reversing a string though. Proper string manipulation requires guarding against some not so obvious edge cases. It's not as simple as just writing a simple backwards loop.
There only one edge case... string been null. Why are you over-engineering the answer?
If someone tells me.. "I cant reverse the string, I have to think about the not so obvious edge cases"... not hired.

Also using. reverse is a valid answer, same as backward loop, same as however you want to do it, just do it. Also it doesn't have to bee a full proof answer, If you missed the null check, or a string greater than the int container (2 GB string), that is fine as well.
 

Deathwing

<Bronze Donator>
16,427
7,439
Is the string null terminated?
Are you passing in a length parameter? What if it's negative? Or just plain wrong?
In-place reversal or return a new character array? Is that new array passed in or do I need to allocate it? Do I need to clean up the original array passed in?

Didn't say I wouldn't answer the question, I disagree about the simplicity of it. You're using it as this pointless gotcha while it could actually be a much better question.
 

Tenks

Bronze Knight of the Realm
14,163
606
I think since he works in C# he assumes the participant would just pick a higher level language to not have to deal with many of those problems