Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Space Whale
Nov 6, 2014

Sapozhnik posted:

i mean you probably shouldn't be posting interview questions verbatim either tbh

Fair 'nuff, changed it to what it was, merge sort a big rear end file.

Did I do anything really wrong with the code? It friggin' works. :confused:

Should I just make a class period even when I just want a bundle of "file handler and line of file being handled"?

Adbot
ADBOT LOVES YOU

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Space Whale posted:

Fair 'nuff, changed it to what it was, merge sort a big rear end file.

Did I do anything really wrong with the code? It friggin' works. :confused:

Should I just make a class period even when I just want a bundle of "file handler and line of file being handled"?

should have had tests

Space Whale
Nov 6, 2014
Please don't take this as petulance:

Why? Isn't the output of the program pretty useful? Or should every function be tested period?

Edit: Also given that this is a one-off. Unless they're testing for habits?

Space Whale fucked around with this message at 19:32 on Apr 3, 2018

hobbesmaster
Jan 28, 2008

Space Whale posted:

Unless they're testing for habits?

this but its dumb

also probably are dinging you for the "writing C in C#" style you have there instead of something object oriented. dumb of course but i woudln't be surprised if they did it

FamDav
Mar 29, 2008
things they're probably dinging you for, in order of how likely it was the thing

* you're managing the list of open streams as a list and ordering them after every iteration instead of using a heap. you're doing O(k log k) work instead of O(log k) on every iteration.
* lineToRead is superfluous or misnamed. you can easily determine it from StreamReader.EndOfStream.
* The tuple stuff is hard to read, especially with a random primitive int and string. if you dropped lineToRead and made a "PeekableLineReader" I think the code would be easier to read.

Shaman Linavi
Apr 3, 2012

imo they tossed it because you did
code:
++tempFilecounter;
instead of
code:
tempFilecounter++;
i mean i'm still waiting to hear back from the company that had me do a little JSON thing/write about a PB&J sandwich but im guessing they long since tossed my resume. maybe some companies don't know what they want but are good at knowing what they don't want :shrug:

Space Whale
Nov 6, 2014

FamDav posted:

things they're probably dinging you for, in order of how likely it was the thing

* you're managing the list of open streams as a list and ordering them after every iteration instead of using a heap. you're doing O(k log k) work instead of O(log k) on every iteration.
* lineToRead is superfluous or misnamed. you can easily determine it from StreamReader.EndOfStream.
* The tuple stuff is hard to read, especially with a random primitive int and string. if you dropped lineToRead and made a "PeekableLineReader" I think the code would be easier to read.

I've been told that you should expect back and forth about it and iterate, not just do it optimally from the start. There's also the fact that reading from disc is way slower than sorting 5000 items in memory. You are right but, wth?

Also, would a sortedlist or sortedictionary be best for "use a heap" but not reinvent the wheel?

Finally, isn't ++x preferable to x++ if I'm incrementing it, period, end of story?

Space Whale
Nov 6, 2014

hobbesmaster posted:

this but its dumb

also probably are dinging you for the "writing C in C#" style you have there instead of something object oriented. dumb of course but i woudln't be surprised if they did it

So basically, just write with objects and poo poo even if it's really pointless and a one off?

Fine w/ me.

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

Space Whale posted:

So basically, just write with objects and poo poo even if it's really pointless and a one off?

Fine w/ me.

some people really love objects

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003

Sapozhnik posted:

i mean you probably shouldn't be posting interview questions verbatim either tbh

Why the gently caress not? He didn’t sign an NDA for the drat interview. Glassdoor is full of people doing the same thing, and good for them

Space Whale
Nov 6, 2014
OK, I'll make classes all the time, and unit test, all the time.

While I'm bored and have free time, is anything functional worth learning or will that interfere with the OOP I apparently need to internalize?

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.
Local variables should be camelCased. Method names should be PascalCased. If you've been writing C# for five years this should not be news.

Space Whale
Nov 6, 2014

Fiedler posted:

Local variables should be camelCased. Method names should be PascalCased. If you've been writing C# for five years this should not be news.

I always just let resharper do it and don't have it at home.

Yeah I should work on this manually.

heated game moment
Oct 30, 2003

Lipstick Apathy

DELETE CASCADE posted:

Why the gently caress not? He didn’t sign an NDA for the drat interview. Glassdoor is full of people doing the same thing, and good for them

its about ethics in tech company interviewing


you know, the same tech companies who colluded to keep salaries low.

wouldn't want to do anything unethical

Space Whale
Nov 6, 2014

Anal Del Raytheon posted:

its about ethics in tech company interviewing


you know, the same tech companies who colluded to keep salaries low.

wouldn't want to do anything unethical

Did they make a deal with your avatar or another Devil?

PIZZA.BAT
Nov 12, 2016


:cheers:


if they're not going to tell you why your code was wrong other than 'no' then you should assume it's over something pointlessly arbitrary because whoever is judging your code is a shitlord. i wouldn't lose any sleep over it.

all of the criticisms that have been posted so far- while true- shouldn't have been disqualifiers unless they specifically said to do or not do whatever in the assignment.

Space Whale
Nov 6, 2014

Rex-Goliath posted:

if they're not going to tell you why your code was wrong other than 'no' then you should assume it's over something pointlessly arbitrary because whoever is judging your code is a shitlord. i wouldn't lose any sleep over it.

all of the criticisms that have been posted so far- while true- shouldn't have been disqualifiers unless they specifically said to do or not do whatever in the assignment.

So about this -

I've learned the hard way to do exactly what your requirements are, if you're given a canned set of requirements instead of actually having a gathering session.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Rex-Goliath posted:

if they're not going to tell you why your code was wrong other than 'no' then you should assume it's over something pointlessly arbitrary because whoever is judging your code is a shitlord. i wouldn't lose any sleep over it.

all of the criticisms that have been posted so far- while true- shouldn't have been disqualifiers unless they specifically said to do or not do whatever in the assignment.

yeah i mean, if they aren't going to give you actual feedback then gently caress 'em

qhat
Jul 6, 2015


For real, don't assume the people interviewing you are competent engineers. I mean think about the worst semi senior coworker you've had, and imagine how terrible he must be at spotting talent. You'll get rejected just because you didn't state his exact precanned answer.

TimWinter
Mar 30, 2015

https://timsthebomb.com

Space Whale posted:

Please don't take this as petulance:

Why? Isn't the output of the program pretty useful? Or should every function be tested period?

Edit: Also given that this is a one-off. Unless they're testing for habits?

Were there not enough tests or no tests? If there were no tests then yeah add tests you nunce.

FamDav
Mar 29, 2008

Space Whale posted:

I've been told that you should expect back and forth about it and iterate, not just do it optimally from the start.

I would be concerned about taking this approach with an assignment vs something like an hour interview session. i would kind of expect for a take-home that you iterated a few times already and produced something good/great.

quote:

There's also the fact that reading from disc is way slower than sorting 5000 items in memory. You are right but, wth?

yeah this is the lovely and annoying part of most interview questions, which is that for whatever synthetic problem they give you the scaling considerations are just as synthetic. Whatever zip file they gave you will probably see minimal performance improvement from switching from sorting to using a heap, but it's not technically the "optimal" solution.

quote:

Also, would a sortedlist or sortedictionary be best for "use a heap" but not reinvent the wheel?

no idea, I don't know c#.

Sapozhnik
Jan 2, 2005

Nap Ghost
instantiate whatever .net calls a priority queue and chances are its implementation will be a heap.

AWWNAW
Dec 30, 2008

Fiedler posted:

Local variables should be camelCased. Method names should be PascalCased. If you've been writing C# for five years this should not be news.

the aesthetic of the code was what stuck out the most. it just doesn’t look like typical c#

it’s petty but this would be a red flag to me too in any language

AWWNAW
Dec 30, 2008

also I get the feeling reading that code it could be much more concise using LINQ

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



use the v7 native tuple syntax because if they don't recognize that you don't want to work with them

Arcsech
Aug 5, 2008
welp, just sent off my resume for what is basically my dream job

wish me luck dealing with the disappointment when i don't get it

(joking aside, I legit feel like they'll probably want someone more experienced than me, but if I don't try I definitely won't get it so hey, what the hell)

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.

Munkeymon posted:

use the v7 native tuple syntax because if they don't recognize that you don't want to work with them
Even better -- don't use tuples.

Arcsech posted:

welp, just sent off my resume for what is basically my dream job

wish me luck dealing with the disappointment when i don't get it

(joking aside, I legit feel like they'll probably want someone more experienced than me, but if I don't try I definitely won't get it so hey, what the hell)
You still have dreams. You clearly lack the requisite experience.

Arcsech
Aug 5, 2008

Fiedler posted:

You still have dreams. You clearly lack the requisite experience.

well I mean, the job is at a nonprofit, so I think I'll still need some naiveté left

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
i could go interview for other jobs and with the title i have now i could probably be making a lot more money but idgaf you know? like how much money do i really need? is it going to be enough to buy a house in the bay area? would i buy even if i had that much? no and no? ok

like i'm basically trying to optimize for money/effort ratio, and i just don't feel like spending 6mo-1yr proving myself again

i guess at some point i'll get so bored at this company that i require new stimulation, but right now i'm getting that from other areas of my life, and it's nice to have a low-effort job that, upon honest reflection, still pays way more than it loving should, despite how much i might want

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Fiedler posted:

Even better -- don't use tuples.

oh I dunno - the new syntax makes them a little cleaner than anonymous objects but of course you can't use them in query syntax :smith:

Space Whale
Nov 6, 2014

AWWNAW posted:

the aesthetic of the code was what stuck out the most. it just doesn’t look like typical c#

it’s petty but this would be a red flag to me too in any language

When I go into algomode my brain goes to C mode. At work doing webshit with other programmers I'm in C# mode. I tend to approach work different from coding challenges on a fundamental level.

For a one off app it feels weird as gently caress to inject dependencies and have classes everywhere. I'd think they wanted me to focus on the algorithmic aspects of it (having it run in moments not hours) not c sharpiness.

But eh whatever I'll rewrite it c sharply to practice. Gotta please the hiring people. It just feels weird going objectey here. YAGNI and such.

Also I coded that with a fever.

jesus WEP
Oct 17, 2004


Gazpacho posted:

i dreamed that there was another layoff and i was the only one left, and when i tried to quit the company wouldn't let me. i spoke to the HR pawns but they didn't hear me, so I grabbed one and tried to sit her back down to process me but she just kept walking. the global boss insisted that he needed me for a project (do not ask what the project is!)

Do Not Read Kafka Before Bed

PIZZA.BAT
Nov 12, 2016


:cheers:


just want to post about living in opposite-world of this thread. current job is going swell, get lots of recognition and healthy raises. so much that i'm not even bothering to open the recruiter messages on linkedin because i really don't care about what they have to say. because Job Hunting and Interviewing is Garbage.

a better world is out there!

Sapozhnik
Jan 2, 2005

Nap Ghost
:unsmith:

Space Whale
Nov 6, 2014
Is this the place to ask for a "help me learn to think in objects even outside of my comfort zone of 3 layers to expose a db as REST services" thing? Because I really do need to. All I've really internalized is enough to work on another system that already exists and answer interview questions. I do not want to just answer interviews I want to really get this stuff because I want to actually lead or architect something some day.

PokeJoe
Aug 24, 2004

hail cgatan


I think you're looking for the terrible programmers thread friend

tazjin
Jul 24, 2015


Space Whale posted:

Is this the place to ask for a "help me learn to think in objects even outside of my comfort zone of 3 layers to expose a db as REST services" thing? Because I really do need to. All I've really internalized is enough to work on another system that already exists and answer interview questions. I do not want to just answer interviews I want to really get this stuff because I want to actually lead or architect something some day.

What you need to get is not one specific abstraction (like OOP), but that most of programming simply an expression of some kind of data transformation. Relevant Twitter thread: https://twitter.com/lexi_lambda/status/969670598640070656

Learn a purely functional language (no need to go deep into abstract concepts, just to get the basics) and after that return to commercially popular OOP languages and things will make a lot more sense. You'll also get a lifelong depression because it'll be easier to see how terribel everything is.

hobbesmaster
Jan 28, 2008

tazjin posted:

What you need to get is not one specific abstraction (like OOP), but that most of programming simply an expression of some kind of data transformation. Relevant Twitter thread: https://twitter.com/lexi_lambda/status/969670598640070656

Learn a purely functional language (no need to go deep into abstract concepts, just to get the basics) and after that return to commercially popular OOP languages and things will make a lot more sense. You'll also get a lifelong depression because it'll be easier to see how terribel everything is.

https://twitter.com/lexi_lambda/status/969671047082516480?s=21


isn’t that really about the xy problem though?

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo
I failed a nodejs take home for not using OOP. I just used modules cuz I didn’t need state variables but I guess they wanted prototype inheritance or something. The problem was process a text file that’s a list of transactions and print the end state so I just parsed and then used reduce()

Adbot
ADBOT LOVES YOU

Jimmy Carter
Nov 3, 2005

THIS MOTHERDUCKER
FLIES IN STYLE
update: after having different managers yell at each other, I finally officially found out I didn’t get the position with the other group in the company, but the recruiter is shopping me around to other teams in the division and at least 2 are interested, and I should have some phone calls next week.

separately, I just submitted for a stint to go be an EPM in manufacturing operations for like 6 months because they’re working on some super-cool stuff and they’re usually pretty thirsty for talent

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply