r/ProgrammerHumor • • Nov 30 '19

C++ Cheater

Post image
79.3k Upvotes

1.0k comments sorted by

View all comments

Show parent comments

5.4k

u/[deleted] Nov 30 '19

it's not cheating.
it's open source documentation

1.0k

u/AlmostButNotQuit Nov 30 '19

Adding this to my lexicon

0

u/[deleted] Nov 30 '19

[deleted]

375

u/SaikonBr Nov 30 '19

My interview they gave me 2 pages of some code and asked me to describe what the script was doing. I thougth it was pretty fair.

244

u/Elias_The_Thief Nov 30 '19

I like that better. After all a lot of my job is going into existing code bases and making changes. Being able to quickly assess what a piece of code is doing is a lot more useful than being able to implement arbitrary sorting algorithms without googling

63

u/Kid_Adult Nov 30 '19

This is it. Even if the code base is your own, being able to quickly re-familiarize yourself with it is handy if it's been long enough that you've forgotten exactly how it works.

9

u/Holzkohlen Nov 30 '19

That is why we all heavily comment our code, right guys?

11

u/DrakonIL Nov 30 '19

Pfft. Comments are for future me. Fuck future me, he's an asshole.

→ More replies (2)

6

u/Kid_Adult Nov 30 '19

Why we what?

0

u/[deleted] Nov 30 '19

[deleted]

0

u/[deleted] Nov 30 '19

[deleted]

→ More replies (1)
→ More replies (3)

49

u/Anonymus_MG Nov 30 '19

Maybe instead of asking them to write code, ask them to give a detailed description of how they would try to write code.

0

u/[deleted] Nov 30 '19

[deleted]

27

u/SquirrelicideScience Nov 30 '19

Question from a non-CS/Computer-centric major: I’ve been writing code for my work, but I’m vastly uninformed on algorithms. For most problems that I deal with, I’m doing a lot of brute force data analysis. In other words, I take a data set, and one by one go through each file, search for a keyword in the header and by checking each row, grabbing the data, so on and so forth.

In other words, lots of for loops and if statements. Are there algorithms I could research more about, or general coding techniques (I don’t work in C/C++)?

28

u/InkTide Nov 30 '19

Most of the ways to avoid 'brute force' searching involve sorting the data beforehand, which can itself be pretty intensive in terms of computational power. This is a great resource for understanding common sorting algorithms.

→ More replies (12)

10

u/Demakufu Nov 30 '19

Also not a CS major but self-taught dev currently trying to fill in the gaps Algos and Data structures. You can pick up a copy of Kevin Sedgewick's Algorithms and Data Structures. It is done in Java (in which Sedgewick is an expert with his books used to tutor the Princeton CS program) but the concepts are readily applicable in most other programming languages. There are also alternative books for other languages, but IMO Sedgewick's is the best.

→ More replies (1)
→ More replies (7)

31

u/SloanTheSloth Nov 30 '19

Ugh. This is my biggest fear about getting into the industry. I'm currently in a master's degree for video game programming.

To get a job at any company there's such an interview process for programmers. First the written test they email you, then a phone interview, then an in person coding interview test. It's possible one of those may be a group interview so then there would be another one-on-one interview.

I code well. I make games. But put me in front of a whiteboard and ask me to write you some code I'm going to freeze. The worst is math. How the hell do you expect me to remember trigonometry and calc formulas. I can Google the formulas and do the math if I have them, but remembering them, on top of everything else, is just such a bitch.

Luckily my master's program helps us out and we get chances to practice this, but the whole interview process is the #1 thing that keeps my mind telling me I'm not good enough for this.

28

u/Romestus Nov 30 '19

I had a technical interview with Google after multiple rounds of interviews and they gave me a problem I had already solved before. I couldn't think straight enough to write code since the interviewer did it in the cafeteria during lunch.

I thought that was a test and I failed but it turns out my interviewer was just super unprofessional.

17

u/[deleted] Nov 30 '19

Wait during lunch? I work at a software company (not as big as Google, but we compete with them for devs) anf the lunch interview is designed to be informal. A conversation to make sure there aren't any red flags. They technical questions are for the 1:1 interviews

→ More replies (1)

11

u/superluminary Nov 30 '19

Practice describing things to yourself. Maybe practice drawing algorithms. If you forget a formula or function name, ask the interviewer. That’s normal and shows good collaboration skills.

Have fun. If you’re a good cider, you have options.

→ More replies (1)

5

u/Turbulent-Magician Nov 30 '19

Isn't game development heavily focused on math? I know from my limited experience, you needed a solid foundation in mathematics especially when dealing with physics engines. That being said, I think that's different from your standard programming white board interview.

White board interviews aren't supposed to be hard unless the job is about solving complicated problems. They're more to understand your personality as a programmer. Are you somebody who likes to over optimize both execution and space? Or are you somebody that makes their code as readable as possible at the expense of execution and space optimization? Do you explain your thought process while you're solving problems or do you stay silent? How well do you know the intricacies of the language and framework you are writing in? So many things are revealed during a white board interview. It's not about solving the problem, but getting to know you.

I'm sure you've heard of fizz buzz. There's many ways to solve it. It's your job as an interviewee to solve it the way they would like it. For example, if you're interviewing for Google, you might want to go with the over optimization route since they deal with large scale applications.

→ More replies (1)
→ More replies (4)

7

u/superluminary Nov 30 '19

I do think someone should be able to write a bit of basic code without googling the answer. Forgetting a function name is normal, but I’ve known coders who don’t know how to assign to a variable or iterate over an array.

6

u/raltyinferno Nov 30 '19

I'll be honest, if I haven't used a particular language in a while I'll often forget the sybtax for doing really basic stuff. I can describe exactly what I want to do, but I forget exactly how. Only takes me a few seconds of Googling to remind myself generally.

Ive had to Google how to format a range based for loop(for each) in various languages tons of time.

→ More replies (1)
→ More replies (6)
→ More replies (5)

0

u/[deleted] Nov 30 '19

[deleted]

→ More replies (6)
→ More replies (10)