Standard Library & Idioms interview questions

15 Standard Library & Idioms questions from the Go bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

1. What is defer?

Junior
  1. A.the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index
  2. B.the statement that schedules a function call to run when the surrounding function returns, in last-in-first-out order
  3. C.the standard carrier of deadlines, cancellation signals and request-scoped values across API boundaries
  4. D.the synchronization helper guaranteeing a given function runs exactly one time across all goroutines

Answer + AI explanation with Pro

2. Which term means: "the statement that schedules a function call to run when the surrounding function returns, in last-in-first-out order"?

Junior
  1. A.defer
  2. B.sync.Mutex
  3. C.slices package
  4. D.context.Context

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.defer — the statement that schedules a function call to run when the surrounding function returns, in last-in-first-out order
  2. B.defer — the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index
  3. C.defer — the synchronization helper guaranteeing a given function runs exactly one time across all goroutines
  4. D.defer — the standard carrier of deadlines, cancellation signals and request-scoped values across API boundaries

Answer + AI explanation with Pro

4. What is context.Context?

Mid
  1. A.the statement that schedules a function call to run when the surrounding function returns, in last-in-first-out order
  2. B.the mutual-exclusion lock whose Lock and Unlock methods guard a critical section against concurrent access
  3. C.the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index
  4. D.the standard carrier of deadlines, cancellation signals and request-scoped values across API boundaries

Answer + AI explanation with Pro

5. Which term means: "the standard carrier of deadlines, cancellation signals and request-scoped values across API boundaries"?

Mid
  1. A.defer
  2. B.context.Context
  3. C.sync.Mutex
  4. D.sync.Once

Answer + AI explanation with Pro

6. Which statement is correct?

Mid
  1. A.context.Context — the statement that schedules a function call to run when the surrounding function returns, in last-in-first-out order
  2. B.context.Context — the standard carrier of deadlines, cancellation signals and request-scoped values across API boundaries
  3. C.context.Context — the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index
  4. D.context.Context — the synchronization helper guaranteeing a given function runs exactly one time across all goroutines

Answer + AI explanation with Pro

7. What is sync.Mutex?

Mid
  1. A.the mutual-exclusion lock whose Lock and Unlock methods guard a critical section against concurrent access
  2. B.the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index
  3. C.the statement that schedules a function call to run when the surrounding function returns, in last-in-first-out order
  4. D.the synchronization helper guaranteeing a given function runs exactly one time across all goroutines

Answer + AI explanation with Pro

8. Which term means: "the mutual-exclusion lock whose Lock and Unlock methods guard a critical section against concurrent access"?

Mid
  1. A.context.Context
  2. B.sync.Mutex
  3. C.slices package
  4. D.defer

Answer + AI explanation with Pro

9. Which statement is correct?

Mid
  1. A.sync.Mutex — the statement that schedules a function call to run when the surrounding function returns, in last-in-first-out order
  2. B.sync.Mutex — the synchronization helper guaranteeing a given function runs exactly one time across all goroutines
  3. C.sync.Mutex — the mutual-exclusion lock whose Lock and Unlock methods guard a critical section against concurrent access
  4. D.sync.Mutex — the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index

Answer + AI explanation with Pro

10. What is sync.Once?

Mid
  1. A.the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index
  2. B.the mutual-exclusion lock whose Lock and Unlock methods guard a critical section against concurrent access
  3. C.the standard carrier of deadlines, cancellation signals and request-scoped values across API boundaries
  4. D.the synchronization helper guaranteeing a given function runs exactly one time across all goroutines

Answer + AI explanation with Pro

11. Which term means: "the synchronization helper guaranteeing a given function runs exactly one time across all goroutines"?

Mid
  1. A.context.Context
  2. B.sync.Once
  3. C.sync.Mutex
  4. D.slices package

Answer + AI explanation with Pro

12. Which statement is correct?

Mid
  1. A.sync.Once — the standard carrier of deadlines, cancellation signals and request-scoped values across API boundaries
  2. B.sync.Once — the mutual-exclusion lock whose Lock and Unlock methods guard a critical section against concurrent access
  3. C.sync.Once — the synchronization helper guaranteeing a given function runs exactly one time across all goroutines
  4. D.sync.Once — the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index

Answer + AI explanation with Pro

13. What is slices package?

Senior
  1. A.the synchronization helper guaranteeing a given function runs exactly one time across all goroutines
  2. B.the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index
  3. C.the standard carrier of deadlines, cancellation signals and request-scoped values across API boundaries
  4. D.the statement that schedules a function call to run when the surrounding function returns, in last-in-first-out order

Answer + AI explanation with Pro

14. Which term means: "the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index"?

Senior
  1. A.slices package
  2. B.context.Context
  3. C.defer
  4. D.sync.Mutex

Answer + AI explanation with Pro

15. Which statement is correct?

Senior
  1. A.slices package — the standard carrier of deadlines, cancellation signals and request-scoped values across API boundaries
  2. B.slices package — the generic standard library collection added in 1.21 providing helpers like Sort, Contains and Index
  3. C.slices package — the synchronization helper guaranteeing a given function runs exactly one time across all goroutines
  4. D.slices package — the statement that schedules a function call to run when the surrounding function returns, in last-in-first-out order

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Standard Library & Idioms question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers