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
Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

Rocko Bonaparte posted:

Given your input set of [3, 4, 7, 1], the output they wanted would be [28, 21, 12, 84]

Every index is a product of the numbers to the right of it (left most element), left of it (rightmost element), or a product of the product of the numbers to the right and left of it. You do a first pass to get the product of numbers to the left of each index (hence the zeros, nothing to the left of a[0] or its counterpart on the other side). I was illustrating the forward and backward passes.

Or something like that. I agree that this isn't really something I would have come up with had I not been practicing these types of questions for a month.

Adbot
ADBOT LOVES YOU

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Good Will Hrunting posted:

Or something like that. I agree that this isn't really something I would have come up with had I not been practicing these types of questions for a month.
Yeah... it's looking like I need to cram these goofy trivia questions if I want to jump to somewhere else that seems to be nice.

I can't imagine how any of this has to do with a job adding a help button to Amazon devices.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

Rocko Bonaparte posted:

Yeah... it's looking like I need to cram these goofy trivia questions if I want to jump to somewhere else that seems to be nice.

I can't imagine how any of this has to do with a job adding a help button to Amazon devices.

I'll play devil's advocate and say they've actually made me sharper and quicker to realize things about other problems I see. A lot of them are definitely not trivial. I've really enjoyed getting better at DP and recursion (though gently caress Towers of Hanoi, I hate that poo poo).

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

necrobobsledder posted:

A lot of those example questions are really open ended, meandering potentially and tough to score objectively compared to algorithm tests (perhaps.... IQ tests).
Yeah, there's still a place for the "solve a puzzle" type of questions, but I don't think that really exercises the interviewee's high-level design ability.

quote:

Regardless, one thing I don't see that's really common and time-consuming in daily work but rare in programming interviews is "here's some code, what's wrong / find the bug(s)."

Yeah, definitely agreed. Most of the work you do is going to be debugging, maintenance, and minor feature addition, pretty much no matter what sub-discipline of software dev you're in.

Rocko Bonaparte posted:

Yeah... it's looking like I need to cram these goofy trivia questions if I want to jump to somewhere else that seems to be nice.

Solving puzzles is a skill; it involves being able to think about a problem from different angles. I don't know how useful of a skill it is necessarily, but you don't need to just memorize a million special cases in order to do well at interviews.

You might try doing the Project Euler problems. I think they'd probably do a good job of helping you train your problem-solving muscles, and they tend to be small and self-contained.

quote:

I can't imagine how any of this has to do with a job adding a help button to Amazon devices.

Not a whole heck of a lot, but this is the state of the industry. Unless you want to stage a revolution in how software dev interviews are performed, you're stuck jumping through the same hoops we all face. :shrug:

Stinky_Pete
Aug 16, 2015

Stinkier than your average bear
Lipstick Apathy
Adding a button isn't a job

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Stinky_Pete posted:

Adding a button isn't a job

So you say, but a lot of people get paid a lot of money to do exactly that.

Analytic Engine
May 18, 2009

not the analytical engine

Stinky_Pete posted:

Adding a button isn't a job

Blinkz0rz posted:

So you say, but a lot of people get paid a lot of money to do exactly that.

But if that button is part of a "data-driven" UI...

Thank you Angular/React/D3 for making Front End a job

MeruFM
Jul 27, 2010

Stinky_Pete posted:

Adding a button isn't a job

maybe, but getting someone to add a button is a monumental effort in most companies

Monkey Fury
Jul 10, 2001

Rocko Bonaparte posted:

Given your input set of [3, 4, 7, 1], the output they wanted would be [28, 21, 12, 84]

code:
>>> from functools import reduce
>>> def arr_prod(arr):
...     prod_arr = []
...     for i in range(0, len(arr)):
...             if i == 0:
...                     val = reduce(lambda x, y: x * y, arr[i + 1:])
...             elif 0 < i < len(arr):
...                     val = reduce(lambda x, y: x * y, arr[:i] + arr[i + 1:])
...             else:
...                     val = reduce(lambda x, y: x * y, arr[:len(arr) - 1])
...             prod_arr.append(val)
...     return prod_arr
... 
>>> for thing in arr_prod([3,4,7,1]):
...     print(thing)
... 
28
21
12
84
:haw:

For real though, anytime I see something like this, I always try to make a note and then go through and implement them in a language I'm comfortable with. Even if I don't get the most optimal solution the first time through (clearly), it's still a start and something to build off. Do enough stupid small problems like this, and you start to notice patterns/way to categorize them that can give you a basis for solving their numerous variations/cousins.

Kyth
Jun 7, 2011

Professional windmill tilter

mrmcd posted:

US-NYC-9TH office best office.

Confirmed. Have been at many different google offices in many different countries, NYC is the best. (I am based out of MTV, alas.)

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Stinky_Pete posted:

Adding a button isn't a job

Writing the help system behind it definitely is. Did people really think I meant literally adding a GUI control?

AskYourself
May 23, 2005
Donut is for Homer as Asking yourself is to ...

Button posted:

It's all about context

Writing the help system
Knowing where to place the button in the app
Knowing the text on the button
Knowing the interaction it has with other component in the UI
Knowing what the button must do when you press it
Is this a web page, a mobile app (native, hybrid, html), Vr app, or Desktop app ?

Coding a button to restart a Webapp on azure is of course very different from a button that popup hello world in javascript.

qntm
Jun 17, 2009

Monkey Fury posted:

code:
>>> from functools import reduce
>>> def arr_prod(arr):
...     prod_arr = []
...     for i in range(0, len(arr)):
...             if i == 0:
...                     val = reduce(lambda x, y: x * y, arr[i + 1:])
...             elif 0 < i < len(arr):
...                     val = reduce(lambda x, y: x * y, arr[:i] + arr[i + 1:])
...             else:
...                     val = reduce(lambda x, y: x * y, arr[:len(arr) - 1])
...             prod_arr.append(val)
...     return prod_arr
... 
>>> for thing in arr_prod([3,4,7,1]):
...     print(thing)
... 
28
21
12
84
:haw:

For real though, anytime I see something like this, I always try to make a note and then go through and implement them in a language I'm comfortable with. Even if I don't get the most optimal solution the first time through (clearly), it's still a start and something to build off. Do enough stupid small problems like this, and you start to notice patterns/way to categorize them that can give you a basis for solving their numerous variations/cousins.

Sure, except that runs in quadratic time...

Monkey Fury
Jul 10, 2001

qntm posted:

Sure, except that runs in quadratic time...


Monkey Fury posted:

Even if I don't get the most optimal solution the first time through (clearly),

Like, yeah, it's terrible, but I still think it's important to attempt these things at least once on your own -- even if your solution is bad/weird/contrived, like this one -- before you toss your arms up and go to Stack Overflow. Not at the interview where you're told to do O(n) off the bat, but for self-study.

edit: Also, posting your poo poo solutions on the internet where people can tell you why it's wrong is important, too.

Monkey Fury fucked around with this message at 19:56 on Sep 2, 2016

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Monkey Fury posted:

Like, yeah, it's terrible, but I still think it's important to attempt these things at least once on your own -- even if your solution is bad/weird/contrived, like this one -- before you toss your arms up and go to Stack Overflow. Not at the interview where you're told to do O(n) off the bat, but for self-study.

edit: Also, posting your poo poo solutions on the internet where people can tell you why it's wrong is important, too.

You should probably still do your poo poo O(n^2) solution if you don't immediately know the O(n) solution, shows you can think and work through a problem. Hell, even if you DO know the O(n) solution, you should probably pantomime a little bit. Simply recognizing the problem and reciting from rote the exact O(n) solution they want either means you are so hot poo poo good they should hire you on the spot, or you've been coached or just memorized a bunch of common algorithms without full understanding, and they will probably lean towards the latter unless you ace every single other problem they throw at you.

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost
Simply throwing code at a problem right off the bat seems cool and hip but probably won't win over points with an interviewer if it's more complicated to read than the most intuitive answer without having any performance advantages. I've over-thought a lot of questions in interviews and made myself look like an idiot when it's supposed to be real straight forward and simple out of certain defensive / maintainable coding habits, would not recommend trying to be fancy unless you're very sure of yourself.

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
I usually lead off an interview question by saying "well here's the brute-force solution, it runs in O(lovely) but it'll get you your answer". Takes like twenty seconds, shows that I can actually solve the problem as stated, and may help identify what exactly needs improvement in the optimized version. Plus it gets me talking, which is a lot better than the interviewer asking a question and then me staring at the whiteboard for 20 seconds going "Hmm...maybe, but no...hm..."

mrmcd
Feb 22, 2003

Pictured: The only good cop (a fictional one).

Also, asking questions is important too, even if you're only restating the problem or providing more test cases. Not only does it make sure you understand the problem correctly (a good job skill!), but it helps illuminate for the interviewer how your thinking works and how you analyze a problem.

Beyond that, if you're the kind of person to get tripped up on your own headspace and choke, it can help you calm the hell down and provide the confidence you need to start working on a solution.

apseudonym
Feb 25, 2011

mrmcd posted:

Also, asking questions is important too, even if you're only restating the problem or providing more test cases. Not only does it make sure you understand the problem correctly (a good job skill!), but it helps illuminate for the interviewer how your thinking works and how you analyze a problem.

Beyond that, if you're the kind of person to get tripped up on your own headspace and choke, it can help you calm the hell down and provide the confidence you need to start working on a solution.

And if you're wrong it gives the interviewer enough info to help you.


If you just sit there staring quietly I can't help you :(

pr0zac
Jan 18, 2004

~*lukecagefan69*~


Pillbug

TooMuchAbstraction posted:

I usually lead off an interview question by saying "well here's the brute-force solution, it runs in O(lovely) but it'll get you your answer". Takes like twenty seconds, shows that I can actually solve the problem as stated, and may help identify what exactly needs improvement in the optimized version. Plus it gets me talking, which is a lot better than the interviewer asking a question and then me staring at the whiteboard for 20 seconds going "Hmm...maybe, but no...hm..."

This is correct.

Interviewers can't read your mind and this is by far the best way to quickly demonstrate/confirm you understand the problem. I've had a few interviews where the candidate wasted 20 minutes working in their head before putting something down that's completely wrong because they didn't actually understand the problem.

(Most) interviewers are not assholes and would prefer you succeed since it's really uncomfortable on the other side too when an interview is going badly. Working from a naive solution makes it a lot easier to talk out loud as you think since you've got something structured down to work from. Talking out loud while you work gives the interviewer chances to suggest hints or give clarification. Also it just makes the interview less awkward increasing the chance the interviewer remembers the experience positively.

Also remember (good) interviews are as much about judging thought process and ability to work through a problem as it is about whether or not you put the correct answer down. If you don't talk and don't put down iterative attempts I have no clue whether you reached the answer by creative reasoning or because you memorized it last night.

In a similar vein, if you're completely stuck but know how you'd figure it out if you were in front of your computer explain that cause you're at least demonstrating some ability to figure stuff out in real life. You should avoid saying "I don't know" as much as possible.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I was reminded of the problem today and got rather agitated. My wife had brought up some little thought puzzle to me yesterday, but I didn't really have time to crunch on it. I tried it today and had a problem to it:

There are 100 people, of which some are honest and some are liars. They've just finished shaking some number of hands in another room, and now want to tell how many are honest and how many are lying. You ask them, "With how many people did you shakes hands in there?" The answers are 0, 1, 2, 3..., 99 down the line.

I did the same old thing of not panicking over having 100 things and scaled it down to 1, 2, 3, and so forth to get a feel for it.

I then realized I was getting all kinds of possibilities and decided to look up the question online. There was a missing piece of information: The participants know who is honest and who is a liar. They only shake hands with honest people. I guess it's also worth noting that there's no double-counting. So with that extra bit of information, it's very easy to figure out. You can mess with it if you want--I won't tell.

I realized then that the interview problem I was dealing with was something I would have casually done with that, and is actually one of my usual chants for walking into these:

1. If the possibilities are suffocating, scale it down to 1, 2, 3, .. and then maybe think about 100+.
2. If they're still irritated by whatever I'm doing, use a lookup table.

The problem was that the interviewer immediately asked me if there was a way to precalculate things without getting into n^2 complexity. So I got stuck on lookup tables. So it's very important to communicate these drat problems well.

He also did say two loops will always be n^2. I mean, always. I think that is absolutely false. If you try to iteratively implement many of the log n stuff that would normally be recursive, you'd wind up with loops like that, but the logic inside them is not revisiting everything across a square domain.

I suppose you could make the argument that creating two arrays with products in them is a precalculation, but it sounded like he wanted to do lookup tables. Whatever.

I remember of another one that really got me that is frustrating to still think about. I was finishing up college and was interviewing at Microsoft for what at the time would be the Vista kernel. I was interviewing with the manager and he gave me what I thought was a really straight-forward and stupid question: how do you remove an element somewhere in the middle of a single-linked list? After just doing the mechanics of it remove the element and repairing the list, he kept asking me over and over how to do it. We got to a whiteboard even. He never elaborated any further, and eventually we were just back at his desk, going over my resume. I figured out later I had lost the whole thing right there. What I assumed afterwards he wanted was how to remove the centermost element of a singly-linked list, and presumably without having to reiterate it. That's the old two-pointer thing: one pointer moves twice, the other moves once; when the first hits the end, the second hits the middle, which puts you right there. I was doing similar poo poo in high school. Well, I guess we saw how Vista went.

Anyways, I did poo poo out the n^2 solution so they knew I had a pulse and got into some rather elaborate stuff, and I did absolutely ace the second question. I didn't just get immediately rejected like I did for my first Amazon interview. That was for a system engineering position where they just asked me about the output from the top command and a bunch of other Linux administrative trivia, based on me saying that I have developed and worked under Linux, but never had to administer it. So they could still be mulling it over--or the extended weekend took over.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Rocko Bonaparte posted:

He also did say two loops will always be n^2. I mean, always. I think that is absolutely false. If you try to iteratively implement many of the log n stuff that would normally be recursive, you'd wind up with loops like that, but the logic inside them is not revisiting everything across a square domain.

I usually use two for loops when implementing an expanding/collapsing window in O(N) which comes up in these toy problems pretty regularly.

code:

auto lead = thing.begin();
auto follow = thing.begin();

for (; lead != thing.end(); ++lead) {
    for (; follow != lead; ++follow) {
    }
}

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost

Rocko Bonaparte posted:

I figured out later I had lost the whole thing right there. What I assumed afterwards he wanted was how to remove the centermost element of a singly-linked list, and presumably without having to reiterate it. That's the old two-pointer thing: one pointer moves twice, the other moves once; when the first hits the end, the second hits the middle, which puts you right there.
This kind of miscommunication is a big part of why I say that people should not be ashamed of "failing" interviews - interviewers are fallible, too! This is more egregious when the person interviewing you poorly may not ever work with you either and technical collaboration / communication skills are also being evaluated.

Necc0
Jun 30, 2005

by exmarx
Broken Cake
Most aggravating interview experience I've ever had was when I was walking the interviewer through my logic, thinking out loud, starting from the naive solution and moving forwards etc only to have the interviewer suddenly tell me everything was wrong at the very end because I'd fundamentally misunderstood what he was asking for in the first place. It was then that I learned that just because the interviewer isn't vocally responding to anything doesn't necessarily mean you're going in the right direction- it probably means they aren't even paying attention. If you're on the phone and can't see that the interviewer is actually paying attention to you, force them to acknowledge what you're doing by occasionally asking simple questions and not moving forwards until they answer.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.
My second phone interview with Google couldn't have gone worse. My interviewer copy and pasted a question, and mumbled maybe 10 words beside that. I got a brute force solution and explained it, then got an optimized solution and explained how I would code it. I' m going to solve it myself later on but there's really no way I could have done that problem in 45 minutes without any sort of help.

spiritual bypass
Feb 19, 2008

Grimey Drawer
These people sound like jerks. Hope you don't end up having them as coworkers!

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.
I'm trying not to sound salty but
when I ask basic questions about qualifying the problem I don't expect silence.

Maybe I'm just dumb and bad but these were a lot harder than I expected. I don't think the "explain your thought process" is going to be worth much since I barely got through my optimized solution.

Doctor w-rw-rw-
Jun 24, 2008
Just gonna say, some of the worst interview experiences of my life have been at Google, and the best interview experiences of my life at Facebook. I started the interview process, got onsites, got the results, and signed the paperwork in the span of two weeks.

Google forgot about me after my last interview (after messing up the interviews themselves because they assigned engineers literally not qualified or willing to follow the topics they were assigned). I let myself out.

I'd be more grumpy if I hadn't landed (re-landed?) my dream job, but I just don't understand how y'all get hired at Google.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.
Google rejected me already, that was fast!

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
I wouldn't be surprised if a lot of it just comes down to luck, honestly. Getting the right interviewer probably makes a huge difference. You might see if you can tell the recruiter that you don't feel like your interviewer helped you understand the problem as stated.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

TooMuchAbstraction posted:

I wouldn't be surprised if a lot of it just comes down to luck, honestly. Getting the right interviewer probably makes a huge difference. You might see if you can tell the recruiter that you don't feel like your interviewer helped you understand the problem as stated.

If my interviewer today was half as good as my first interviewer, I would have done a lot better. And my first interviewer wasn't even that great!

I gave my recruiter some kind feedback and honestly I may sound bitter or whatever, but today was a huge turnoff. I'm a lot less upset than I imagined I would be.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

Good Will Hrunting posted:

If my interviewer today was half as good as my first interviewer, I would have done a lot better. And my first interviewer wasn't even that great!

I gave my recruiter some kind feedback and honestly I may sound bitter or whatever, but today was a huge turnoff. I'm a lot less upset than I imagined I would be.

Interviews go both ways. Maybe you still want to work at Google, but certainly not on that team.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

Doctor w-rw-rw- posted:

Just gonna say, some of the worst interview experiences of my life have been at Google, and the best interview experiences of my life at Facebook. I started the interview process, got onsites, got the results, and signed the paperwork in the span of two weeks.

Google forgot about me after my last interview (after messing up the interviews themselves because they assigned engineers literally not qualified or willing to follow the topics they were assigned). I let myself out.

I'd be more grumpy if I hadn't landed (re-landed?) my dream job, but I just don't understand how y'all get hired at Google.

I've heard glowing things about FBNY but I haven't heard back from them and it's been 2 weeks. The position was a bit of a reach for my experience level, so that might be why.

MrMoo
Sep 14, 2000

Good Will Hrunting posted:

I'm trying not to sound salty but when I ask basic questions about qualifying the problem I don't expect silence.

I had that for one interview session at Google, he also took 2+ weeks to file feedback and that caused other issues and had the recruiter apologizing profusely. If working in a vacuum makes someone "Googley" I don't think I want to work there, maybe it explains a lot of their terrible products and services though.

Can you work for Facebook if you never use Facebook and don't want a Facebook account? :lol:

Doctor w-rw-rw-
Jun 24, 2008

MrMoo posted:

I had that for one interview session at Google, he also took 2+ weeks to file feedback and that caused other issues and had the recruiter apologizing profusely. If working in a vacuum makes someone "Googley" I don't think I want to work there, maybe it explains a lot of their terrible products and services though.

Can you work for Facebook if you never use Facebook and don't want a Facebook account? :lol:

Kind of. You need an account, but you can use a Work account and never have to think about pesky notions of socializing or friendships

Stinky_Pete
Aug 16, 2015

Stinkier than your average bear
Lipstick Apathy

TooMuchAbstraction posted:

I wouldn't be surprised if a lot of it just comes down to luck, honestly. Getting the right interviewer probably makes a huge difference. You might see if you can tell the recruiter that you don't feel like your interviewer helped you understand the problem as stated.

Yeah I think my luck was in emphasizing that I shouldn't have to repeat the phone interview, getting me to the on-site. I had to prepare for it no doubt, but being right in front of the person makes a huge difference when you're doing those questions.

kloa
Feb 14, 2007


Does it hurt to interview for a position if you don't feel qualified? I don't want to apply, get laughed out the door, and it hurt any future prospects with them. Them being Amazon, even though I hear occasional horror stories, I'd like to keep my chances open if possible.

I can't tell if I received one of those generic recruiter emails they blast out, but a recruiter at Amazon reached out to me today. So now I'm debating on actually applying for it, or waiting until I feel qualified for such a position.

Then again, it could just be imposter syndrome popping up :whitewater:

spiritual bypass
Feb 19, 2008

Grimey Drawer
Go for it! The worst likely case is that you don't get an offer and the people you interviewed with completely forget you.

Che Delilas
Nov 23, 2009
FREE TIBET WEED

kloa posted:

Does it hurt to interview for a position if you don't feel qualified? I don't want to apply, get laughed out the door, and it hurt any future prospects with them. Them being Amazon, even though I hear occasional horror stories, I'd like to keep my chances open if possible.

I can't tell if I received one of those generic recruiter emails they blast out, but a recruiter at Amazon reached out to me today. So now I'm debating on actually applying for it, or waiting until I feel qualified for such a position.

Then again, it could just be imposter syndrome popping up :whitewater:

I'll go so far as to say you should ONLY interview for positions you don't feel qualified for. If you feel completely qualified, chances are you're way overqualified.

And yeah, you don't get only one shot. Many companies have a minimum waiting period (like 6 months to a year, typically), but that's it.

Adbot
ADBOT LOVES YOU

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

kloa posted:

Does it hurt to interview for a position if you don't feel qualified? I don't want to apply, get laughed out the door, and it hurt any future prospects with them. Them being Amazon, even though I hear occasional horror stories, I'd like to keep my chances open if possible.

I can't tell if I received one of those generic recruiter emails they blast out, but a recruiter at Amazon reached out to me today. So now I'm debating on actually applying for it, or waiting until I feel qualified for such a position.

Then again, it could just be imposter syndrome popping up :whitewater:

Just go for it. You have to screw up incredibly badly in non-technical ways to be put on an orgs list of people to never consider for candidacy in the future.

The literal worst thing that happens is they turn you down and don't send you another email in 10 months.

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