Why you weren’t hired!

Warning! Strong language, whole idea was to be heard!

Should it even be in your resume?

In the past three years, I am taken a lot of interviews. I realized that most of the developers who weren’t hired were not because they were less talented – but because our expectations from their resume didn’t match the level of knowledge they had. For instance, they will write “GO” and “GIT” in their resume but in an interview, I am told, they have worked on just a REST API and CAPP (Commit, Add, Pull and Push) in Go and Git respectively.

The Desire to be Hired!

They want to impress the interviewer and hence, they end up adding a lot of stuff. See, for me, I want knowledge! and I am sure it is for every interviewer. When I receive a resume, my expectations are set and I am generally very eager to speak to candidates. I am all excited and dreaming of the good happy ending to have a guy who knows what we are looking for. The desire here is to hire – I really want to hire you, but these high expectations are shattered into pieces right at the beginning of the interview when you just described what you have built. It is like saying I know Maths once you have learned how to divide! or English when you can barely form a word!

The Company Cup VS The World Cup

We have lived in technical problems – we have faced probably more fire than you might have seen in Game of Thrones. We have once paralyzed by the choice of our tech-stack. We have faced the wrath of hits. We have seen our database dying which wouldn’t revive after continuous CPR. This is World! And it Sucks! Now you come along and is full of confidence just because you are better than five developers in your company. You are forgetting that there is a world out there and it requires more than a REST API and CAPP!

The Reality Check!

After a couple of questions which is probably the toughest one – I have seen some candidates are still confident about a tech. After fifteen minutes, I am told that the interview is ‘tough’. Now you have forgotten the fact that you rated yourself 8-9 in MySQL and PHP. As long as it is PHP I think an interview is fine – It isn’t tough. Perhaps you don’t know your level. Ah ha – Your level was computed with a limited dataset – Your Current Company.

“I hate you” – you just said it

Unfortunately the tech can be quantified. It can be measured! There are multiple right answers but one is the best solution? No – only best solution is the only solution. We can measure the memory and cpu usage of your codes. We can measure number of queries you ran – fuck queries, we can even judge on your typing speed. Interview is a mirror! I can tell you where you stand but can you take it? Most of the interviewee couldn’t. As soon as I tell you “You are wrong” and You argued, it is over. It isn’t that we have a really nasty culture out here. But we know that sooner you are told you are wrong, sooner you can fix your codes! If you are arguing, we are loosing probably a couple of customers every minute! So attitude is a key. You are not hired probably because you live more than you should in denial! We can’t afford that.

Farewell!

So, please write what you really know in the resume. Ensure that level you are telling is measured with a bigger dataset. If you have attitude problem, I think there isn’t much you can do. Stay in your current company – consider yourself lucky!


Worth Sharing?

Laravel Alternative in Node – AdonisJS

AdonisJS can be said to be a complete transformation of a Laravel framework in PHP to Node. Consider it in this way – it is a Laravel re-written in Node.

We have used Laravel extensively to create various Shopify Application. The fundamental problem with Laravel is database connections which goes out of hand when you use multiple databases. If you come to node and write some stuff which isn’t AdonisJS, then you will fall under the trap of callbacks and promises. So we needed something which is not only in node – but a lot like Laravel.

AdonisJS has a Query Builder, ORM (LUCID), Scheduler and of course, it is MVC. Adonis follows almost same naming conventions of Laravel – if that be a Controller, Route or anything. The API is so consistent, you can guess it. If you are coming from Laravel directly, you already know! Give it a try and watch screencasts.

AdonisJS an alternative to Laravel

Worth Sharing?

The Stateless Development Machine

Are you spending 2-3 hours and sometimes a day getting your new laptop ready for the development? I used to do it with ansible and be happy about it. With Docker, it has now become easier. I have following in my .zshr and it works pretty great.

The .zshrc aliases

alias npm='docker run -ti --rm -v $(pwd):/src:rw -e "PUID=$UID" -e "PGID=$GID" mkenney/npm:latest npm'
alias gulp='docker run -ti --rm -v $(pwd):/src:rw -e "PUID=$UID" -e "PGID=$GID" mkenney/npm:latest gulp'
alias node='docker run -ti --rm -v $(pwd):/src:rw -e "PUID=$UID" -e "PGID=$GID" mkenney/npm:latest node'
alias bower='docker run -ti --rm -v $(pwd):/src:rw -e "PUID=$UID" -e "PGID=$GID" mkenney/npm:latest bower'
alias bundle='docker run -ti --rm -v $(pwd):/src:rw -e "PUID=$UID" -e "PGID=$GID" rails:latest bundle'
alias composer='docker run -ti --rm -v $(pwd):/app:rw -e "PUID=$UID" -e "PGID=$GID" composer:latest composer'
alias go='docker run -ti --rm  -w /usr/src/myapp -v $(pwd):/usr/src/myapp:rw -e "PUID=$UID" -e "PGID=$GID" golang:latest go'
alias nghttp='docker run --rm -it dajobe/nghttpx nghttp'
function dbash() {
    docker exec -it $1 /bin/bash
}
alias dbash=dbash

Understanding

Obviously, the list can go on but understanding here is to keep your system in a stateless mode. Simply by having dotfiles backup, you can move your system with no trouble. Now days everything is in Git already!

Worth Sharing?

Writing the ‘straight’ codes

The most prominent mistake which is made during coding is calling with nested functions. For instance look at the following codes:

//bad codes
function getBooks(){
 return getAuhtors(books);
}
function getAuthors(books){
  books.authors = SomeQuery;
}
function main(){
 let booksWithAuthor = getBooks();
}

Problem with the above code is, they are nested and when you call getBooks() – you are not aware that it will bring authors as well. Let us try again by renaming the function.

//bad codes
function getBooksWithAuthors(){
 return getAuthors(books);
}
function getAuthors(books = []){
  books.authors = SomeQuery;
  return books
}
function main(){
 let booksWithAuthor = getBooksWithAuthors();
}

After the change, there is not any longer function which only takes the Books i.e. Books without authors and it is still sort of nested right? Lets further modify the codes and turn them into sequential

// Good Codes
function getBooks(){
 return books;
}
function getAuthors(books = []){
 return authors;
}
function getBooksWithAuthors(){
 books = getBooks();
 books.authors = getAuthors(books);
}

The function calls in getBooksWithAuthors now do not have nested function calls but a sequential call which combines both of the data i.e. books and authors

Advantages

  1. Codes are more readable – you know that getBooksWithAuthors will get you both.
  2. Codes will lead to isolated functions – getBooks and getAuthors are isolated functions and can be called by any other function.
  3. Codes don’t have side-effects – Here sequential call ensures that it is called where it is intended. For instance, if you want to get only books, you would call getBooks()
  4. Improve Unit Test coverage – There will be more coverage of tests as they are all isolated functions.

Worth Sharing?

How to write good “If” statements?

Writing a good code is an art and it can be useful in so trivial things that most developers often ignore. Usually, amateurs are programmed to write an ‘if’ statement which is always accompanied by an ‘else’ . However, it is important to realize that code quality can significantly be improved if else is omitted. For instance, consider this code.


function getUser($id){
  if($id < 1){
   $user = [];
  }else{
   //some big codes
  }
  return $user
}

Here some big codes can be so big that it will return statement will be lost in it. Better would be:


function getUser($id){
  if($id < 1){
   return [];
  }
  //some big codes
  return $user
}

Worth Sharing?





Reduce size of docker image for Golang

The Feature!

Docker 17.05 came up with a concept called multi-stage builds

The Problem

Default image builds can have size easily more than 800MB.

The Approach

  • Stage 1. Compile the app in default image
  • Stage 2. Copy compiled app in alpine

Dockerfile

FROM golang:1.10.1 as builder
WORKDIR /go/src/api_redis
#Get Requirements
RUN go get -d -v github.com/go-redis/redis
#Get Requirements
RUN go get -d -v github.com/OneOfOne/xxhash
COPY main.go  .
#Compile codes
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o api_redis .

#Get compiled app
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go/src/api_redis/api_redis .
CMD ["./api_redis"]
sudo docker build -t api_redis:v1 .

This kind of build has reduced the images size to only 10.3MB


sudo docker images

REPOSITORY                                      TAG                 IMAGE ID            CREATED             SIZE
api_redis                                       v1                  3b3f571be4da        4 seconds ago       10.3MB
golang                                          latest              6b369f7eed80        3 days ago          794MB

Worth Sharing?

Read More