4 ms·
Its funny, I was just performing an evil whiteboard coding question. My question involves a sorting function and thus thinking of a problem one step at a time.
by jboy55 11y ago
Its funny, I was just performing an evil whiteboard coding question.
My question involves a sorting function and thus thinking of a problem one step at a time. Start with an inspection, then based on the element perform an action, then marking some bounds with pointers to spots within array.
Since you're doing this one item at a time, you're always just going to be incrementing or decrementing once.
Even if I do a
for a in range(15):
in python. Within that loop, I'm doing an action on one item. If I'm counting I'm most probably counting by 1.
We do things all the time in coding by looking at things one at a time, that's why increment and decrement by 1 is so useful to me.
In this case, the candidate couldn't not understand how to increment a "pointer" by one and wanted to solve it with a list. They still figured it out, but it got me thinking of this and maybe we're moving away from really thinking of things one step at a time. To me, its a very useful skill, and the reason I ask the question.