Backend Development 11 min read

Comprehensive Backend Interview Q&A: Golang, Networking, OS, MySQL, Redis, Design Patterns, and Algorithms

The article presents recent tech-company salary figures and a comprehensive set of backend interview questions spanning Go language fundamentals, memory management, networking protocols, OS synchronization, MySQL transaction isolation and indexing, Redis performance, design‑pattern implementations, and classic algorithms such as quicksort.

Java Tech Enthusiast
Java Tech Enthusiast
Java Tech Enthusiast
Comprehensive Backend Interview Q&A: Golang, Networking, OS, MySQL, Redis, Design Patterns, and Algorithms

This article shares recent salary reports from major tech companies and presents a collection of backend interview questions covering Golang, computer networks, operating systems, MySQL, Redis, design patterns, and algorithms.

Backend development SSP: 32k × 15 months + 9w signing bonus + housing subsidy, total ~48w, optional equity.

Backend development "big cabbage": 26k × 15 months + 1w signing bonus, total ~39w, optional equity.

Algorithm position SSP: 36k × 15 months + 12w signing bonus, total ~54w, optional equity.

Product SP: 22k‑24k × 15 months, total 33‑35w.

Golang

1. How did you learn Golang and what resources did you use?

Started with a B‑station training course, then read "The Go Programming Language", "Go Web Development", "Effective Go", and "The Go Programming Language: Design and Implementation".

2. How does Golang manage memory?

Golang uses tcmalloc‑based allocation, a concurrent mark‑sweep (CMS) garbage collector, memory pools, and supports large objects (>1 MB) via a variable‑size array structure.

Memory allocator (malloc/free) : tcmalloc reduces fragmentation and lock contention.

Garbage collection : CMS runs concurrently without stopping user threads.

Memory pool : Pre‑allocates blocks to avoid frequent system calls.

Large‑object support : Handles objects larger than 1 MB with a mutable array.

Computer Network

3. Which protocols belong to the network layer of the OSI model?

Typical network‑layer protocols include IP, ICMP, IGMP, and routing protocols such as OSPF and BGP.

4. What does TTL stand for in IP?

TTL (Time‑to‑Live) is decremented by one at each router; when it reaches zero the packet is discarded and an ICMP "time exceeded" message is sent.

Operating System

5. What is a condition variable and how does it differ from a mutex?

A condition variable allows a thread to block and wait for a signal while releasing the associated mutex, enabling synchronization beyond simple mutual exclusion.

6. Differences between processes and threads

Threads start faster and are lightweight.

Processes have higher system overhead.

Threads share memory, requiring consistency handling; processes have isolated memory.

Threads share heap, globals, and file descriptors; each has its own stack.

MySQL

7. Difference between uncommitted read and committed read

Uncommitted read (dirty read) sees changes made by other transactions before they commit, risking inconsistency. Committed read only sees data after the transaction commits, preventing dirty reads but still allowing non‑repeatable reads or phantom reads.

8. Why does MySQL use B+ trees for indexes?

B+ trees store only keys in internal nodes, allowing more fan‑out per node, resulting in shallower trees and fewer I/O operations compared to B trees.

Redis

9. Why is single‑threaded Redis so fast?

Most operations run in memory with efficient data structures, avoiding lock contention. The single thread also uses I/O multiplexing (select/epoll) to handle many connections without context‑switch overhead.

Design Pattern

10. Thread‑safe singleton in Golang

package main

import (
    "fmt"
    "sync"
)

type Singleton struct {
    name string
}

var instance *Singleton
var once sync.Once

func GetInstance() *Singleton {
    once.Do(func() {
        instance = &Singleton{name: "Singleton Instance"}
    })
    return instance
}

The once variable of type sync.Once guarantees the initialization block runs only once, ensuring a thread‑safe singleton.

Algorithm

11. Quick sort (omitted for brevity)

A classic interview question; the implementation follows the standard divide‑and‑conquer approach.

Backenddesign patternsdatabasegolangInterviewAlgorithmsnetworking
Java Tech Enthusiast
Written by

Java Tech Enthusiast

Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.