Golang Interview Questions Part 2 Coding Question

Golang Interview Coding Questions


This is Part 2 Golang Interview coding Questions, Please check part 1 for Theory Questions.

https://gophersgo.blogspot.com/2021/01/golang-interview-questions-part-1.html


All questions asked in a real interview.

  1. Write any method code
  2. Swap if the number is greater than the next number
  3. Find the key from the array (not in any easy way, split the array into two then search)
  4. Find the count of words in a long string
  5. Check if the website is active or not?
  6. Find the random number with x length
  7. Find longest increasing subsequence in an array
  8. Get unique values from a slice of int with count
  9. Write palindrome program in go
  10. Get pairs with x difference only unique pairs
  11. Reverse a string Input = ‘Hello’, Output = ‘olleH’
  12. Write Code :- Input : "aabbbcccab" , Output: "aa2bbb3ccc3a1b1"
  13. Print unique elements form array, Input = [2,3,4,5,2,3], Output =  [2,3,4,5]
  14. Find the lengthiest word.  Input =’ i am in Bangalore‘
  15. Check whether it is closed or not.  Input =’{([])}’
  16. Count the repeat numbers Input = [2,3,4,5,2,3,2, 5, 2], Output = {2:4, 3:2, 4:1, 5:2}
  17. Display the middle number, Input = [2,3,4,5,2,3,7]
  18. Find Combination of pair elements which give 0, Input = [ -1, 0, 1, -2, 2, 3, 4, 5, 2, 3]
  19. Write a program use type interface with goroutines and channels.
  20. Generate N digit random number based on input. input : 5 , Output : 93657 Input : 2, Output : 47



Note: Interviewer asked to write the above code in Go Playground.

Contribute @https://www.linkedin.com/in/pranit-haribhakta-668721169

Thanks For Reading, Keep Go'ing.







Comments

Popular posts from this blog

Golang Interview Questions Part 1 Theory Top 50 Question

Complete Golang Development setup on Linux (Ubuntu 20.04 )

Best GitHub repositories for Go