1) 基础语言描述理解考察
https://www.tutorialspoint.com/go/go_interview_questions.htm
这里有一栏、全面的问答,并且非常基础
也包括golang的一些开放性话题的讨论

基础语言代码考察
http://www.golangpro.com/2015/08/golang-interview-questions-answers.html

10个基本问题考察
https://www.toptal.com/go/interview-questions

(2)代码工程考察
https://yushuangqi.com/blog/2017/golang-mian-shi-ti-da-an-yujie-xi.html?from=groupmessage&isappinstalled=0
这里有代码题的分析,直接面向工程和原理。看似简单、简短,从候选人的回答入口、思路,基本可以探测到候选人的语言理解和运用经验信息。

(3) 其他 从网上爬的
What is good code design?
What version control tools did you use so far? (I just want to know about his/her experience)
How do you approach a new problem?
How to you test your software? (a bad answer here is a deal breaker for me)
(In case of server software) How do you deploy your applications?
How would you setup the authentication e.g. in a microservice environment?
Then some Go specific questions:

What are Go routines?
What are channels and how can you use them?
How can you distribute tasks in Go to different machines? (this is a pro question)

    1. Give a summary of Golang.
      A system programming language developed at Google. It has inbuilt garbage collection and supports concurrency. The code can be compiled into a single executable binary and don't need addition library or runtime to execute it on server.

    2. Can you declare a class in Golang?
      Yes, Golang has a unique way of implementing class with the type interface.
      See here on how to declare class in Golang

    3. Does Go supports generic? ( trick question )
      No (as of 2015)

    4. What are the commands available in Golang to import codes from repositories such as GitHub or BitBucket?
      go get and go install commands

    5. A buffer was created with make() function and Go allocated some memory for the buffer. How do you destroy the buffer to reclaim back the memory?
      buffer = nil
      During runtime, buffer = nil will cause it to be garbage collected.

    6. What are these ? (trick question)
      var num int ( integer variable)
      var ptr *int (a pointer)
      num = 10 (assign value of 10 to variable num)
      ptr = &num (pointer holding the memory address of variable num)

    7. What are the notable differences between a slice and array ?
      Array size is fixed, slice size is not. Can dynamically increase or decrease a slice's size during runtime but not for array. Slice is similar to a linked list, can do push, pop, FIFO, LIFO on slice. Use builtin append, copy functions to manipulate slice.

    8. What's the difference between cap() and len()?
      Len() - gives the number of elements inside a slice.
      Cap() - gives the capacity of the slice. Number of elements the slice can accommodate.

    9. Hash table or hash map allows fast lookup. How does Go implements hash map? (trick question)
      The equivalent of hash table in Golang is map.
      hash-table := make(map[string]string)

    10. Which of the following functions, variables or identifiers that are exportable or can be invoked from another function externally and why? (trick question)

golang 面试的更多相关文章

  1. 换人!golang面试官:连怎么避免内存逃逸都不知道?

    问题 怎么避免内存逃逸? 怎么答 在runtime/stubs.go:133有个函数叫noescape.noescape可以在逃逸分析中隐藏一个指针.让这个指针在逃逸分析中不会被检测为逃逸. // n ...

  2. golang面试-代码编写题1-14

    目录 1.代码编写题--统计文本行数-bufio 2.代码编写题--多协程收集错误信息-channel 3.代码编写题--超时控制,内存泄露 4.代码编写题--单例模式 5.代码编写题--九九乘法表 ...

  3. 爬虫技术:scrapy 知识点一

    ---恢复内容开始--- 1.scrapy框架 每一步的解释: step1:引擎从爬虫器获取要爬行的初始请求. step2:引擎在调度程序中调度请求,引擎把这个初始请求传递给调度器,并向调度器索要下一 ...

  4. go golang 笔试题 面试题 笔试 面试

    go golang 笔试题 面试题 笔试 面试 发现go的笔试题目和面试题目还都是比较少的,于是乎就打算最近总结一下.虽然都不难,但是如果没有准备猛地遇到了还是挺容易踩坑的. 就是几个简单的笔试题目, ...

  5. 面试必问:Golang高阶-Golang协程实现原理

    引言 实现并发编程有进程,线程,IO多路复用的方式.(并发和并行我们这里不区分,如果CPU是多核的,可能在多个核同时进行,我们叫并行,如果是单核,需要排队切换,我们叫并发) 进程和线程的区别 进程是计 ...

  6. 面试经典算法:快速排序Golang实现

    Golang快速排序 定义 快速排序由C. A. R. Hoare在1962年提出.快速排序是对冒泡排序的一种改进,采用了一种分治的策略. 基本思想 通过一趟排序将要排序的数据分割成独立的两部分,其中 ...

  7. 有关golang信道的面试笔记

    信道是一个goroutine之间很关键的通信媒介. 理解golang的信道很重要,这里记录平时易忘记的.易混淆的点. 1. 基本使用 刚声明的信道,零值为nil,无法直接使用,需配合make函数进行初 ...

  8. Golang 类型定义总结手册| 面试最基础

    变量 var 关键字是 var ,定义后须被调用 支持多个同时定义 支持使用 := 缺省定义 变量定义(声明) //使用var 关键字 进行变量定义 : var + 变量名 + 变量类型 //Var ...

  9. 面试经典算法:马拉松算法,最长回文子串Golang实现

    求一个字符串中最长的回文子串. package main import "fmt" /* 马拉松算法,求最长回文子串,时间复杂度:线性 */ func main() { // 回文 ...

随机推荐

  1. Activity间用Intent、Bundle、onActivityResult进行传值

    其实Activity间的传值就是通过Bundle,intent中也是自动生成了Bundle来传值,里面还有个onActivityResult()方法也可以传送数值. 如果一个Activity是由sta ...

  2. JAVA基础知识之编译、运行、打包

    一:java环境设置在环境变量中设置以下三个变量: JAVA_HOME=C:\j2sdk1.4.1 //可以改为相应的目录CLASSPATH=%JAVA_HOME%\lib\tools.jar;%JA ...

  3. JavaScript:Functions

    ylbtech-JavaScript:Functions 1.返回顶部 JavaScript 全局对象 全局属性和函数可用于所有内建的 JavaScript 对象. 顶层函数(全局函数) 函数 描述 ...

  4. osg for android学习之一:windows下编译(亲测通过)【转】

    1. 首先需要一个OSG for android的环境 (1)NDK 现在Eclipse 对NDK已经相当友好了,已经不需要另外cygwin的参与,具体可以参考 Android NDK开发篇(一):新 ...

  5. UML图中聚合、组合、关联、依赖、泛化的强弱关系

    一.泛化 1.说明 泛化是一种继承关系,如果一个类A的所有属性和操作能被另一个类B所继承,则类B不仅可以包含自己独有的属性,而且可以包含类A的属性和操作.继承是类与类或者类与接口之间最常见的关系. 2 ...

  6. VS2010如何生成ActiveX控件测试容器

    VS2010中默认没有ActiveX控件测试容器TSTCON.exe,而是微软把这个文件放到了例子程序中,需要用户自己编译: 具体方法为: 在VS2010的安装目录中找到以下目录Samples\205 ...

  7. python 机器学习多项式回归

    现实世界的曲线关系都是通过增加多项式实现的,现在解决多项式回归问题 住房价格样本 样本图像 import matplotlib.font_manager as fm import matplotlib ...

  8. 浅谈Kmeans聚类

    http://www.cnblogs.com/easymind223/archive/2012/10/30/2747178.html 聚类分析是一种静态数据分析方法,常被用于机器学习,模式识别,数据挖 ...

  9. Java-Shiro(三):Shiro与Spring MVC集成

    新建Java Daynamic Web项目 导入Spring.SpringMVC依赖包: 导入Spring & Spring MVC包(导入如下所有开发包): Spring AOP依赖扩展包: ...

  10. .NET 基于任务的异步模式(Task-based Asynchronous Pattern,TAP) async await

    本文内容 概述 编写异步方法 异步程序中的控制流 API 异步方法 线程 异步和等待 返回类型和参数 参考资料 下载 Demo 下载 Demo TPL 与 APM 和 EAP 结合(APM 和 EAP ...