Friday Links: Layoffs, outliers, and interviewing

Hey, there.

Here are 4 links I thought were worth sharing this week:

#1. The day I “was let go” last year, I was told it was because of how tough the economy was doing. High interest rates? AI? But this news article shows the real reason behind layoffs in the tech sector (10min). Spoiler alert: nothing to do with AI.

#2. With AI, our job is to know when to introduce outliers (4min). “In a sea of fish, you want to be a narwhal.”

#3. Like coding, interviewing is another skill to master. Yes, I agree the tech interview is broken and we don’t know how to fix it. But if you’re actively interviewing, here are 8 dos and don’ts to ace your next interviews.

#4. At some point we all as coders have to make a choice: stay technical or jump the management track. The thing is being an engineering manager has never been harder (5min), too many hats to wear.


And in case you missed it, I wrote on my blog about 10 steps I’d take to build a profitable brand from scratch (4min) and 10 lessons I learned from the worst moment of my career (4min). Not much about coding this week.


(Bzzz…Radio voice) This email was brought to you by… Join my course Mastering C# Unit Testing with Real-world Examples on Udemy and learn unit testing best practices to write readable and maintainable unit tests in C# while refactoring real unit tests from my past projects.

See you next time,

Cesar

Want to receive an email with curated links like these? Get 4 more delivered straight to your inbox every Friday. Don’t miss out on next week’s links. Subscribe to my Friday Links here.

10 Life-Changing Lessons I Learned the Hard Way—from the Worst Moment of My Career

Two years ago, my life sucked. Completely. I felt like a complete loser.

In 2023, I got sick. One day, out of the blue, I started to rush to the bathroom after every meal. And it wasn’t to throw up.

By the end of 2023, I burned out. And in 2024, I was laid off. A simple call over Microsoft Teams ended my 5-year career at a company.

I felt so lost. I felt more lost than when I was a teenager out of high school trying to figure out life as an adult.

That was the worst moment of my career and probably of my life. But that whole situation taught me these 10 lessons:

1. Your health and well-being are more important than any job.

When I burned out, I had stopped working out, running, and eating healthy.

I was so focused on my career that I had forgotten about resting and taking care of my health. It was a painful mistake.

Remember you can always get a new job and a new career, but not a new body.

2. You’re more than your job title.

For years, my career was probably the most important part of my life.

My job was what brought me a sense of accomplishment, fulfillment, and joy… until I heard a “We have to let you go” on a call. It shook my world because I had wrapped my entire identity around a title: “Software Engineer.” It became all I thought I was.

Remember, diversify your sources of joy and fulfillment.

3. Build multiple sources of income like your life depends on it.

No job is safe.

I used to think being an employee was the safest route. I don’t know who made me believe that. I was so wrong. Being an employee is like having one single customer who can decide to stop buying from you at any time.

Don’t only rely on your paycheck. Have more than one way to make money.

4. The moment you stop learning and growing, it’s time to go.

For months and years, I delayed the decision of finding another job or starting my own thing. Being at a “good enough” job was the most expensive decision for my career.

5. Do something that brings you joy every day.

It took me months, probably one entire year, to feel free from burnout. The path was simple but slow: going back to my hobbies and practicing them every day.

6. Your connections and online presence are way better than a CV.

Right after the layoff, I felt relieved. No more meetings or emails.

But after a few weeks, I went into panic mode. I realized no paycheck was coming. I applied to anything with “software engineer” in the job description. I took the CV route. And I don’t have to say it led me nowhere.

When the layoff season came, I didn’t have a solid network and I had set aside my online presence. Your brand is your CV and portfolio.

7. Be careful with what you put in your body and mind.

Apart from pills, to recover from my stomach sickness, I had to eat fruits and vegetables, at a fixed schedule, and eat them slowly.

To recover from burnout? It started with an information diet.

I cut news, music, podcasts, TV shows, movies…. I only focused on binge-watching Borja Vilaseca, a Spanish YouTuber with an inspiring story of personal and professional reinvention.

8. Change and reinvention start in your mind.

It was a little voice in my head that made me start again.

“If you don’t get up by yourself, nobody else will do it for you.” Maybe it was all the inspiring YouTube videos and books I had started to consume.

You have to choose yourself first. Always.

9. Listen to your body for small clues.

I didn’t wake up burned out. It was a slow process on the way down.

Now that I connect the dots, there was a clear sign I failed to notice: not wanting to get out of bed. My body was yelling and I ignored it.

10. Your current struggles will become lessons and stories to share.

After more than one year, I could say I’m free from burnout.

But just thinking of where I was makes me anxious again. That’s my best motivation to keep working today. I thought I wouldn’t make it. Being healthy and doing something I love felt like a distant goal I would never reach.

No storm lasts forever. Your current struggles will become lessons and stories to share. Like the French say: “Après la pluie, le beau temps.” There’s always sunshine after the rain.

TIL: You Don't Need AsNoTracking() When Projecting Entities With Entity Framework Core

Every time we retrieve an entity with Entity Framework Core, it will track those entities in its change tracker. And when calling .SaveChanges(), those changes are persisted to the database.

For read-only queries, we can add .AsNoTracking() to make them faster.

But when projecting an entity into a custom object, there’s no need to add AsNoTracking() since Entity Framework doesn’t track query results with a type different from the underlying entity type. Source

For example, let’s save some movies and retrieve them with and without a custom projection,

using Microsoft.EntityFrameworkCore;

namespace LookMaEntityFrameworkDoesNotTrackProjections;

public class Movie
{
    public int Id { get; set; }
    public string Name { get; set; }
    public int ReleaseYear { get; set; }
}

public class MovieContext : DbContext
{
    public MovieContext(DbContextOptions<MovieContext> options) : base(options)
    {
    }

    public DbSet<Movie> Movies { get; set; }
}

[TestClass]
public class MovieTests
{
    [TestMethod]
    public void EFDoesNotTrackProjections()
    {
        var options = new DbContextOptionsBuilder<MovieContext>()
            .UseInMemoryDatabase(databaseName: "MovieDB")
            .Options;

        // 0. Saving two movies
        using (var context = new MovieContext(options))
        {
            context.Movies.AddRange(
                new Movie { Name = "Matrix", ReleaseYear = 1999 },
                new Movie {Name = "Titanic", ReleaseYear = 1997 }
            );
            context.SaveChanges();
        }

        // 1. Using a custom projection
        using (var context = new MovieContext(options))
        {
            var firstMovieNameAndReleaseYear
                = context.Movies
                    .Where(m => m.ReleaseYear >= 1990)
                    .Select(m => new { m.Name, m.ReleaseYear })
                    // ^^^^
                    // This is a custom projection
                    .First();

            var noTracking = context.ChangeTracker.Entries();
            Assert.AreEqual(0, noTracking.Count());
            //             ^^^
            // No entities tracked
        }

        // 2. Using AsNoTracking
        using (var context = new MovieContext(options))
        {
            var firstMovieWithNoTracking
                = context.Movies
                    .Where(m => m.ReleaseYear >= 1990)
                    .AsNoTracking()
                    // ^^^^^
                    .First();

            var withAsNoTracking = context.ChangeTracker.Entries();
            Assert.AreEqual(0, withAsNoTracking.Count());
            //             ^^^
            // As imply by its name, no entities tracked here
        }

        // 3. Retrieving a Movie
        using (var context = new MovieContext(options))
        {
            var firstMovie = context.Movies
                .Where(m => m.ReleaseYear >= 1990)
                .First();

            var beingTracked = context.ChangeTracker.Entries();
            Assert.AreEqual(1, beingTracked.Count());
            //             ^^^
            // Since we're retrieving only one Movie, tracking happens here
        }
    }
}

Only when we queried the first movie without a projection and without .AsNoTracking(), Entity Framework Core tracked the underlying entity.

Et voilà!

For more tricks with Entity Framework Core, read how to configure default values for nullable columns with default constraints.

10 Steps I'd Take to Build a Profitable Online Brand from Zero

In 2018, I wrote my first words online.

I had no idea what to do and how to do it. I just Googled how to get better at coding and found “start a blog.”

After procrastinating for a couple of days, choosing a name and a theme for my blog, I dumped a bunch of words into a file and hit Publish.

After years of trial and error, my analytics grew from 10 visitors a month to 1,000 visitors and I made my first $100 by pure luck.

But if I had to start all over again, here are 10 actions I’d take:

1. Think of my online presence as a business

Writing online was just something cool I did on the side of my 9-to-5.

For so long, I only thought my online presence would make me appear “attractive” to recruiters and hiring managers. I didn’t know our online presence is our most valuable asset.

Our personal brand is our own one-person business.

2. Start on a social blog like Medium or Quora

I started a blog because it was the only free advice I found.

But the thing with blogs is that our content is at the mercy of search engines, SEO, and their bots. Social blogs have a “feed” and algorithm to match readers with content. And that’s the best way to get faster feedback as a writer.

As a coder, I’d start in a social blog like dev.to or Medium, sharing TIL posts.

3. Use a social platform like X or LinkedIn

I only started on LinkedIn 4 or 5 years after starting my blog.

And I only shared links to my posts, pretending to steal LinkedIn users for my blog. Instead, I’d use X or LinkedIn to test ideas, share nuggets of my long-form content, and grow a newsletter. Speaking of which…

4. Start a newsletter from day 1

Subscribers are the real metric to track. Not followers, likes, or comments.

They are our true fans. From day 1, I’d invite readers to join my newsletter at the end of every post and I’d email them weekly.

5. Use consistent user handles

Oh boy! I used to think hacker-like user handles, like Napster, Codemaestro, or Neo were cool.

Instead I’d use a more professional user handle across all platforms.

6. Go for volume first

I only wrote on my blog when I thought I had something to say.

That was once in a blue moon. And when I started on LinkedIn, that was once a week. It’s no surprise I only saw traction when I went for volume.

If I were to start again, I’d go with volume: 30 long-form pieces and at least 100 short-form posts to get the juices flowing.

7. Come up with a simple content plan

For so long, I only wrote when I had something to say. No content plan.

But to fix that, I’d send one or two long-form emails to my newsletter, and repurpose them into one daily short-form post every week. That’s the simple content plan from millionaire creators.

8. Find ways to monetize earlier: courses/ebooks/templates

Making money from my online presence was an afterthought. I didn’t even know I could make money online.

To start again, I’d come up with monetization strategies after the first or second month. For example, I’d package my best-performing content into an ebook or a course and put a price tag on it somewhere like Gumroad.

Those first few dollars would motivate me to keep creating and fund higher-quality products.

9. Only after #1-#8, buy a domain and start a website

I’ve built my presence on rented land. Ooops!

And when I tried to buy a domain under my name, it was already taken. It turns out there’s a famous soccer player, a singer, and a film director with my same first and last name. Arrggg!

I’d buy a domain name, even if I didn’t use it. Or to simply point to a landing page linking to my newsletter and my other accounts.

10. Invest in courses, training, and coaching

Six years passed before I bought my first writing course.

Of course, I had consumed a lot of YouTube content to learn about SEO and blog post writing. But those were only two skills I needed to learn to make my online presence a real business.

I’d invest more in education to save myself a lot of time and take all the money I was leaving on the table. Well, it’s never too late to start again and invest in our online presence and turn it into something real.

What True Wealth Really Looks Like (And It Isn't Money)

What does being wealthy truly mean?

Yesterday, before starting 21 Lessons for the 21st Century, I watched a YouTube interview with Yuval Noah Harari about that book. That was part of my new reading strategy. Authors often go on podcast tours to promote their books, sharing their insights and the intentions behind their books.

Towards the end, the interview closed with this unexpected idea:

“If you’re important, you don’t have a phone. If you work for somebody else, you have a phone”

That was shocking but eye-opening. The point isn’t about owning a phone per se but about having full control of our time. A phone means your boss might interrupt you with any apparent urgent issue.

That line hit really hard. It was only after a layoff that I realized I felt the pressure of always being available and responding to messages. I didn’t know how a salary had messed with my mind.

True wealth isn’t measured in currency, but in the ability to own our time. And I need to dump my phone.