From aa0b6fa9ccbdefc0062b72c1b0c3e357c4b3a3b0 Mon Sep 17 00:00:00 2001 From: abregman Date: Wed, 23 Oct 2019 10:27:02 +0300 Subject: [PATCH] Add a couple of Go questions Also some contribution guidelines. --- CONTRIBUTING.md | 16 +++++++++++++ README.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3dee4e5..1c23360 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1,17 @@ +## How to contribute + Use pull requests to contribute to the project. + +Stick to the following format: + +
+[Question]
+ +[Answer] +
+ +## What to avoid + +* Avoid adding installation questions. Those are the worst type of questions... +* Don't copy questions and answers from other sources. They probably worked hard for adding them. +* If you add new images, make sure they are free and can be used. diff --git a/README.md b/README.md index aad2aa9..7c7dad8 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ :information_source:  This repository contains interview questions on various DevOps related topics -:bar_chart:  There are currently **409** questions +:bar_chart:  There are currently **413** questions :warning:  You don't need to know how to answer all the questions in this repo. DevOps is not about knowing all :) @@ -2375,6 +2375,68 @@ It looks what unicode value is set at 101 and uses it for converting the integer If you want to get "101" you should use the package "strconv" and replace y = string(x) with y = strconv.Itoa(x) +
+What is wrong with the following code?: + +``` +package main + +func main() { + var x = 2 + var y = 3 + const someConst = x + y +} +``` +
+
+ +
+What will be the output of the following block of code?: + +``` +package main + +import "fmt" + +const ( + x = iota + y = iota +) +const z = iota + +func main() { + fmt.Printf("%v\n", x) + fmt.Printf("%v\n", y) + fmt.Printf("%v\n", z) +} +``` +
+
+ +
+What _ is used for in Go?
+
+ +
+What will be the output of the following block of code?: + +``` +package main + +import "fmt" + +const ( + _ = iota + 3 + x +) + +func main() { + fmt.Printf("%v\n", x) +} +``` +
+
+ ## Mongo