
Senior Golang Developer ex @smcglobal ex @project10k_tech | Building Fintech products | Tweets about backend, performance & Go.
India
Joined February 2017
- Tweets1.2K
- Following223
- Followers1.6K
- Likes8.7K
Pinned Tweet
golang interview problems for senior role:
1. What are method sets? how do you decide when to use value receiver over pointer receiver?
2. How does the Go scheduler work? What happens during a goroutine context switch?
3. Explain escape analysis and provide examples where variables escape to the heap.
#golang
Most developers don’t struggle to FIND content.
We already have:
YouTube.
Docs.
Courses.
ChatGPT.
Notes.
The real problem?
We forget most of what we spend hours learning.
That’s why my friend built CodeVoice.
Link: play.google.com/store/apps/d…
A developer learning system designed to help you:
• capture concepts in your own words
• review before forgetting
• stay consistent for months
• retain knowledge long-term
Not another content platform.
Just a better way to make learning stick.
Try it for 7 days.
See if your learning finally starts staying with you.
367
If you've used joho/godotenv in Go, you probably have done this at the top of main.go
It works but there's a cleaner one-liner, trick with /joho/godotenv/autoload.
The blank identifier _ tells Go to just run init function from this package (autoload)
- Zero boilerplate
- loads before everything. init() runs before main(), so env vars are ready even for package-level var initializers.
- Great for scripts, demos and small scripts.
BUT DON'T USE THIS IN PRODUCTION:
- because it silently swallows errors. autoload calls godotenv.Load() and ignores the returned error.
- No control over order or path. Can't load .env.local or .env.production.
Request Coalescing also known as request deduplication or singleflight.
It's a technique where multiple identical concurrent requests for the same resource are merged into a single underlying operation.
It prevents thundering herd or cache stampede.
Common domain where this matters:
- Cache refills after expiry (redis)
- CDN origin fetches for the same asset
- DNS lookups for the same hostname (Go's net package does this)
- Upstream API calls with rate limits
- Database queries during traffic spikes
2
256
I prefer manual implementation most of the time. I use golang-jwt/jwt for stateless authentication, bcrypt for password hashing.
Implement authentication as a reusable middleware that intercepts requests, validates the token/session, and adds user context to the request.
Another alternative is to import uber's auth package (go.uber.org/fx/auth) for request authentication & Authorization for user-to-service and service-to-service communication.
There are some good go packages available such as:
Casbin: powerful library for Authorization (RBAC,ABAC, ACL).
Oauth2: official go package for OAuth2 client & server flows
Goth: popular package for multi-provider OAuth (Google, GitHub, Discord etc)
Some open source Identity servers like keycloak, casdoor etc.
This quoted post is unavailable.
1
10
545
Go Guidelines for Coding Agents
github.com/mhmtszr/go-guidel…
SQL's NULLS FIRST and NULLS LAST
When you sort a column that has NULLs in it, your DB has to decide where those rows go. NULL is not zero. It is not empty. It means unknown, and unknown has no natural place in a sorted list.
Every database made its own call on this, and they disagree:
- PostgreSQL and Oracle put NULLs last on ASC, first on DESC.
- MySQL always puts NULLs first, no matter the direction.
- SQL Server puts NULLs first on ASC, last on DESC.
- BigQuery does the same as SQL Server.
So the same query on different databases returns rows in a different order, silently, with no error.
The fix is two simple keywords:
ORDER BY score DESC NULLS LAST;
ORDER BY score ASC NULLS FIRST;
You attach them after the sort direction and the database does exactly what you said. No surprises.
Where this actually needed:
Leaderboards where unranked players (NULL score) should not appear at the top above real scores.
Task lists sorted by due date where NULL means "no deadline" and should sit at the bottom, not above urgent work.
Paginated queries where an unstable sort causes rows to repeat or disappear across pages.
The catch: MySQL and SQL Server do not support the clause at all. The workaround is ugly but works:
ORDER BY CASE WHEN score IS NULL THEN 1 ELSE 0 END, score DESC;
This pushes NULLs to the bottom. The downside is it cannot use a column index, so on large tables it costs a full sort pass.
One index note for PostgreSQL users: if your query says NULLS LAST, your index should match. Build it as CREATE INDEX ON table (score DESC NULLS LAST) or the planner may skip it for the sort.
The rule is simple. If the column is nullable and the order of NULLs changes the meaning of your output, write it explicitly. The default is invisible, differs by database, and produces wrong results without telling you.
Calling a Rust library from Go with CGO_ENABLED=0
stoolap.io/blog/2026/04/08/c…
Distributed Locks :-
A distributed lock ensures that only one process or node across multiple instances can access a shared resource at a time.
Just like a Mutex but across a network.
In a distributed system, multiple instances of a service run simultaneously. Without coordination, they can process the same job twice, corrupt the shared state or race on cron jobs.
A good distributed lock must have properties like Mutual exclusion, Deadlock safety and Fault tolerance.
Was reading this blog today again on
Go Naming Conventions
link: alexedwards.net/blog/go-nami…
a high performance difference algorithm module for Go.
What is a difference algorithm?
Difference algorithms compare two inputs and find the edits that transform one to the other.
github.com/znkr/diff
Claude code Skills for production-ready golang projects
github.com/samber/cc-skills-…
In FlatBuffers, ENCODING IS MORE EXPENSIVE THAN DECODING.
That's the whole point of FlatBuffers. You pay more at write so reads are nearly free.
FlatBuffers exist because many systems write once, read millions of time. The format deliberately front-load work into serialization so deserialization is just memory-mapped pointer chasing.
Flat buffers are built back-to-front. You can't write a table until all its children (strings, nested tables, vectors) exist in the buffer. So every table needs to build children then build self. Decoding just follows pointers forward, one pass, no ordering constraint.
8
495
I don't know why flatbuffers are not popular as protocol buffers. Even though it offers extreme read speed via zero-copy access (no parsing into intermediate objects). I know flatbuffers are used in Games & data visualization mainly but it can also be used in trading systems.
They work well for high-throughput microservices where millions of messages flow per second.
read about it here: flatbuffers.dev
🤣🤣
Congrats to the @cursor_ai team on the launch of Composer 2!
We are proud to see Kimi-k2.5 provide the foundation. Seeing our model integrated effectively through Cursor's continued pretraining & high-compute RL training is the open model ecosystem we love to support.
Note: Cursor accesses Kimi-k2.5 via @FireworksAI_HQ ' hosted RL and inference platform as part of an authorized commercial partnership.
2
279








