Go Skills

Logical Coding Questions Asked in Interviews

  1. Find the subset having total is zero
Input : [4,2,-6,3,3,-6]
  1. Reverse a word
Input : I am an Indian
Output: I ma na naidnI
  1. Sort fruit name by count and with int
Input : ["apple","mango","orange","apple","apple","orange","apple"]
Output :  
apple-4
orange-2 
mango-1
  1. Find out second largest number
  2. Consecutive string
Input : aaabbcda
Output: a:3,b:2,c:1,d:1,a:1
  1. Even-Odd number using goroutines
  2. Two sum problem
Input : [1,5,6,7,2] Target : 6
Output: [0,1] print indexes.
  1. Find the median
  2. Find the unique elements from array
Input : [1,5,6,7,5,1]
Output: 1,5,6,7
  1. Return unique elements from array using map
  2. Count the number of strings from array
Input : [“I am an Indian”]
Output: 4
  1. Keep adding the individual digits of the sum until it’s a single digit
Input : 54321
Output: 6
Exp : 5+4+3+2+1 = 15 = 1+5 = 6
  1. Merge and get sorted unique linked list
Input : 
List1 = head → 45012 → NULL
List2 = head → 10160 → NULL

Output: head → 1410125060
  1. Find min and Max sum if I choose any 4 elements in this array
Input : arr :[] {1,3,5,7,9}
Output should be Minimum 16, maximum 24
  1. Valid anagram https://leetcode.com/problems/valid-anagram/
  2. Find happy number https://leetcode.com/problems/happy-number/
  3. Implement Binary search tree in golang
  4. Implement Queue example in golang
  5. Can you write a program, structure 2 goroutine, each go routine should increment value simultaneously
  6. Can you write a program for Last-In-First-Out? (for stack = push, pop)
  7. Reverse a string using defer
  8. Merge two array and sort it
  9. Merge two array and find highest and lowest
  10. Check sub array string present or not
  11. Reverse a string - “golang” —> “gnalog”
  12. Random number https://go.dev/play/p/oH53qVBvWUb
  13. Print output
Input :
 arr1 []{5,10,30,45,50}
 arr2 []{3,7,15,25,55}

 Output :
 5,7,15,25,55
 10,15,25,55
 30,55
 45,55
 50,55
  1. Store unique words only https://go.dev/play/p/0bmPCqCE_6I

  2. Design an API to print the list of users along with their posts API response Format: {UserName : "” , Posts[] } https://go.dev/play/p/2FqYHuMLIkG

  3. Write a program to communicate between two goroutines

Practice Leetcode’s Easy and Medium programs.