Swizec Teller - a geek with a hatswizec.com

    The quickest way to fail a tech interview

    What's the quickest way to fail a tech interview?

    No it's not a wrong answer or floundering with algorithms. Not even being nervous or shy or having a language barrier. Culture fit is the least of your worries if you make this mistake.

    The fastest red flag I've seen is when you're confidently wrong.

    We had a candidate recently. Great guy, oodles of talent, gritty as heck. Had a couple of fantastic interviews, even taught me about datalist. Clearly self-taught and not ready to be senior, but so much potential. My favorite trait in a not-yet-senior. I'd give him a chance any day.

    But his system design 😬

    Swiz: "Hello again", I interviewed him twice, "today we're going to design a system. You'll build a schema, write a few SQL queries, and sketch out a system architecture. Here are the requirements"

    Our prompt includes user numbers, traffic patterns, and a problem where everything connects. This is important.

    Him: "Okay first I would shard the database"

    Swiz: "Ok ok let's back up. Why don't we start with the schema, look at the traffic numbers again, and talk about scale when everything's in place"

    That helped. He designed the system, wrote the queries, and struggled with the scale question. Which is fine, not everyone is an expert in scaling databases.

    I thought he'd make a fine addition to the team. The hiring manager felt strongly about the confidently wrong red flag and we passed. 💩

    Why sharding was the wrong answer

    Sharding is a last resort scaling strategy for relational databases. You reach for sharding when you have a lot of writes and don't care about relations across shards.

    Gaming worlds are shards, for example.

    Diablo has separate servers (and databases) in Europe and in North America. You can't use the same character on both. Your friends don't translate. Even your username doesn't. When I play these days, I have to use the European servers even though I'm in San Francisco. I don't exist on the North America shard. 💩

    There's many scaling strategies like indexes, better queries, partitioning, vertical scaling, and read/write replicas you should try first. Sharding comes with lots of drawbacks.

    Yes social networks like Twitter have solved this problem. But they have tens of thousands of writes per second. And it took years of engineering effort to fix. I think several academic papers came out of the effort.

    You don't need sharding. I once had to push Postgres and Rails pretty far and it worked fine.

    Swizec Teller published ServerlessHandbook.dev avatarSwizec Teller published ServerlessHandbook.dev@Swizec
    To all my over-engineerers and overthinkerers 👇

    We are currently logging over 500,000 events per day to a PostgreSQL database running on a single Heroku instance. The table has over 300,000,000 rows.

    Don't worry about scale. Stuff scales.
    Tweet media

    Why "confidently wrong" is a red flag

    Being wrong is fine. Being confidently wrong is not.

    To paraphrase the hiring manager:

    We need to trust our engineers to ask questions when they're out of their depth. We don't want to babysit.

    How to avoid being confidently wrong

    It's hard. I struggle with this a lot.

    Like when I failed my Google on-site interviews because I read about tries the week before, got excited, and told every interviewer that accessing a hash map is O(key length) because you'd implement it with a trie. Every person gave me a chance to catch my mistake. I confidently did not.

    The best solution I've found is to do your research and ask why.

    "Here is my answer and this is why" 🤔

    "Wait a minute, that makes no sense, that's a terrible why. Let's try this other answer ..."

    Iterate until your reasoning makes sense. Because X said so in a blog or book is never the right why.

    And yes going through that chain of logic will impress an interviewer. And your peers.

    Cheers,
    ~Swizec

    PS: missing the why behind their answer is the quickest way to spot someone how has book knowledge but doesn't understand. Or as Feynman liked to say "Knowing the name of a thing is not the same as knowing the thing"

    Did you enjoy this article?

    Published on January 11th, 2022 in Mindset, Lesson, Interviewing

    Want to become a true senior engineer?

    Getting that senior title is easy. Just stick around. Being a true senior takes a new way of thinking. Do you have it?

    Leave your email and get the Senior Mindset series - a series of curated essays on the mindset of a senior software engineer. What it takes to get there, what should you do when you're there, how to change the way you think.

    The Senior Mindset series

    Get a series of curated essays on the mindset of a senior software engineer. What it takes to get there, what should you do when you're there, how to change the way you think.

    it describes my days in a way I have not read before.

    This was a very enlightening article about being a senior engineer.

    Join over 14,000 engineers just like you already improving their careers with my letters, workshops, courses, and talks. ✌️

    Have a burning question that you think I can answer? I don't have all of the answers, but I have some! Hit me up on twitter or book a 30min ama for in-depth help.

    Ready to Stop copy pasting D3 examples and create data visualizations of your own?  Learn how to build scalable dataviz components your whole team can understand with React for Data Visualization

    Curious about Serverless and the modern backend? Check out Serverless Handbook, modern backend for the frontend engineer.

    Ready to learn how it all fits together and build a modern webapp from scratch? Learn how to launch a webapp and make your first 💰 on the side with ServerlessReact.Dev

    Want to brush up on your modern JavaScript syntax? Check out my interactive cheatsheet: es6cheatsheet.com

    By the way, just in case no one has told you it yet today: I love and appreciate you for who you are ❤️

    Created by Swizec with ❤️