日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

golang 面试

發布時間:2025/3/20 编程问答 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 golang 面试 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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)

  • 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.

  • 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

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

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

  • 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.

  • 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)

  • 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.

  • 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.

  • 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)

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

  • 總結

    以上是生活随笔為你收集整理的golang 面试的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。