Is “what is your definition of clean code†an appropriate interview question? [closed]
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I recently was interviewed by a software company for a software development position. I was asked the following question: "what is your definition of clean code?". I answered the question with what I would really like about a code. However, it doesn't seem there is a correct answer to this question since this is very subjective. So:
1- Was this question an appropriate interview question?
2- Is this a common question? If so, what would a bad answer to it would look like?
interviewing job-search
closed as primarily opinion-based by gnat, scaaahu, Vietnhi Phuvan, Masked Man♦, Garrison Neely Jul 20 '15 at 14:16
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
 |Â
show 2 more comments
up vote
1
down vote
favorite
I recently was interviewed by a software company for a software development position. I was asked the following question: "what is your definition of clean code?". I answered the question with what I would really like about a code. However, it doesn't seem there is a correct answer to this question since this is very subjective. So:
1- Was this question an appropriate interview question?
2- Is this a common question? If so, what would a bad answer to it would look like?
interviewing job-search
closed as primarily opinion-based by gnat, scaaahu, Vietnhi Phuvan, Masked Man♦, Garrison Neely Jul 20 '15 at 14:16
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
2
If you wrote "I write clean code" (or something to that effect), they probably just wanted to know what you meant. I've never had this question appear during an interview (I'm not in HR or management/part of the interviewer processes - just an interviewee)
– hd.
Jul 20 '15 at 8:30
possible duplicate of How appropriate is the interview question: "Show me a piece of code you like"?
– gnat
Jul 20 '15 at 8:51
see also: Copying questions that had a misfortune of being widely exposed in the hot list
– gnat
Jul 20 '15 at 8:51
1
You didn't specify what is it about code you like. I am not answering your question and I am voting to close it as too vague. The fact is, your prospective wants to make sure that you have a good idea what clean code is and their question is legitimate. If you take issue with that question, your attitude is your problem. If you don't get the question, it's still your problem. If you don't understand something, you follow up for clarifications with the person who asked the question.
– Vietnhi Phuvan
Jul 20 '15 at 10:06
1
Ask if they're referencing the very popular book, "Clean Code"
– user8365
Jul 20 '15 at 15:24
 |Â
show 2 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I recently was interviewed by a software company for a software development position. I was asked the following question: "what is your definition of clean code?". I answered the question with what I would really like about a code. However, it doesn't seem there is a correct answer to this question since this is very subjective. So:
1- Was this question an appropriate interview question?
2- Is this a common question? If so, what would a bad answer to it would look like?
interviewing job-search
I recently was interviewed by a software company for a software development position. I was asked the following question: "what is your definition of clean code?". I answered the question with what I would really like about a code. However, it doesn't seem there is a correct answer to this question since this is very subjective. So:
1- Was this question an appropriate interview question?
2- Is this a common question? If so, what would a bad answer to it would look like?
interviewing job-search
asked Jul 20 '15 at 8:27
adfadf
112
112
closed as primarily opinion-based by gnat, scaaahu, Vietnhi Phuvan, Masked Man♦, Garrison Neely Jul 20 '15 at 14:16
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as primarily opinion-based by gnat, scaaahu, Vietnhi Phuvan, Masked Man♦, Garrison Neely Jul 20 '15 at 14:16
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
2
If you wrote "I write clean code" (or something to that effect), they probably just wanted to know what you meant. I've never had this question appear during an interview (I'm not in HR or management/part of the interviewer processes - just an interviewee)
– hd.
Jul 20 '15 at 8:30
possible duplicate of How appropriate is the interview question: "Show me a piece of code you like"?
– gnat
Jul 20 '15 at 8:51
see also: Copying questions that had a misfortune of being widely exposed in the hot list
– gnat
Jul 20 '15 at 8:51
1
You didn't specify what is it about code you like. I am not answering your question and I am voting to close it as too vague. The fact is, your prospective wants to make sure that you have a good idea what clean code is and their question is legitimate. If you take issue with that question, your attitude is your problem. If you don't get the question, it's still your problem. If you don't understand something, you follow up for clarifications with the person who asked the question.
– Vietnhi Phuvan
Jul 20 '15 at 10:06
1
Ask if they're referencing the very popular book, "Clean Code"
– user8365
Jul 20 '15 at 15:24
 |Â
show 2 more comments
2
If you wrote "I write clean code" (or something to that effect), they probably just wanted to know what you meant. I've never had this question appear during an interview (I'm not in HR or management/part of the interviewer processes - just an interviewee)
– hd.
Jul 20 '15 at 8:30
possible duplicate of How appropriate is the interview question: "Show me a piece of code you like"?
– gnat
Jul 20 '15 at 8:51
see also: Copying questions that had a misfortune of being widely exposed in the hot list
– gnat
Jul 20 '15 at 8:51
1
You didn't specify what is it about code you like. I am not answering your question and I am voting to close it as too vague. The fact is, your prospective wants to make sure that you have a good idea what clean code is and their question is legitimate. If you take issue with that question, your attitude is your problem. If you don't get the question, it's still your problem. If you don't understand something, you follow up for clarifications with the person who asked the question.
– Vietnhi Phuvan
Jul 20 '15 at 10:06
1
Ask if they're referencing the very popular book, "Clean Code"
– user8365
Jul 20 '15 at 15:24
2
2
If you wrote "I write clean code" (or something to that effect), they probably just wanted to know what you meant. I've never had this question appear during an interview (I'm not in HR or management/part of the interviewer processes - just an interviewee)
– hd.
Jul 20 '15 at 8:30
If you wrote "I write clean code" (or something to that effect), they probably just wanted to know what you meant. I've never had this question appear during an interview (I'm not in HR or management/part of the interviewer processes - just an interviewee)
– hd.
Jul 20 '15 at 8:30
possible duplicate of How appropriate is the interview question: "Show me a piece of code you like"?
– gnat
Jul 20 '15 at 8:51
possible duplicate of How appropriate is the interview question: "Show me a piece of code you like"?
– gnat
Jul 20 '15 at 8:51
see also: Copying questions that had a misfortune of being widely exposed in the hot list
– gnat
Jul 20 '15 at 8:51
see also: Copying questions that had a misfortune of being widely exposed in the hot list
– gnat
Jul 20 '15 at 8:51
1
1
You didn't specify what is it about code you like. I am not answering your question and I am voting to close it as too vague. The fact is, your prospective wants to make sure that you have a good idea what clean code is and their question is legitimate. If you take issue with that question, your attitude is your problem. If you don't get the question, it's still your problem. If you don't understand something, you follow up for clarifications with the person who asked the question.
– Vietnhi Phuvan
Jul 20 '15 at 10:06
You didn't specify what is it about code you like. I am not answering your question and I am voting to close it as too vague. The fact is, your prospective wants to make sure that you have a good idea what clean code is and their question is legitimate. If you take issue with that question, your attitude is your problem. If you don't get the question, it's still your problem. If you don't understand something, you follow up for clarifications with the person who asked the question.
– Vietnhi Phuvan
Jul 20 '15 at 10:06
1
1
Ask if they're referencing the very popular book, "Clean Code"
– user8365
Jul 20 '15 at 15:24
Ask if they're referencing the very popular book, "Clean Code"
– user8365
Jul 20 '15 at 15:24
 |Â
show 2 more comments
2 Answers
2
active
oldest
votes
up vote
8
down vote
Was this question an appropriate interview question?
"Appropriate" in the context of interviewing, is extremely subjective.
At its core, if the hiring company feels that the question helps them to separate the potentially good employees from all others, then it's "appropriate".
Interviewers toss all sorts of odd questions at applicants. Some seem to be extremely relevant ("We are moving to Technology X and you have experience. Tell me how you might approach rewriting an application that's currently in Technology B?"") others seems wildly irrelevant ("How would you go about finding a needle in a haystack?")
Interviewers can justify for themselves asking almost any question. Often you hear reasoning like "I want to understand how a candidate thinks." Or "I want to see how creative the candidate is." Or "I need to see how they react under pressure."
But many interviewers aren't very good at coming up with effective questions, and ask what they think is clever, what they have read on a website, or what they have been asked in the past. A Senior VP at Google admitted that brainteaser questions are a big waste of time, that they don’t predict anything, but serve mainly to make the interviewer feel smart. (see: http://www.nytimes.com/2013/06/20/business/in-head-hunting-big-data-may-not-be-such-a-big-deal.html)
So as a candidate, we need to try and just go with the flow and accept interview questions for what they often are - an awkward attempt to see if you are capable of handling the position, want to join the company, and would fit in.
While questions might not be effective, whatever the interviewer wants to ask is appropriate (assuming they don't run afoul of local laws).
So "What is your definition of clean code?" is appropriate, even if it may not actually be effective. Once you get the job and learn more about the company's hiring and interviewing practices, you might learn if this particular question is effective in separating the good candidates from the poor candidates, or if it just considered clever by this individual interviewer.
suggest improvements |Â
up vote
4
down vote
1- Was this question an appropriate interview question?
If you're applying for a developing job, then it is pretty appropriate. Not only because it may be a requirement because you work with others, but also it may be a requirement when you leave to also leave a good code base.
Indeed, it could be pretty subjective. To me, it's just to sound you out, to have an idea of what you consider clean code (and thus, the way you might code). However, it may not go the way the interviewer wants:
I once had a colleague whose idea of clean code was "code that can be read fast". Time proved that by "read fast", he meant "written fast", as in "variables with one character names, loops and conditionals without brackets, big utils
files with tons of global variables and functions out of scope".
To me, clean code means the other way around. Self-explanatory variables and methods names, following a standard coding style, trying to split methods in meaningful classes, documenting all the classes, methods and variables so that you can extract a documentation, and also documenting example code on specially important methods.
2- Is this a common question? If so, what would a bad answer to it would look like?
I've been asked directly once, indirectly twice. The indirect ones went pretty well. They were something like:
- What do you want to see in others' code? (as "I expect you do the same")
- Do you enjoy coding? (as "you do fine code pieces")
In both cases, I showed some code (unrelated to previous jobs), and they were glad.
The one that went direct was a little less couraging. After I explained that I did all that, her response was something like:
So, you take more time writing than thinking?
They didn't hire me, luckily!
The rule of thumb: Be honest. If you are a developer, tell the way you do. They might like it or not, but you won't have a surprise afterwards, if you're honest.
suggest improvements |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
8
down vote
Was this question an appropriate interview question?
"Appropriate" in the context of interviewing, is extremely subjective.
At its core, if the hiring company feels that the question helps them to separate the potentially good employees from all others, then it's "appropriate".
Interviewers toss all sorts of odd questions at applicants. Some seem to be extremely relevant ("We are moving to Technology X and you have experience. Tell me how you might approach rewriting an application that's currently in Technology B?"") others seems wildly irrelevant ("How would you go about finding a needle in a haystack?")
Interviewers can justify for themselves asking almost any question. Often you hear reasoning like "I want to understand how a candidate thinks." Or "I want to see how creative the candidate is." Or "I need to see how they react under pressure."
But many interviewers aren't very good at coming up with effective questions, and ask what they think is clever, what they have read on a website, or what they have been asked in the past. A Senior VP at Google admitted that brainteaser questions are a big waste of time, that they don’t predict anything, but serve mainly to make the interviewer feel smart. (see: http://www.nytimes.com/2013/06/20/business/in-head-hunting-big-data-may-not-be-such-a-big-deal.html)
So as a candidate, we need to try and just go with the flow and accept interview questions for what they often are - an awkward attempt to see if you are capable of handling the position, want to join the company, and would fit in.
While questions might not be effective, whatever the interviewer wants to ask is appropriate (assuming they don't run afoul of local laws).
So "What is your definition of clean code?" is appropriate, even if it may not actually be effective. Once you get the job and learn more about the company's hiring and interviewing practices, you might learn if this particular question is effective in separating the good candidates from the poor candidates, or if it just considered clever by this individual interviewer.
suggest improvements |Â
up vote
8
down vote
Was this question an appropriate interview question?
"Appropriate" in the context of interviewing, is extremely subjective.
At its core, if the hiring company feels that the question helps them to separate the potentially good employees from all others, then it's "appropriate".
Interviewers toss all sorts of odd questions at applicants. Some seem to be extremely relevant ("We are moving to Technology X and you have experience. Tell me how you might approach rewriting an application that's currently in Technology B?"") others seems wildly irrelevant ("How would you go about finding a needle in a haystack?")
Interviewers can justify for themselves asking almost any question. Often you hear reasoning like "I want to understand how a candidate thinks." Or "I want to see how creative the candidate is." Or "I need to see how they react under pressure."
But many interviewers aren't very good at coming up with effective questions, and ask what they think is clever, what they have read on a website, or what they have been asked in the past. A Senior VP at Google admitted that brainteaser questions are a big waste of time, that they don’t predict anything, but serve mainly to make the interviewer feel smart. (see: http://www.nytimes.com/2013/06/20/business/in-head-hunting-big-data-may-not-be-such-a-big-deal.html)
So as a candidate, we need to try and just go with the flow and accept interview questions for what they often are - an awkward attempt to see if you are capable of handling the position, want to join the company, and would fit in.
While questions might not be effective, whatever the interviewer wants to ask is appropriate (assuming they don't run afoul of local laws).
So "What is your definition of clean code?" is appropriate, even if it may not actually be effective. Once you get the job and learn more about the company's hiring and interviewing practices, you might learn if this particular question is effective in separating the good candidates from the poor candidates, or if it just considered clever by this individual interviewer.
suggest improvements |Â
up vote
8
down vote
up vote
8
down vote
Was this question an appropriate interview question?
"Appropriate" in the context of interviewing, is extremely subjective.
At its core, if the hiring company feels that the question helps them to separate the potentially good employees from all others, then it's "appropriate".
Interviewers toss all sorts of odd questions at applicants. Some seem to be extremely relevant ("We are moving to Technology X and you have experience. Tell me how you might approach rewriting an application that's currently in Technology B?"") others seems wildly irrelevant ("How would you go about finding a needle in a haystack?")
Interviewers can justify for themselves asking almost any question. Often you hear reasoning like "I want to understand how a candidate thinks." Or "I want to see how creative the candidate is." Or "I need to see how they react under pressure."
But many interviewers aren't very good at coming up with effective questions, and ask what they think is clever, what they have read on a website, or what they have been asked in the past. A Senior VP at Google admitted that brainteaser questions are a big waste of time, that they don’t predict anything, but serve mainly to make the interviewer feel smart. (see: http://www.nytimes.com/2013/06/20/business/in-head-hunting-big-data-may-not-be-such-a-big-deal.html)
So as a candidate, we need to try and just go with the flow and accept interview questions for what they often are - an awkward attempt to see if you are capable of handling the position, want to join the company, and would fit in.
While questions might not be effective, whatever the interviewer wants to ask is appropriate (assuming they don't run afoul of local laws).
So "What is your definition of clean code?" is appropriate, even if it may not actually be effective. Once you get the job and learn more about the company's hiring and interviewing practices, you might learn if this particular question is effective in separating the good candidates from the poor candidates, or if it just considered clever by this individual interviewer.
Was this question an appropriate interview question?
"Appropriate" in the context of interviewing, is extremely subjective.
At its core, if the hiring company feels that the question helps them to separate the potentially good employees from all others, then it's "appropriate".
Interviewers toss all sorts of odd questions at applicants. Some seem to be extremely relevant ("We are moving to Technology X and you have experience. Tell me how you might approach rewriting an application that's currently in Technology B?"") others seems wildly irrelevant ("How would you go about finding a needle in a haystack?")
Interviewers can justify for themselves asking almost any question. Often you hear reasoning like "I want to understand how a candidate thinks." Or "I want to see how creative the candidate is." Or "I need to see how they react under pressure."
But many interviewers aren't very good at coming up with effective questions, and ask what they think is clever, what they have read on a website, or what they have been asked in the past. A Senior VP at Google admitted that brainteaser questions are a big waste of time, that they don’t predict anything, but serve mainly to make the interviewer feel smart. (see: http://www.nytimes.com/2013/06/20/business/in-head-hunting-big-data-may-not-be-such-a-big-deal.html)
So as a candidate, we need to try and just go with the flow and accept interview questions for what they often are - an awkward attempt to see if you are capable of handling the position, want to join the company, and would fit in.
While questions might not be effective, whatever the interviewer wants to ask is appropriate (assuming they don't run afoul of local laws).
So "What is your definition of clean code?" is appropriate, even if it may not actually be effective. Once you get the job and learn more about the company's hiring and interviewing practices, you might learn if this particular question is effective in separating the good candidates from the poor candidates, or if it just considered clever by this individual interviewer.
edited Jul 20 '15 at 19:38
answered Jul 20 '15 at 11:19


Joe Strazzere
223k106656922
223k106656922
suggest improvements |Â
suggest improvements |Â
up vote
4
down vote
1- Was this question an appropriate interview question?
If you're applying for a developing job, then it is pretty appropriate. Not only because it may be a requirement because you work with others, but also it may be a requirement when you leave to also leave a good code base.
Indeed, it could be pretty subjective. To me, it's just to sound you out, to have an idea of what you consider clean code (and thus, the way you might code). However, it may not go the way the interviewer wants:
I once had a colleague whose idea of clean code was "code that can be read fast". Time proved that by "read fast", he meant "written fast", as in "variables with one character names, loops and conditionals without brackets, big utils
files with tons of global variables and functions out of scope".
To me, clean code means the other way around. Self-explanatory variables and methods names, following a standard coding style, trying to split methods in meaningful classes, documenting all the classes, methods and variables so that you can extract a documentation, and also documenting example code on specially important methods.
2- Is this a common question? If so, what would a bad answer to it would look like?
I've been asked directly once, indirectly twice. The indirect ones went pretty well. They were something like:
- What do you want to see in others' code? (as "I expect you do the same")
- Do you enjoy coding? (as "you do fine code pieces")
In both cases, I showed some code (unrelated to previous jobs), and they were glad.
The one that went direct was a little less couraging. After I explained that I did all that, her response was something like:
So, you take more time writing than thinking?
They didn't hire me, luckily!
The rule of thumb: Be honest. If you are a developer, tell the way you do. They might like it or not, but you won't have a surprise afterwards, if you're honest.
suggest improvements |Â
up vote
4
down vote
1- Was this question an appropriate interview question?
If you're applying for a developing job, then it is pretty appropriate. Not only because it may be a requirement because you work with others, but also it may be a requirement when you leave to also leave a good code base.
Indeed, it could be pretty subjective. To me, it's just to sound you out, to have an idea of what you consider clean code (and thus, the way you might code). However, it may not go the way the interviewer wants:
I once had a colleague whose idea of clean code was "code that can be read fast". Time proved that by "read fast", he meant "written fast", as in "variables with one character names, loops and conditionals without brackets, big utils
files with tons of global variables and functions out of scope".
To me, clean code means the other way around. Self-explanatory variables and methods names, following a standard coding style, trying to split methods in meaningful classes, documenting all the classes, methods and variables so that you can extract a documentation, and also documenting example code on specially important methods.
2- Is this a common question? If so, what would a bad answer to it would look like?
I've been asked directly once, indirectly twice. The indirect ones went pretty well. They were something like:
- What do you want to see in others' code? (as "I expect you do the same")
- Do you enjoy coding? (as "you do fine code pieces")
In both cases, I showed some code (unrelated to previous jobs), and they were glad.
The one that went direct was a little less couraging. After I explained that I did all that, her response was something like:
So, you take more time writing than thinking?
They didn't hire me, luckily!
The rule of thumb: Be honest. If you are a developer, tell the way you do. They might like it or not, but you won't have a surprise afterwards, if you're honest.
suggest improvements |Â
up vote
4
down vote
up vote
4
down vote
1- Was this question an appropriate interview question?
If you're applying for a developing job, then it is pretty appropriate. Not only because it may be a requirement because you work with others, but also it may be a requirement when you leave to also leave a good code base.
Indeed, it could be pretty subjective. To me, it's just to sound you out, to have an idea of what you consider clean code (and thus, the way you might code). However, it may not go the way the interviewer wants:
I once had a colleague whose idea of clean code was "code that can be read fast". Time proved that by "read fast", he meant "written fast", as in "variables with one character names, loops and conditionals without brackets, big utils
files with tons of global variables and functions out of scope".
To me, clean code means the other way around. Self-explanatory variables and methods names, following a standard coding style, trying to split methods in meaningful classes, documenting all the classes, methods and variables so that you can extract a documentation, and also documenting example code on specially important methods.
2- Is this a common question? If so, what would a bad answer to it would look like?
I've been asked directly once, indirectly twice. The indirect ones went pretty well. They were something like:
- What do you want to see in others' code? (as "I expect you do the same")
- Do you enjoy coding? (as "you do fine code pieces")
In both cases, I showed some code (unrelated to previous jobs), and they were glad.
The one that went direct was a little less couraging. After I explained that I did all that, her response was something like:
So, you take more time writing than thinking?
They didn't hire me, luckily!
The rule of thumb: Be honest. If you are a developer, tell the way you do. They might like it or not, but you won't have a surprise afterwards, if you're honest.
1- Was this question an appropriate interview question?
If you're applying for a developing job, then it is pretty appropriate. Not only because it may be a requirement because you work with others, but also it may be a requirement when you leave to also leave a good code base.
Indeed, it could be pretty subjective. To me, it's just to sound you out, to have an idea of what you consider clean code (and thus, the way you might code). However, it may not go the way the interviewer wants:
I once had a colleague whose idea of clean code was "code that can be read fast". Time proved that by "read fast", he meant "written fast", as in "variables with one character names, loops and conditionals without brackets, big utils
files with tons of global variables and functions out of scope".
To me, clean code means the other way around. Self-explanatory variables and methods names, following a standard coding style, trying to split methods in meaningful classes, documenting all the classes, methods and variables so that you can extract a documentation, and also documenting example code on specially important methods.
2- Is this a common question? If so, what would a bad answer to it would look like?
I've been asked directly once, indirectly twice. The indirect ones went pretty well. They were something like:
- What do you want to see in others' code? (as "I expect you do the same")
- Do you enjoy coding? (as "you do fine code pieces")
In both cases, I showed some code (unrelated to previous jobs), and they were glad.
The one that went direct was a little less couraging. After I explained that I did all that, her response was something like:
So, you take more time writing than thinking?
They didn't hire me, luckily!
The rule of thumb: Be honest. If you are a developer, tell the way you do. They might like it or not, but you won't have a surprise afterwards, if you're honest.
answered Jul 20 '15 at 8:55
Korcholis
1,4991925
1,4991925
suggest improvements |Â
suggest improvements |Â
2
If you wrote "I write clean code" (or something to that effect), they probably just wanted to know what you meant. I've never had this question appear during an interview (I'm not in HR or management/part of the interviewer processes - just an interviewee)
– hd.
Jul 20 '15 at 8:30
possible duplicate of How appropriate is the interview question: "Show me a piece of code you like"?
– gnat
Jul 20 '15 at 8:51
see also: Copying questions that had a misfortune of being widely exposed in the hot list
– gnat
Jul 20 '15 at 8:51
1
You didn't specify what is it about code you like. I am not answering your question and I am voting to close it as too vague. The fact is, your prospective wants to make sure that you have a good idea what clean code is and their question is legitimate. If you take issue with that question, your attitude is your problem. If you don't get the question, it's still your problem. If you don't understand something, you follow up for clarifications with the person who asked the question.
– Vietnhi Phuvan
Jul 20 '15 at 10:06
1
Ask if they're referencing the very popular book, "Clean Code"
– user8365
Jul 20 '15 at 15:24