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

Asshat wormie

2023 Asshat Award Winner
<Gold Donor>
16,820
30,964
It's been awhile but wouldn't that need to be

To do what tuco described, yes.
As it stands, that code would delete the pointer to the first element of the array and leave the other two elements floating around on the heap.
 

Deathwing

<Bronze Donator>
16,429
7,440
Good thing about doing timed coding tests at home is you can weed out people without wasting your employees time.

Deathwing, is the answer to your question, "instantiates three elements of that class on the heap, calls their constructor, then deletes the three instances?"
Just in case other people feel like giving it a shot.

The best answer is "undefined behavior". What happens when you misuse a delete operator is based on compiler. In this case, most will probably just delete the first instance of MyClass, leaving you with a memory leak. Some compilers might get ornery and cause the program to crash. But, the point of the question was not to understand memory management but how different compiler interpret the same piece of code.
 

Cad

scientia potentia est
<Bronze Donator>
24,497
45,438
Thanks for this.

Quick question. What's the best way to broach an organizational change in the way things are done? I ask because this place uses an antiquated VCS (SourceSafe) and I think they'd benefit immensely from shifting to something like Git. Being the junior guy with extremely little experience, I'm wary about suggesting such a thing without lining up my ducks, so to speak.
I'd set up your way in a test environment, get a few tech guys on your side and go pitch someone on it and show them how it already works and saves you time and has advantages a, b, and c. And show them your transition plan and explain that the guys who actually commit stuff already know how to use Git and so it should be pretty seamless.

Then it'll be a shitshow converting anyway because it always is, but thats how you pitch it.
 

Noodleface

A Mod Real Quick
37,961
14,508
My company offers a "10% of your time" initiative where we can work on projects we think will improve workflow - either personally or for the organization. Someone did the same thing here and switched us from SVN to git + stash
 

Cad

scientia potentia est
<Bronze Donator>
24,497
45,438
I never had programming tests per se where they asked me to write something specific but I did have a lot of questions in interviews that went like... our basic system arch is XYZ, and we need to add a module that does blah blah, where would you add it and why? And I'd make some outlines about what I need to look at, processes I want to undertake to design the thing properly, what sort of interface layers I'd use, stuff like that. They wanted to hear my thought process and how I approached problems.

I guess you could suss out some retards doing a programming test like that, but I'd hope they'd give you access to an IDE and compiler just like you'd have at work, because handwritten code can be powerfully retarded but in an IDE you do fine.
 

Asshat wormie

2023 Asshat Award Winner
<Gold Donor>
16,820
30,964
Looking for advice. ~5 years out of school with a BSEE. Finishing up my MS in communication/DSP while working full time and will be done this December. I currently work for a defense contractor and it is quite boring/lowish pay (~80s in LA while my 2 friends that do SW are making 95k&115k in LA/SF). After doing EE/Systems Engineering for the past 5 years, I've discovered it really isn't for me and although the grass is always greener, CS seems to have higher pay, better job security/options, and I think I would enjoy it. I have a decent CS background from AP CS in high school and I'm quite proficient at MATLAB but besides that I don't have too much software experience. Once I finish my degree this winter I'd really like to transition into SW but I'm not sure how realistic that is.

Anyone else transition from engineering to SW? I assume Python would be the closest language to MATLAB but are there other languages that I should look into? Anyone learn SW development on their own and have tips? I have the basics down but when I start to look at some more advanced code I quickly get over my head.
Look at job ads on dice, stackoverflow careers and wherever else they are posted. Look for a job you find interesting (with your math background, I bet data science stuff would catch your eye). Anyway, find a job that sounds interesting and see what skills it requires. Learn those skills.

You can use websites like Coursera, Udacity, EdX and ocw.mit.edu to learn most of the things required. Also berkeley and stanford post a lot of lecture videos on youtube and you can just follow along a class syllabus and do assignments while you watch those videos.

PS. whatever you do, make sure you are in a position to put something other than Matlab as your primary language when applying for SW jobs. And also this :Cracking the Coding Interview: 150 Programming Questions and Solutions: Gayle Laakmann McDowell: 9780984782802: Amazon.com: Books
 

Lendarios

Trump's Staff
<Gold Donor>
19,360
-17,424
Thanks for this.

Quick question. What's the best way to broach an organizational change in the way things are done? I ask because this place uses an antiquated VCS (SourceSafe) and I think they'd benefit immensely from shifting to something like Git. Being the junior guy with extremely little experience, I'm wary about suggesting such a thing without lining up my ducks, so to speak.
Dont go to Github, Try first Team Foundation, you can become the team foundation overlord.
 

moontayle

Golden Squire
4,302
165
Dont go to Github, Try first Team Foundation, you can become the team foundation overlord.
Not github, just git. I don't think I could sell using github enterprise since sourcesafe is being used "without cost".

And thanks Cad, I'll see what I can finagle from our IT guys.
 

Deathwing

<Bronze Donator>
16,429
7,440
Out of curiosity, what kind of tests do they throw at you?
Keep in mind I was interviewing for a test engineering position.

I was given 4 small executables and was told how they *should* act. They wanted me to write a script that would automatically assess whether they adhered to the expected behavior. Bonus points for thorough and creative stressing of the inputs.

I didn't know what to expect, so I spent more time than I should have refamiliarizing myself with perl(ugh). Knowing what I know now about Python, this test is dead easy. Still was able to tell them which ones did and did not work within the time limit, just wasn't able to automate it.

I think the point of the test was to see how you approached testing because it got me to the next stage of interviews and eventually the job. Though, I do sometimes wonder if they "settled" for me. The position was open for at least 6 months and it's not exactly like people are clamoring to be test engineers.
 

Vinen

God is dead
2,783
490
Keep in mind I was interviewing for a test engineering position.

I was given 4 small executables and was told how they *should* act. They wanted me to write a script that would automatically assess whether they adhered to the expected behavior. Bonus points for thorough and creative stressing of the inputs.

I didn't know what to expect, so I spent more time than I should have refamiliarizing myself with perl(ugh). Knowing what I know now about Python, this test is dead easy. Still was able to tell them which ones did and did not work within the time limit, just wasn't able to automate it.

I think the point of the test was to see how you approached testing because it got me to the next stage of interviews and eventually the job. Though, I do sometimes wonder if they "settled" for me. The position was open for at least 6 months and it's not exactly like people are clamoring to be test engineers.
Many large companies are starting to do away with the Traditional Test Engineer position and instead are requiring that developers properly Unit / Integrate test their code.

My Business Unit has recently moved towards a new model which drops the entire "Test" word in general. We instead focus on understanding how customers will use our product so we can catch Cross-product/System level issues.

Our change came about due to the absolute sewage our dev team was producing. We had to push the testing off to them and make them responsible for the product up to a certain point as a cultural change.

I personally would have just fired them all and hired a new team but that's not possible :<
 

Deathwing

<Bronze Donator>
16,429
7,440
I wouldn't mind that. We're a smaller company with maybe 15 people working on the product itself, so the devs are usually responsive to test problems. But I'd like anything that would let me get my hands on code more often. I'm good at testing, but it can be boring by itself.
 

moontayle

Golden Squire
4,302
165
Many large companies are starting to do away with the Traditional Test Engineer position and instead are requiring that developers properly Unit / Integrate test their code.

My Business Unit has recently moved towards a new model which drops the entire "Test" word in general. We instead focus on understanding how customers will use our product so we can catch Cross-product/System level issues.

Our change came about due to the absolute sewage our dev team was producing. We had to push the testing off to them and make them responsible for the product up to a certain point as a cultural change.

I personally would have just fired them all and hired a new team but that's not possible :<
I was a Release Manager at my last place of employment and over the course of about a year we lost about half our QE people, including the Director, through attrition. More and more stuff for QE started to fall into the laps of the teams programming it all and all of a sudden we started having less and less problems pop up during deployment that needed on-the-fly builds and releases (second push) until that went away completely, all on its own. We had tried to remove the second push previously as a conscious effort but got a lot of flack for it. Instead it happened organically and we only overtly called attention to it after it became the new normal. This in turn resulted in a few additional benefits across the board which made (mostly) everyone happy.
 

Noodleface

A Mod Real Quick
37,961
14,508
The one thing I hate about QA here is we have to tell them everything. We have to tell them what registers to read, how to exactly test a feature, what expected results are. A lot of times they find bugs that arent real bugs. We waste a lot of time on it, and if we are spending that much time explaining shit we might as well test it ourselves
 

Deathwing

<Bronze Donator>
16,429
7,440
What's the alternative though? It's even more inefficient to have them comb through your code to understand how it should and should not work.
 

Noodleface

A Mod Real Quick
37,961
14,508
That's the worst part, they go through our code and make their own guesses.

Our code reviews detail the steps but there's a language barrier
 

Khane

Got something right about marriage
19,875
13,393
It's very common. It's also a very bad idea. But it's so much cheaper to outsource QA to India a lot of companies end up doing it anyway.

QA staff should be part of the design process so they know what to expect when it's time to test. They should also be involved with the BAs to figure out their testing suites. Obviously they will need to have some dialogue with the developers too but usually only after they find a bug, asking a developer what needs to be tested kind of defeats the purpose of having QA as Noodle said. The developer may as well QA it themselves at that point.