{"id":91,"date":"2017-02-05T19:22:23","date_gmt":"2017-02-05T19:22:23","guid":{"rendered":"http:\/\/www.hestben.se\/HestbenTechnical\/?p=91"},"modified":"2017-02-05T19:22:23","modified_gmt":"2017-02-05T19:22:23","slug":"what-does-it-mean-to-be-a-senior-developer","status":"publish","type":"post","link":"https:\/\/www.hestben.se\/HestbenTechnical\/?p=91","title":{"rendered":"What does it mean to be a Senior Developer?"},"content":{"rendered":"<p>So, I have been looking for a job for quite a while now, and have had some interviews. Thus far, I have not been successful, though.<\/p>\n<p>I just had an interview, where I was asked to solve some things during the interview. Here are some of the questions that I didn&#8217;t have an answer to, from the top of my head.<\/p>\n<p>&#8220;In <code>Bash<\/code>, change mode of all jpg-files in the current directory, and sub directories&#8221;.<br \/>\nHere, I was first thinking about how to setup the <code>for<\/code>-loop in bash. There is the <code>do<\/code>, and <code>done<\/code>, and somewhere, you need a semicolon.<br \/>\nI also started to think about using <code>find<\/code>, but was not sure if I needed the flag in <code>xargs<\/code> to limit the output to one entry per line. While I was contemplating, the interviewer asked how much I had done in <code>Bash<\/code>, and I said, I mostly did small build scripts. And then he asked about <code>Makefile<\/code>, so we skipped the first question.<\/p>\n<p>I later checked the solution I was starting to form in my head:<br \/>\n<code>find . -iname *.jpg | xargs chmod 600<\/code><br \/>\nThat would have worked.<\/p>\n<p>&#8220;What does <code>.PHONY<\/code> in a <code>Makefile<\/code> mean?&#8221;<br \/>\nI have seen it often, but never looked it up.<br \/>\nNow, I have found that it is a directive you put in a <code>Makefile<\/code>, that is always dirty, thus is always built. This is mostly used for <code>clean<\/code> and <code>all<\/code>. A <code>Makefile<\/code> always has a target, and <code>clean<\/code> and <code>all<\/code> are used for cleaning up the build (remove all built binaries and libraries), and to make all projects. If you then have a file in the directory that is called <code>clean<\/code> or <code>all<\/code>, it becomes ambiguous for <code>make<\/code>, if you want to build the file <code>clean<\/code> or if you want to clean up the build. That&#8217;s why you setup a <code>.PHONY<\/code> directive.<\/p>\n<p>&#8220;How do you combine two lists in Javascript or Python&#8221;.<br \/>\nThis, I should have known. But I guess it is something that I missed by not doing a proper course in Python, or I have simply forgot it. I hate it when I forget the elementary things. I don&#8217;t know how often I have to lookup &#8220;Hello world&#8221; in languages I have used before, because I have forgotten how to start a simple project, or how to output text to command line.<br \/>\nThe more detailed question:<br \/>\n&#8220;You have:<br \/>\n<code>a=[1,2,3]<br \/>\nb=[4,5,6]<\/code><br \/>\nHow do you create<br \/>\n<code>c=[1,2,3,4,5,6]<\/code>?&#8221;<br \/>\nI quick-and-dirty-solved it in Python like this:<br \/>\n<code>c=[]<br \/>\nfor x in a:<br \/>\n    c.append(x)<br \/>\nfor x in b:<br \/>\n    c.append(x)<\/code><\/p>\n<p>This was not an acceptable solution, and we broke off the interview at this point.<\/p>\n<p>When did some searches. I saw, I should have simply tried the <code>+<\/code>-operator:<br \/>\n<code>c=a+b<\/code><br \/>\nIn other languages:<br \/>\nIn Javascript, you can use <code>concat<\/code>.<br \/>\n<code>c=a.concat(b);<\/code><br \/>\nIn C\/C++, first C-arrays:<br \/>\n<code>\/\/How do you concatenate c arrays?<br \/>\nint a[3]={1,2,3};<br \/>\nint b[3]={4,5,6};<br \/>\nint c[6];<br \/>\n\/\/ You actually don't need to specify the size of the<br \/>\n\/\/ array,<br \/>\n\/\/ if it is initialized with the {} notation,<br \/>\n\/\/ the compiler can infer it:<br \/>\nint d[]={1,2};<br \/>\n\/\/Need to loop through a and b to fill c, and for this,<br \/>\n\/\/ need to<br \/>\n\/\/ specifically know the sizes of the arrays<br \/>\nconst int size1=3;<br \/>\nconst int size2=3;<br \/>\nfor(int i=0; i < size1; i++)\n{\n\tc[i] = a[i];\n}\nfor(int i=0; i < size2; i++)\n{\n\tc[i+size1]=b[i];\n}<\/code><br \/>\nIn C++:<br \/>\n<code>\/\/ In C++, you should use std::vector<br \/>\nstd::vector<int> a_vec;<br \/>\na_vec.push_back(1);<br \/>\na_vec.push_back(2);<br \/>\na_vec.push_back(3);<br \/>\n\/\/ In C++ 11, you can use the array initialization as<br \/>\n\/\/ well:<br \/>\nstd::vector<int> b_vec = { 4, 5, 6};<br \/>\nstd::vector<int> c_vec;<br \/>\nc_vec.insert(c_vec.end(),  a_vec.begin(), a_vec.end());<br \/>\nc_vec.insert(c_vec.end(),  b_vec.begin(), b_vec.end());<\/code><\/p>\n<p>It is worrisome, that my memories of some of the basic things are so sketchy, I need to shape up, to call myself senior in any language. Maybe I should stop looking at more different languages (I am currently working my way through <a href=\"https:\/\/mitpress.mit.edu\/sicp\/full-text\/book\/book.html\">SICP<\/a> - Structure and Interpretation of Computer Programs), and focus on some languages that I would like to work in.<br \/>\nOther resources that deal with what it means to be \"Senior Developer\": <a href=\"http:\/\/sijinjoseph.com\/programmer-competency-matrix\/\">The programmer competence matrix<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, I have been looking for a job for quite a while now, and have had some interviews. Thus far, I have not been successful, though. I just had an interview, where I was asked to solve some things during the interview. Here are some of the questions that I didn&#8217;t have an answer to, &hellip; <a href=\"https:\/\/www.hestben.se\/HestbenTechnical\/?p=91\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;What does it mean to be a Senior Developer?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hestben.se\/HestbenTechnical\/index.php?rest_route=\/wp\/v2\/posts\/91"}],"collection":[{"href":"https:\/\/www.hestben.se\/HestbenTechnical\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hestben.se\/HestbenTechnical\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hestben.se\/HestbenTechnical\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hestben.se\/HestbenTechnical\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=91"}],"version-history":[{"count":7,"href":"https:\/\/www.hestben.se\/HestbenTechnical\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":98,"href":"https:\/\/www.hestben.se\/HestbenTechnical\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions\/98"}],"wp:attachment":[{"href":"https:\/\/www.hestben.se\/HestbenTechnical\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hestben.se\/HestbenTechnical\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hestben.se\/HestbenTechnical\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}