While applying for jobs, on a couple occasions I’ve been given a technical question to do at home. Occasionally I feel the solution I provide I don’t fully understand because portions of code is copied from stackoverflow.com
Here are a couple examples:
Draw a star using css only. The full solution can be found here so I just emailed them the link saying I would just be copying it anyway (looking back, I wasn’t being serious at this point).
Another was writing an SQL query to retrieve information from multiple tables. I found the solution spread across 2 or 3 answers on stackoverflow, but one of them was complex enough I wasn’t able to get an intuitive sense of how it worked (before I submitted the solution).
In these situations, what’s the honest thing to do? I would feel more honest if I included a list of sources I used to come to the solution, and send it along with the solution. I’m trying to avoid giving the impression that I could do it all directly from memory vs looking up information, and I do feel bad about using information that I don’t 100% understand (for example you could just copy the sql code from here without understanding it). Part of my personality is it's really important to understand every little bit.
Though not directly related, it’s worth noting that a lot of sites, including stackexchange, don’t have clear licensing (or the licensing is disputed) for the code provided by contributors.