Infosys Certified Go Programmer
Practice with real exam-pattern questions for Infosys Certified Go Programmer. Each question includes a detailed explanation to help you understand the concept, not just memorise the answer. Try 10 questions free — no login required.
Full question bank for this exam + 1,357+ others. Cancel anytime.
Join Premium10 Infosys Certified Go Programmer practice questions with answers
Real Lex exam-pattern multiple-choice questions for the Infosys Certified Go Programmer certification. Each question includes the correct answer. The full question bank is available to Premium members.
- Question 1
What will be the output of the following code snippet:
//Assume all necessary imports are done
const (
value1 = 10
value2 = 30
value3 = iota * 20
value4
value5 = 20
)
func main() {
fmt.Println(value1, value2, value3, value4, value5)
}
- ✓
10 30 40 60 20
Correct - B
10 30 0 20 20
- C
10 30 20 40 20
- D
10 30 60 80 20
- ✓
- Question 2
Identify the CORRECT statement with respect to the code given below:
//Assume all necessary imports are done
package main
import ("fmt")func main() {
var a int
var b int = 2
var c = 3
d := a + b
fmt.Println(d)
}- ✓
The output would be 2 as the variable a will have the default value of 0
Correct - B
The output can be anything as the variable a is not initialized
- C
Error in code as the declaration of variable ‘c’ is not proper
- D
Error in code as variable ‘c’ is declared but not used
- ✓
- Question 3
Observe the below code:
//Assume all the necessary imports are done
func main() {num1 := "12"
//Line1
fmt.Println(complex(float64(b), 12))}
Choose the CORRECT option to fill Line1.- ✓
num2,_ := strconv.Atoi(num1)
Correct - B
num2,_ := strconv.Itoa(num1)
- C
num2,_:=strconv.FormatInt(num1)
- D
No Change
- ✓
- Question 4
What is the output of the following code snippet?
//Assume all necessary imports are done
func main() {
balance := 1000
expense := 200
if balance = balance - expense; balance >= 1000 {
fmt.Println("Option1")
} else if balance = balance + expense; balance < 1500 {
fmt.Println("Option2")
}
else if balance = balance / expense; balance == 5 {
fmt.Println("Option3")
} else {
fmt.Println("Option4")
}
}
- ✓
Option4
Correct - B
Option2
- C
Option3
- D
Syntax Error: else in new line
- ✓
- Question 5
What possible changes in the below code so that there is no infinite looping and output of the code is: 1
Note: Assume all the necessary imports are done
(Choose 2 correct options)for i := 0; ; i += 2 { //………Line1
if i%2 == 1 {
continue //………Line2
}
fmt.Println(i + 1) //………Line3
i++
}
- ✓
Line1: Change i += 2 to i += 1
Correct - B
Line2: Change continue to break
- C
Line3: Replace fmt.Println(i+1) with fmt.Println(i)
- D
Line1: Add condition in loop: i < 3
- ✓
- Question 6
Observe the code below:
Note: Assume all the necessary imports are done.
func main() {
var order = map[string]int{}
customer := "Premium"
switch customer {
case "[A-Z][a-z]{6}": //line1
order["Noodles"] = 2case "Premium", "Regular":
order["Pizza"] = 2default:
order["Pizza"] = 0
order["Noodles"] = 0
order["Pasta"] = 0
}
if _, flag := order["Pasta"]; !flag {
order["Pasta"] = 0
}
_, flag := order["Pasta"]
fmt.Println(flag)
}What is the above output?
- ✓
true map[Pasta:0 Pizza:2]
Correct - B
true map[Noodles:2 Pasta:0]
- C
false map[Pasta:0 Pizza:2]
- D
false map[Noodles:2 Pasta:0]
- ✓
- Question 7
What is the output of the below code?
//Assume all necessary imports are done
func main() {
names := []string{"John", "Ron", "Leia", "Annie"}
cpNames1 := make([]string, len(names))
copy(cpNames1, names)
names[1] = "Joey"
fmt.Println(names[1] == cpNames1[1])
}- ✓
True
Correct - B
False
- ✓
- Question 8
What is the output of the below code?
Note: Assume all necessary imports are done
func main() {arr := [6]int{10, 20, 15, 2, 90, 23}
for i := 1; i < len(arr)-1; i++ {
if arr[i] >= arr[i-1] && arr[i] > arr[i+1] {
fmt.Println(arr[i])
}
}}
- ✓
90
Correct - B
20
- C
20, 90
- D
15, 90
- ✓
- Question 9
What should be filled in blanks in the following code snippet?
// Assume all the necessary imports are done
func main() {
var sampleString stringmodifyA := func() string {
return "FOR A BRICK, "
}modifyB := func(text string) string {
return text + "PRETTY GOOD "
}modifyC := func(text string) string {
return text + "HE FLEW "
}modifyDescription := func() {
sampleString = _____<Blank>_____
}modifyDescription()
fmt.Println(sampleString)
}To obtain the following output:
FOR A BRICK, HE FLEW PRETTY GOOD- ✓
modifyB(modifyA(modifyC()))
Correct - B
modifyA(modifyB(modifyC()))
- C
modifyB(modifyC(modifyA()))
- D
modifyC(modifyB(modifyA()))
- ✓
- Question 10
Consider the following code
//Assume all necessary imports are done
func main() {
filteredData := filter("apple", "banana", "cherry")
fmt.Println(filteredData)
}func filter(data ...string) []string {
var result []string
for _, item := range data {
if len(item) > 5 {
result = append(result, item)
}
}
return result
}
Which of the following statements are true about the above program?- ✓
The program will output ["apple", "banana", "cherry"]
Correct - B
The program will output ["banana", "cherry"]
- C
The program will output ["apple", "cherry"]
- D
Compilation error: cannot pass multiple strings as variadic parameters
- ✓
More in Java
Infosys Certified Expert Programmer-Level 1
Infosys Certified Go REST Developer
Infosys Certified Java SE 17 Developer
Pay once. Clear every cert this year.
One subscription, full Telegram channel access, every PDF posted during your membership.
- Full access to all 1,357+ certifications
- Monthly updated question banks
- Telegram private channel access
- Cancel anytime
- Everything in Monthly
- Save ₹2,100 vs monthly billing
- Priority answer key requests
- Best for increasing DQ score fast
- Everything in Quarterly
- Lifetime channel access — no renewals
- All future certifications included
- Priority response from admin team
Common questions, straight answers.
A monthly-updated Telegram channel where we post real exam-pattern question banks and detailed answer keys for 1,357+ Infosys Lex certifications. You join once, you get every PDF posted during your membership.
Right after payment on our Graphy page, you'll receive a private invite link to the Telegram channel. Access is instant — usually under 30 seconds.
We compile question banks from the actual Lex test pattern, sourced and verified by 180K+ community members who've recently cleared these exams. Match rate is consistently 85–95%.
Every single month. When Infosys rolls out new versions of certifications, we post updated dumps within 7–10 days. You'll see channel activity weekly.
Clearing certifications is one of the highest-weighted DQ factors. Members typically clear 3–5 certifications in their first 3 months, which moves DQ scores up by a full band.