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
Jort Fortress
Mar 3, 2005

Good Will Hrunting posted:

I'm in my interview and the bonus was, once again, using a trie.

lol. is this Doctor w-rw-rw-'s company, perchance??

Adbot
ADBOT LOVES YOU

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Good Will Hrunting posted:

I'm in my interview and the bonus was, once again, using a trie.

What does the interviewer think of you browsing SA while you answer interview questions? :v:

Pollyanna
Mar 5, 2005

Milk's on them.


ForrestPUMP69 posted:

lol. is this Doctor w-rw-rw-'s company, perchance??

I guess people just loving love autocomplete.

Xarn
Jun 26, 2015

ForrestPUMP69 posted:

Maybe! The only application I can think of is autocomplete, so is that something you've had to implement in your job?

Basic tries are good for autocompletes (well, generally retrieving a word set by prefix), string->value mapping (no risk of hash collisions shooting your perf to poo poo) and intersection that takes time proportional to the size of the intersection itself, rather than smaller of the two wordsets.

Generalized tries (e.g. binary ones) are where it gets fun and they let you do interesting things. One example is making a persistent map structure with perf. characteristics of hash maps, Another is the Aho-Corasick algorithm for locating all matches of a word set in string.

Volguus
Mar 3, 2009

Pollyanna posted:

I guess people just loving love autocomplete.

Developers hate all IDEs, therefore they love to create a new one any chance they get, therefore obviously they have to love autocomplete since it is a "must have" feature nowadays.
On another hand, I still think fondly of that one day in 1999 that I saw for the first time in my life the JBuilder IDE and that little magic it did when I typed "." after an object name. I no longer had to program with the book by my side. The "book" was right there!!!!

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

TooMuchAbstraction posted:

What does the interviewer think of you browsing SA while you answer interview questions? :v:

:razz: I had to take a dump!!!!

Anyway I just had an interview that was 5 sessions and only two parts were algo methods. The rest was design and OOP. I have no idea what to expect, but I feel like it was poor.

Gildiss
Aug 24, 2010

Grimey Drawer

Doctor w-rw-rw- posted:

I mean my college CS isn't representative, but high school level CS is seriously not a high bar to clear. "I've heard of tries" is seriously not a lot to ask.

Oh yeah all the high school CS that we get in the public school system.
:lol:

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.
I'd like some genuine help with how to answer these types of questions:

Question 1: Design a contact manager with add, search, return all, and return by search string prefix.

Question 2: You have a service that relies on a third party API with a 5% failure rate and super long compute time. Discuss workarounds to making sure your user gets a response the fastest way possible.

Question 3: Design an OOP light switch and circuitry system.

Question 4: Design the entire backend flow of a single page web app for ordering products from a web page with arbitrary items.

FamDav
Mar 29, 2008

Good Will Hrunting posted:

I'd like some genuine help with how to answer these types of questions:

Question 1: Design a contact manager with add, search, return all, and return by search string prefix.

Question 2: You have a service that relies on a third party API with a 5% failure rate and super long compute time. Discuss workarounds to making sure your user gets a response the fastest way possible.

Question 3: Design an OOP light switch and circuitry system.

Question 4: Design the entire backend flow of a single page web app for ordering products from a web page with arbitrary items.

for questions 1, 3, and 4 I would start with requirements gathering for what data needs to be persisted, what the scalability requirements are, and for the latter questions work through more of the user experience. once you have that, i would start from the data model and then refine from that by defining rough implementations of the functional requirements. this would be effectively table stakes, at which point you'd start diving into scaling beyond initial design, the underlying infrastructure for running the applications, a swell as blast radius reduction techniques.

keep things simple until simple doesn't work, ex. stick with an rdmbs and a monolith unless you need the feature set of a key-value store or the decoupling of SOA. this will keep things much simpler for you and make it easier to work on pieces of the problem independently. when you switch over to a key-value store, you're likely to have to tweak your data model more to fit your application functionality, and with SOA you're going to have consider service responsibility, contexts, and speak to surrounding infrastructure for maintaining that kind of infrastructure.

EDIT: 2 is just checking that you can pick out potential tradeoffs you could make to reduce your reliance on the availability of the third party API. your first question should probably be "when and how can responses be reused?" which will result in some form of (pre-)caching of indexed by some keys. your second question is probably "given the high failure rate, what TPS can I drive to the third party API and what TPS am I expecting to my API? How correlated are failures?" which will inform whether you can kick off multiple requests in parallel to drive down the likelihood of failure while taking advantage of the aformentioned caching.

FamDav fucked around with this message at 23:41 on Jun 14, 2018

The Fool
Oct 16, 2003


Gildiss posted:

Oh yeah all the high school CS that we get in the public school system.
:lol:

I had CS as an AP course in a public high school, his comment didn’t seem out of the ordinary to me :shrug:

Hughlander
May 11, 2005

Add a bit more to Trie chat. 21 years of development experience, only time using or being asked about a trie was a bespoke interview questions designed to know if you knew about them. (Boggle solver.) and that was just last year. 666, how would it change your world view if I said the same thing you did about a trie word per word but said quaternion instead?

apseudonym
Feb 25, 2011

ForrestPUMP69 posted:

Maybe! The only application I can think of is autocomplete, so is that something you've had to implement in your job? To give you an idea, I've worked for 4 different household name companies and never had to use any data structures beyond the basics (HashMap, List, etc). I only really learned about tries, red/black trees, etc. through interview prep, ironically.

Most algorithms are just applications of those basic structures and techniques smartly to solve a specific thing.

If an interview asks you to implement a redblack tree or a trie that's a lovely interview, if an interview asks you a problem about prefix matching and you use a trie or come up with something similar that's a better one.

At least that's how I do my Google interviews :shrug:

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

Thanks, I appreciate this, it helps. I wasn't completely off. But they all had insanely vague requirements and the engineers were super dodgy about clearing things up. At least for the last one I went into depth about caching and what the flow would be like. Hard part was just around invalidating the cache. My next question is how do I get better at those types of problems if my job that I'm at now doesn't afford me the opportunity.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Doctor w-rw-rw- posted:

EDIT: okay so are they actually rare and I've just encountered them in every job I've had by coincidence?

The standard data structures are pretty much arrays with or without some wrapper, linked lists, stacks, queues, hash tables, binary search trees, heaps, and adjacency lists and matrices for graphs. Anything above and beyond that is more specialized and not something that everyone should be expected to have heard of. Some writeups and courses will cover some of the more common variations (e.g., circular lists, bit vectors, dequeues, B-trees), but you're taking your chances with a question that assumes familiarity with even those.

Jort Fortress
Mar 3, 2005

Good Will Hrunting posted:

My next question is how do I get better at those types of problems if my job that I'm at now doesn't afford me the opportunity.

That's the kicker, isn't it? Seems like only the top 5% of software jobs actually work at this scale and deal with the associated challenges, so if you weren't hired at one of these companies fresh from college, you're at a handicap. If you spend too long in a CRUD factory working on business apps, you'll never run into such problems. I face this struggle as a "senior" engineer trying to escape a non-tech company.

Xerophyte
Mar 17, 2008

This space intentionally left blank
Trie chat made me want to see if my old algo textbook (Kleinberg & Tardos) bothered mentioning them and the structure doesn't have an entry in the index at least. I think it might've been mentioned in some programming languages course I took in the context of "hey, here's a name for an FSM with a state graph in tree form" but I sure wouldn't know that's what it was without googling. Maybe my uni was unusually crap or I was unusually inattentive, I guess? Either way I haven't ever encountered one in the wild.

Find words in Boggle/make an autocomplete sound like perfectly OK questions to me if it's a position where knowing how a lexer works is relevant.

Star War Sex Parrot
Oct 2, 2003

Xerophyte posted:

Trie chat made me want to see if my old algo textbook (Kleinberg & Tardos) bothered mentioning them and the structure doesn't have an entry in the index at least.
What about suffix trees (compressed tries)?

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

Xerophyte posted:


Find words in Boggle/make an autocomplete sound like perfectly OK questions to me if it's a position where knowing how a lexer works is relevant.

I don't even know what a lexer is!

Jort Fortress
Mar 3, 2005

Good Will Hrunting posted:

I don't even know what a lexer is!

Hmm, my "no hire" sense is tingling. You may want to consider a career change :smuggo:

Xerophyte
Mar 17, 2008

This space intentionally left blank

Good Will Hrunting posted:

I don't even know what a lexer is!
I realize that wasn't a question, but: the lexer is the part in an interpreter, compiler or other automatic text mangler that takes a character stream like "x= 10" and "quick, brown fox" and divides it into a list of meaningful words like ["x" "=" "10"] and ["quick" "," "brown" "fox"]. The lexical syntax of most languages is such that the lexers can be discrete finite state machines, of which tries are a special case. They're handy when you need to divide a character stream into words, or more practically when you need to know how the libraries that do that for you actually operate.

This isn't exactly critical knowledge for a lot of computer touching; I just thought that the trie questions were ultimately aiming at the question "does this person know how to make the computer mangle text for us?" That might just be me projecting: it's why I'd maybe ask someone to figure out how to read words out of Boggle.

Star War Sex Parrot posted:

What about suffix trees (compressed tries)?
Seemingly nothing directly about them under that heading or as prefix trees in K&T. While checking for "suffix" I did catch that at least my edition of the book does have a Six Degrees of Kevin Bacon entry, so that's nice.

Xerophyte fucked around with this message at 01:34 on Jun 15, 2018

Eggnogium
Jun 1, 2010

Never give an inch! Hnnnghhhhhh!
Tries aren’t being brought up interviews to test if you are specifically familiar with them. They are a rough variation on BSTs and even if you’ve never heard of them in your life, the practice on trees you do for a whiteboard interview should be enough for you to do a problem with them after a five minute explanation.

BurntCornMuffin
Jan 9, 2009


Good Will Hrunting posted:

But they all had insanely vague requirements and the engineers were super dodgy about clearing things up.

That's a flag to me. You asking to clear up a requirement is a good thing, and they were a little lovely for not doing so. Keep an eye open and try to discern more about the culture. Maybe get a tour if you can. If you see Dilbert comics, run.

Doctor w-rw-rw-
Jun 24, 2008

Hughlander posted:

Add a bit more to Trie chat. 21 years of development experience, only time using or being asked about a trie was a bespoke interview questions designed to know if you knew about them. (Boggle solver.) and that was just last year. 666, how would it change your world view if I said the same thing you did about a trie word per word but said quaternion instead?

To be honest, I learned about quaternions in middle school, but yeah that's absolutely not normal. I specifically read a book on games programming, and I also don't remember anything about them anymore.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

BurntCornMuffin posted:

That's a flag to me. You asking to clear up a requirement is a good thing, and they were a little lovely for not doing so. Keep an eye open and try to discern more about the culture. Maybe get a tour if you can. If you see Dilbert comics, run.

It was weird. I'd start to go in some direction, and the first set of interviewers (they were all pairs) were insanely good about it. The second set... one was great, the other said nothing. The third interview was much the same and the fourth was also fairly vague but we had some good chats. I get that they're open-ended questions but the feedback was so neutral during that I was like "uhhh am I... on the totally wrong path?"

I legit welcome algo questions now. At least I know what I did wrong and can usually get an optomized solution.

Paolomania
Apr 26, 2006

Can confirm, from highschool through college and gradschool taking data structures and algorithms from those classic texts (you know the ones, Leiserson et al, Russel & Norvig) and never covered tries until I did interview prep a few years ago (CtCI) and what do you know, one of my Big G interview questions (that I aced) was tries. I hate that their canonical pronunciation is phonetic collision with tree and refuse to pronounce it as anything but 'try'.

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
I didn't learn about tries in college either, but I wish I did, instead of all the time spent learning about the multiple inheritance fiasco in C++, which has just not come in handy.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.
Today at my interviews I expected to discuss multiple inheritance or how it's kinda done in Scala via mixins or pattern matching or the Futures API and how I've used any of them or idk something related to the languages I work with or problems I've solved with them but instead I... designed a light switch? Tech interviews are weird as hell.

CPColin
Sep 9, 2003

Big ol' smile.
I signed up for a one-hour class on how to interview people that my work is offering next Thursday. We'll see if there's anything specific to interviewing developers and, if so, how terrible it is!

Horse Clocks
Dec 14, 2004


Good Will Hrunting posted:

Question 1: Design a contact manager with add, search, return all, and return by search string prefix.

A trie in its natural habitat :haw:

Xarn
Jun 26, 2015

Hughlander posted:

how would it change your world view if I said the same thing you did about a trie word per word but said quaternion instead?

I would light up, because not nearly enough people know about them, including graphics/game programmers.

Roadie
Jun 30, 2013
Re: tries, the furthest I've ever gone in interviews with data structuring stuff and optimization thereof was multilayered filtering and search operations on arrays, and the stuff they were actually interested in was in the tradeoff between performance and code clarity and seeing that I got the gist of O(1) / O(n) / O(n^2) differences, rather than the specifics of how [].find() works.

Horse Clocks
Dec 14, 2004


I have two back to back interviews today because I succumbed to pressure from recruiters to get them done by the end of the week.

Last time I did this I totally flubbed the second one.

I also lost my crib notes of questions to ask employment candidates.

gently caress.

Guess I’m bill-o-Reillying it.

netcat
Apr 29, 2008
For some reason, the trie is the only data structure from my data structures and algorithm's class that I do remember apart from the more "standard" ones.

And I've never ever used one.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Horse Clocks posted:

A trie in its natural habitat :haw:

It's going to turn out that GWH's prospective employer was founded by Edward Frenkin

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

Blotto Skorzany posted:

It's going to turn out that GWH's prospective employer was founded by Edward Frenkin

:allears:

Another thing I missed yesterday that my interview mentioned (that I had *never* heard of) was an "inverted index"?

Naar
Aug 19, 2003

The Time of the Eye is now
Fun Shoe

Good Will Hrunting posted:

:allears:

Another thing I missed yesterday that my interview mentioned (that I had *never* heard of) was an "inverted index"?
Conversely, I have heard of that because I used to work on a big-rear end NoSQL search thing that had lots of indices for good performance!

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

Naar posted:

Conversely, I have heard of that because I used to work on a big-rear end NoSQL search thing that had lots of indices for good performance!

Yeah that's exactly what he mentioned! He said to check out ElasticSearch if I was interested in learning more about it.

My question is, how do I find a job that affords me the ability to learn this breadth of information if they... ask about loving everything in interviews?

prisoner of waffles
May 8, 2007

Ah! well a-day! what evil looks
Had I from old and young!
Instead of the cross, the fishmech
About my neck was hung.
Dumb question: why is it called an inverted index? Over in database land there isn't such a concept, right?
And if it's a metaphorical index, an index from terms to pages is... an index. An index from page numbers to terms would also be, imo, an index.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.
Also what's the consensus on follow-up thank you emails from an on-site? Seems bullshit to me, and I don't like the idea.

Adbot
ADBOT LOVES YOU

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Good Will Hrunting posted:

My question is, how do I find a job that affords me the ability to learn this breadth of information if they... ask about loving everything in interviews?

You're supposed to pick it up on your own because you're so dedicated to programming that you study everything no matter how unrelated to your current job it is.

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