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.
- Write any method code
- Swap if the number is greater than the next number
- Find the key from the array (not in any easy way, split the array into two then search)
- Find the count of words in a long string
- Check if the website is active or not?
- Find the random number with x length
- Find longest increasing subsequence in an array
- Get unique values from a slice of int with count
- Write palindrome program in go
- Get pairs with x difference only unique pairs
- Reverse a string Input = ‘Hello’, Output = ‘olleH’
- Write Code :- Input : "aabbbcccab" , Output: "aa2bbb3ccc3a1b1"
- Print unique elements form array, Input = [2,3,4,5,2,3], Output = [2,3,4,5]
- Find the lengthiest word. Input =’ i am in Bangalore‘
- Check whether it is closed or not. Input =’{([])}’
- Count the repeat numbers Input = [2,3,4,5,2,3,2, 5, 2], Output = {2:4, 3:2, 4:1, 5:2}
- Display the middle number, Input = [2,3,4,5,2,3,7]
- Find Combination of pair elements which give 0, Input = [ -1, 0, 1, -2, 2, 3, 4, 5, 2, 3]
- Write a program use type interface with goroutines and channels.
- 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
Comments
Post a Comment