Loading…
30+ curated questions with the same answer shape every time: quick recap, deep dive, pitfalls, and follow-ups. Coverage includes database sql package, executing queries go, prepared statements go, transactions go basics, and more.
Suggested path
Topics follow a teaching order. Each answer ends with a clear Next question control so you can move forward without hunting the list.
Database interaction is tested in every Go fresher interview — Go engineers are expected to know both the stdlib database/sql approach and a lightweight ORM. This module covers how database/sql works (opening a DB connection, sql.Open vs ping, the driver registration pattern), executing SELECT queries and scanning rows correctly (the Row vs Rows difference, closing rows to avoid connection leaks), using prepared statements to prevent SQL injection, wrapping multiple operations in a transaction (Begin/Commit/Rollback), GORM model definitions and AutoMigrate, and configuring connection pool settings (SetMaxOpenConns, SetMaxIdleConns, SetConnMaxLifetime). These are fresher interview staples at any Go backend role.
Full catalog
Topics are ordered for learning. Within each topic, rows are numbered 1–30 globally so you always know where you are. Collapse topics if you want a lighter view — use Expand all when you need the full list again.
Numbers 1–30 follow the order we recommend — click any row to open the full answer, or use the sticky Next link at the bottom of each page to go Q1 → Q30.