Yahiya (@yahiyadev) header
Yahiya (@yahiyadev) profile picture

Senior Golang Developer ex @smcglobal ex @project10k_tech | Building Fintech products | Tweets about backend, performance & Go.

India
Joined February 2017
Photo by Yahiya (@yahiyadev)Photo by Yahiya (@yahiyadev)Photo by Yahiya (@yahiyadev)Photo by Yahiya (@yahiyadev)Photo by Yahiya (@yahiyadev)Photo by Yahiya (@yahiyadev)Photo by Yahiya (@yahiyadev)Photo by Yahiya (@yahiyadev)Photo by Yahiya (@yahiyadev)Photo by Yahiya (@yahiyadev)
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
9
9
2
233
46,691
Yahiya retweeted
The world’s first infinite canvas for trading
7
10
4
51
46,909
Yahiya retweeted
“A new Go API for JSON” by Michael Pratt, Joe Tsai, Daniel Martí, Johan Brandhorst-Satzkorn, Roger Peppe, Chris Hines, and Damien Neil — go.dev/blog/jsonv2 #golang
9
125
10
855
61,083
Yahiya retweeted
Your trading platform is not an infinite canvas?!
We’re thrilled to welcome @Aries on board as our newest SDK customer! Aries used the tldraw SDK to rethink trading. Instead of building a wall of monitors, Aries Infinite provides a borderless space where traders can drag live charts, order entry, news, and video onto one canvas and group them by idea. Check it out: aries.com/infinite aries.com/infinite
There's a new version of this post
2
7
5
21
8,051
Yahiya retweeted
Polls tell you what people say. Markets show you what people will put money behind. Live odds on every Senate, House and Governor race: aries.com/markets/midterms
33
16
2
86
456,993
Yahiya retweeted
Remember The Big Short scene where Margot Robbie explains mortgage bonds from a bubble bath? Mortgage bonds started as a good, boring idea. Then Wall Street ran out of good loans, stuffed in bad ones, and the safe product blew up. The same thing is happening to prediction markets The original idea was good. People put money behind what they think will happen, and with enough people the price becomes the odds. Then came sports and parlays. Sports were ~85% of June volume, and Bloomberg reported a net $294M in customer losses on parlays just this year. Prediction markets on Aries stick to the original idea: elections, the economy, etc. No gambling slop.
Polls tell you what people say. Markets show you what people will put money behind. Live odds on every Senate, House and Governor race: aries.com/markets/midterms
84
34
49
409
938,649
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.
370
New article: Slices, Maps, and Channels 🔥 A look at the three most ordinary Go types and the not-so-ordinary structures behind them. ↔ slice headers and the doubling/1.25× growth rule ↔ Swiss tables, H1/H2, and local growth ↔ hchan, sudogs, and direct goroutine handoff 👉 internals-for-interns.com/po… #golang #go
2
18
1
101
13,009
Reading this Paper on today The Tail at Scale Software techniques that tolerate latency variability are vital to building responsive large-scale Web services.
1
6
298
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.
3
2
1
89
9,009
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
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.
1
2
286
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.
4
24
1,381
👨‍💼
3
1
234