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
Beve Stuscemi
Jun 6, 2001




yeah, same.

also applied to a job that requested I like them on LinkedIn when applying

Adbot
ADBOT LOVES YOU

4lokos basilisk
Jul 17, 2008


i did not receive the promised take home before my onsite on monday. i hope they aren't trying to pull a "we sent you the exercise only 3h before because we wanted to be sure you do it in the allotted time" because guess what fuckers i have a day job

comedy option is that they send it to me over the weekend? i guess that's only half a red flag

motedek
Oct 9, 2012
i got a takehome this past monday for an onsite two days later. at least it kept me from wasting more time on it. also the sharepoint link to the dataset didn't work and they didn't respond to my email about it, so i used the data from the kaggle question they had copy-pasted from.

Sapozhnik
Jan 2, 2005

Nap Ghost

PIZZA.BAT posted:

lol this just happened to me too with the company i reached out to a few days ago

good to know we've found the hot new trend

Sounds like they're skipping the hiring and subsequent firing step of "promoted to customer"

Crit Unit A
Dec 29, 2018

by Nyc_Tattoo
.

Crit Unit A fucked around with this message at 14:16 on Dec 21, 2019

PIZZA.BAT
Nov 12, 2016


:cheers:


Crit Unit A posted:

cons: i just started my current job. if the interview goes well, i'd still be working with the people on my current team, but from the other side of the supporter/supported relationship. there might be some tension because my team has been told not to hire more new people yet the manager still feels that we're understaffed and is actively trying to circumvent the hiring limits. if the interview goes poorly, the same situation, and as well the manager might start looking at other people when it's time to give out raises under the assumption that i'm looking to leave anyway.

what should i do, strangers?

if this is an internal transfer this is not your concern whatsoever

fourwood
Sep 9, 2001

Damn I'll bring them to their knees.

Crit Unit A posted:

what should i do, strangers?
tbh this reads as “should i pursue the career i want or should i not try to make things awkward”

Crit Unit A
Dec 29, 2018

by Nyc_Tattoo
fair advice

4lokos basilisk
Jul 17, 2008


nice

turns out that the guy responsible for my interview process got sick (last thursday),
which means nobody sent out the take home,
which means there would have been nothing to talk about during today's scheduled onsite,
which means we rescheduled for next week, tentatively

but me being professional i had taken out pto for today afternoon (which i managed to cancel in time, luckily)
there is still no e-mail from the company, only a verbal agreement with the recruiter

actually i am feeling like this is a mess.. i am not sure if to treat this as "regular french company disorganization" (not meant in a bad way - different countries have different ideas of work culture and communication), or this is a clusterfuck that i have no interest in

feeling like the latter

CPColin
Sep 9, 2003

Big ol' smile.
It's a life goal of mine to cut short an interview process because of something easily avoidable like that, so my vote is to tell them to forget it.

LanceHunter
Nov 12, 2016

Beautiful People Club


Had a good phone screen last week for a junior spot at a big (old) tech firm. It was very basic, do fizzbuzz then containerize it and deploy it on a k8 cluster. The interviewer seemed pretty happy and even said he was looking forward to bringing me on board. But I haven’t heard anything back since then. He said that next steps would be their HR following up, and I’m wondering how long I should expect that process to take. The recruiter mentioned there would be at least one on-site so I know there’s still plenty of process to go. I’m just trying to keep myself from getting anxious that the holidays will cause things to get lost in the shuffle.

Kuvo
Oct 27, 2008

Blame it on the misfortune of your bark!
Fun Shoe

Penisface posted:

nice

turns out that the guy responsible for my interview process got sick (last thursday),
which means nobody sent out the take home,
which means there would have been nothing to talk about during today's scheduled onsite,
which means we rescheduled for next week, tentatively

but me being professional i had taken out pto for today afternoon (which i managed to cancel in time, luckily)
there is still no e-mail from the company, only a verbal agreement with the recruiter

actually i am feeling like this is a mess.. i am not sure if to treat this as "regular french company disorganization" (not meant in a bad way - different countries have different ideas of work culture and communication), or this is a clusterfuck that i have no interest in

feeling like the latter

i just turned down an offer from a company cus they somehow stretched the interview process over close to 4 weeks by constantly rescheduling poo poo. the onsite interview was a clusterfuck of the lead interviewer trying to ask me questions and also typing to his coworkers on slack to try to get them scheduled to show up to meet me. i got a gut feeling the whole company was like that so i said nope

graph
Nov 22, 2006

aaag peanuts
https://twitter.com/clhubes/status/1198986703026962434

aaaaaaaaaaaaaaaaaaa

raminasi
Jan 25, 2005

a last drink with no ice

LanceHunter posted:

Had a good phone screen last week for a junior spot at a big (old) tech firm. It was very basic, do fizzbuzz then containerize it and deploy it on a k8 cluster. The interviewer seemed pretty happy and even said he was looking forward to bringing me on board. But I haven’t heard anything back since then. He said that next steps would be their HR following up, and I’m wondering how long I should expect that process to take. The recruiter mentioned there would be at least one on-site so I know there’s still plenty of process to go. I’m just trying to keep myself from getting anxious that the holidays will cause things to get lost in the shuffle.

you can very reasonably send followup communication asking what their status is after one week if there’s no holiday interruption and two if there is

Scionix
Oct 17, 2009

hoog emm xDDD
google interview update: they asked a question that relied on recursion, I dropped my spaghetti everywhere, embarrassed myself.

thank u for listening

MononcQc
May 29, 2007

the trick with recursion is to cheat: tail-recursive functions are like better-structured while loops. Think of the while loop first and you can turn your loop into a recursive function.

There are two critical ingredients to identify first:
- a stopping condition
- an update to the iteration

so if you were to go

code:
a = 5
b = 10
x = 0
while (x < 10) {
    a = a + (b*x)
    x = x+1
}
return a
Your stopping condition is x < 0, and your update to the iteration is x = x+1. You need both to know that your loop eventually terminates, or that your recursive function eventually returns.

Once you've identified these, the rest is just filling in the blanks:

code:
f(x, ...) {
    if (x < 10) { // stopping condition
        ...       // put the loop body here
        return f(x + 1, ...) // this is your loop increment
    } else {
        return ...  // final value to return
    }
}
the iteration is called recursively (f(x + 1)), and the stopping condition is present in the if. Now we gotta extract the values for a and b to be initialized, put the body (a = a + (b*x)) in there, and return the same value you initially did:

code:
f(x, a, b) {
    if (x < 10) {
        return f(x + 1, a + (b*x), b)
    } else {
        return a
    }
}
...
f(0, 5, 10) // f(x, a, b) being initialized!
Do this a few times and you'll find that recursion is a lot simpler after that.

Scionix
Oct 17, 2009

hoog emm xDDD
Ty for the help

I generally do OK with recursion, but I have to go a little slow and step through it in a way that wasn't really possible within the format of the interview. It's hard for me to keep track in my head fast enough to solve what they wanted me to solve. I didn't completely flail around but I also didn't get the whole desired output.

On the plus side, I got my first decent offer from a startup, so I have a backup :downsgun:

jesus WEP
Oct 17, 2004


MononcQc posted:

the trick with recursion is to cheat:.
extremely blessed post, tyvm

Xarn
Jun 26, 2015

MononcQc posted:

the trick with recursion is to cheat:

This seems backwards, unless the interviewer is like "yeah, I know you can solve it better, but this sheet of paper tells me I have to force you to write recursive function", in which case I suggest running anyway.

The reason to reach for recursion is that writing the while loop would be complex, and you want to simplify things so you can reason about them.

I suggest thinking about it the other way around:

1) When do you know the answer to a problem?

Let's say you are writing a stupid (no balancing) binary search tree, and you are currently coding up the search step:

C++ code:
struct node { 
    node* lhs, rhs;
    int value;
};

bool contains(node* current, int val) {
    // ?
}
The simplest case is that the current node is the one that has the value:

C++ code:
bool contains(node* current, int val) {
    if (current->value == val) {
        return true;
    }
    
    // ?
}
Now, what if this node does not contain the value? Well, that gets you to the second question:

2) What do I need to do to move towards 1)?

If the current node does not contain the value, we have to move towards leafs. For BST the rule is simple, larger values are to the right, smaller values are to the left:

C++ code:
bool contains(node* current, int val) {
    if (current->value == val) {
        return true;
    }
    
    if (val < current->value) {
        return contains(current->lhs, val);
    }
    if (val > current->value) {
        return contains(current->rhs, val);
    }
    // ?
}
Now we move down the tree, so if the value is there, we will find it.

What if it isn't there? In that case, we recurse on a nullptr, which is another stopping value we get as an implementation detail*:

C++ code:
bool contains(node* current, int val) {
    if (!current) {
        return false;
    }
    if (current->value == val) {
        return true;
    }
    
    if (val < current->value) {
        return contains(current->lhs, val);
    }
    if (val > current->value) {
        return contains(current->rhs, val);
    }
}
Now, without too much effort, we have a recursive implementation of searching for a value in a BST. It also happens to be tail-recursive, which will make the step of turning this into an iterative loop much easier (in fact, good compiler will already do it for you). Our two stopping conditions are easy to turn into a while loop:

C++ code:
bool contains(node* root, int val) {
    auto current = root;
    while (current) {
        if (current->value == val) {
            return true;
        }
        //?
    }
}
And the code that moves us forward to solution is the same in the while loop as in the recursive code:

C++ code:
bool contains(node* root, int val) {
    auto current = root;
    while (current) {
        if (current->value == val) {
            return true;
        }
        if (val < current->value) {
            current = current->lhs;
        } else {
            current = current->rhs;
        }
    }
    // you get here if you reach past a leaf without finding the value
    return false; 
}
-----------------

TLDR: I think recursion should be used to make reasoning out the variants and invariants of your code less painful, and converting existing iterative code to it is mostly pointless.

------------------

* We could just check before recursion, but that would make the function much uglier, at only a marginal gain.

Xarn
Jun 26, 2015
Oh, this isn't the terrible programmers thread.

Well, I am going to post this beauty anyway :v:
C++ code:
void add(node*& root, int value) {
    auto position = &root;
    while (*position != nullptr) {
        if (value < (*position)->value) {
            position = &(*position)->left;
        } else if (value > (*position)->value) {
            position = &(*position)->right;
        } else {
            return;
        }
    }
    *position = new node{ nullptr, nullptr, value };
}

MononcQc
May 29, 2007

I don’t know what to tell you, that’s how I teach recursion to people who use functional programming for the first time, in languages that don’t have loops.

sure there’s body recursion, but the only difference with tail recursion is that in body recursion you use the language’s call stack instead of an explicit stack of elements yet-to-process. If you want to do level-order traversal in a tree for example, you need to start using an explicit accumulator (a queue) for unvisited noses, and ditch body recursion, for example. So sure you want to use body recursion when you can because it tends to be clean, but tail recursion as a whole is more general.

A lot of people have a bit of a mental block around recursion and over the years I’ve found it extremely effective to show “look, it’s just like a while loop, you just structure the same elements differently”, get them to practice it a while, and within a couple of days the mental block is gone.

Arcteryx Anarchist
Sep 15, 2007

Fun Shoe
idk I find the loop form of recursion can make it seem deceptively simple to beginners who won’t realize that the real tricks are more in the search and generative problems you might run into a la merge sort, power sets, edit distance, anything to do with a tree, etc

Xarn
Jun 26, 2015

MononcQc posted:

in languages that don’t have loops.

That's fair, I don't really use those if I can help it.

MononcQc
May 29, 2007

lancemantis posted:

idk I find the loop form of recursion can make it seem deceptively simple to beginners who won’t realize that the real tricks are more in the search and generative problems you might run into a la merge sort, power sets, edit distance, anything to do with a tree, etc

I guess so, I'm just used to seeing the opposite: because recursion is often used for "the real tricks", people are even afraid of basic recursion that's really quite straightforward. l like to distinguish between the mechanism (recursion or looping) and the actual challenging part (search, using the right algorithm). There's no reason to always tackle them as one thing. I tend to show things in this order:

- count down to 0 with recursion
- count up to a given number with recursion
- traverse a list with recursion
- create a list with recursion (and this is a good place to show the difference between tail and body recursion)
- traverse a tree with recursion (find an element)
- update a tree with recursion
- show traversal strategies (in-order, pre-order, post-order) as being reorderings of recursive calls vs. the current node's value being operated upon (Left-Current-Right, Current-Left-Right, Left-Right-Current)
- show level-order traversal as one case where you have to maintain a queue (i.e. body recursion can't be enough, and not just for performance reasons)

Once you've gone through all of this you should feel pretty drat at home with any form of recursion. Maybe mutual recursion could feel a bit odd? Trickier cases will probably be those that would be tricky regardless of iteration method chosen (i.e. traversal of cyclic graphs, since you don't necessarily have super clear end conditions). You don't need to know all of these (in workshops I gave, I often stopped at "updating a tree"), but I found that showing the conversion of a while loop to a recursive call removes a lot of blockers about the inherent complexity of recursion and they are then free to more easily learn on their own.

silvergoose
Mar 18, 2006

IT IS SAID THE TEARS OF THE BWEENIX CAN HEAL ALL WOUNDS




everyone ready to solve Advent of Code problems with recursion, then?

iospace
Jan 19, 2038


silvergoose posted:

everyone ready to solve Advent of Code problems with recursion, then?

What is this, a Haskell course?

PIZZA.BAT
Nov 12, 2016


:cheers:


first call with competitor-company today. let's get this bread

MononcQc
May 29, 2007

silvergoose posted:

everyone ready to solve Advent of Code problems with recursion, then?

I did those from a couple of years ago and the worse is immutability since they all seem to assume mutable matrices for maps

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

PIZZA.BAT posted:

first call with competitor-company today. let's get this bread

bread.get()

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER

Captain Foo posted:

bread.get()

(take 1 (get-bread))

because you see get-bread is actually an infinite lazy sequence of bread

Shaggar
Apr 26, 2006
BreadFactory.Bake();

akadajet
Sep 14, 2003

Shaggar posted:

BreadFactory.Bake();

AbstractBreadFactory.GetBread().Bake()

Scionix
Oct 17, 2009

hoog emm xDDD
If yall are curious, the question was:

We have K 'wires' to distribute N amount of 'bandwidth'. Return all the possible combinations of bandwidth over the wires and print it out to the console. K and N must be positive integers.

So distribute(2(k), 4(n)) would print:

0, 4
1, 3
2, 2
3, 1
4, 0

So I tried to something like

code:

Int distribute (int K, int N)
{
    If(K == 1)
        return N
    Else
        For(int i = 0, i <= N, i++)
             distribute((k - 1), (n - i))
}

But I got stuck on the "print the output" issue. I'm actually not sure if that recursion is even right, I havent had a chance to sit down and try it in an IDE.

silvergoose
Mar 18, 2006

IT IS SAID THE TEARS OF THE BWEENIX CAN HEAL ALL WOUNDS




iospace posted:

What is this, a Haskell course?

I can't get if you're serious? If you are, it's just a series of programming puzzles the first few weeks of December with some tiny plot for kicks.

PIZZA.BAT
Nov 12, 2016


:cheers:


welp the call went very well imo. not only are they ok with hiring an east-coast guy but they apparently already have several others here. they're also totally fine with the fact that i've been in consulting my entire career and would be 'hopping the fence' over to the sales sides of things. :toot:

i may be ascending to the land of milk & figgies in sales, friends

4lokos basilisk
Jul 17, 2008


Kuvo posted:

i just turned down an offer from a company cus they somehow stretched the interview process over close to 4 weeks by constantly rescheduling poo poo. the onsite interview was a clusterfuck of the lead interviewer trying to ask me questions and also typing to his coworkers on slack to try to get them scheduled to show up to meet me. i got a gut feeling the whole company was like that so i said nope

i wanted to know what their offer would be before turning it down, but now it's actually looking like getting through the process itself will be too much hassle

i mean it's full 2 days later since the last contact and i still do not have any e-mail from either the company or the recruiter

Acer Pilot
Feb 17, 2007
put the 'the' in therapist

:dukedog:

I did horribly on a leetcode easy question at an onsite after being able to complete a medium. Pretty sure I tanked that. Ugh. Of course I immediately think of how to solve it after I leave. RIP

PIZZA.BAT
Nov 12, 2016


:cheers:


this page is reminding me why i wanted to switch over to sales in the first place

so i don't have to deal with this bullshit anymore

4lokos basilisk
Jul 17, 2008


PIZZA.BAT posted:

this page is reminding me why i wanted to switch over to sales in the first place

so i don't have to deal with this bullshit anymore

lol if you think there will not be a different, nastier kind of bullshit that you never expected!

(wish you good luck and that everything goes well)

Adbot
ADBOT LOVES YOU

4lokos basilisk
Jul 17, 2008


i received a message on linkedin from a microsoft internal recruiter. my first impression was "holy poo poo i have made it to another level now", but how is it actually? should i be excited or is it more likely that they are just spamming messages and might not even get back in touch?

deffo will take their call and talk to them, hope they don't ghost me

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