Master Core Tech: DNS, TCP, Java, MySQL & SpringBoot Interview Essentials
This article combines a look at big‑tech work intensity with a comprehensive interview guide covering website request flow, DNS resolution, HTTP status codes, TCP four‑way handshake, Java abstract classes vs interfaces, HashMap vs ConcurrentHashMap, HashSet internals, MySQL functions, and SpringBoot startup steps.
Hello, I’m Xiao Lin. This month many internet giants opened their autumn recruitment, and candidates are curious about the actual work intensity at these companies.
Below is a re‑styled table summarising the overtime culture of major firms (e.g., Pinduoduo, ByteDance, Alibaba, Meituan, Tencent, JD.com). The table also reflects employee jokes that hint at real experiences.
Later, I share the Tencent Java first‑round interview questions, which focus on fundamentals such as computer networks and Java concepts.
Tencent (First Round)
1. What happens when you type a website URL?
Parse the URL to determine protocol and resource path; invalid parts are sent to a search engine.
Cache lookup: browser cache → hosts file → router cache → ISP DNS cache.
DNS resolution: if cache miss, query local DNS, then root, TLD, and authoritative servers to obtain the IP address.
Obtain MAC address: use ARP for same‑subnet hosts or gateway MAC for remote hosts.
Establish TCP connection with a SYN‑SYN/ACK‑ACK handshake.
If HTTPS, perform TLS four‑way handshake.
Send HTTP request and receive server response.
2. How does DNS resolve a domain name?
Client sends a DNS query for the domain to the configured local DNS server.
If the local DNS cache contains the record, it returns the IP directly.
Otherwise, the local DNS asks the root server, which points to the .com TLD server.
The TLD server returns the authoritative DNS server for the domain.
The authoritative server replies with the final IP address.
The local DNS returns the IP to the client, which can now connect.
Thus the DNS resolution process is complete.
3. What are the HTTP status code categories?
1xx – Informational responses (rarely used).
2xx – Successful responses (e.g., 200 OK).
3xx – Redirection (e.g., 301, 302).
4xx – Client errors (e.g., 404 Not Found, 405 Method Not Allowed).
5xx – Server errors (e.g., 500 Internal Server Error).
Common specific codes include 200, 301, 302, 404, 405, and 500.
4. Why does TCP use a four‑way handshake to close?
Client sends FIN, entering FIN_WAIT_1.
Server ACKs FIN, enters CLOSE_WAIT; the FIN is placed after any queued data.
Server reads remaining data, then sends its own FIN, entering LAST_ACK.
Client ACKs server FIN and enters TIME_WAIT.
Server receives ACK and moves to CLOSED.
After 2MSL, client also moves to CLOSED.
The server may still have data to send before its FIN, so the application decides when to close.
5. Differences between abstract classes and interfaces (Java)
Abstract class can have fields, constructors, and concrete methods; used when there is a clear inheritance hierarchy.
Interface defines a contract, can have only constants and abstract methods (Java 8+ allows default and static methods); a class can implement multiple interfaces.
Implementation keywords: extends for abstract class, implements for interface.
Abstract class can have instance variables; interface variables are implicitly public static final.
6. HashMap vs ConcurrentHashMap
JDK 1.7 version differences
Memory structure: HashMap uses a single array + linked list (or red‑black tree); ConcurrentHashMap uses an array of Segments, each a mini‑HashMap with its own lock.
Thread safety: HashMap is not thread‑safe; ConcurrentHashMap provides thread safety via segment locks (or CAS + synchronized in JDK 1.8).
Performance: HashMap is faster in single‑threaded scenarios; ConcurrentHashMap scales better under contention.
JDK 1.8 version differences
Both use array + linked list + red‑black tree; ConcurrentHashMap replaces segment locks with CAS and synchronized blocks.
Thread safety remains only in ConcurrentHashMap.
Performance: ConcurrentHashMap reduces lock granularity, improving concurrency.
7. Underlying implementation of HashSet
HashSet is backed by a HashMap. Elements are stored as keys in the internal HashMap with a constant dummy value ( PRESENT). This leverages HashMap’s O(1) average‑time operations and its guarantee of unique keys.
HashMap’s key uniqueness ensures HashSet elements are unique.
Hash table storage gives O(1) add, remove, and contains.
Iteration order depends on hash values.
8. Common MySQL functions
String functions
CONCAT(str1, str2, ...) – concatenates strings.
SELECT CONCAT('Hello', ' ', 'World') AS Greeting;LENGTH(str) – returns the length of a string. SELECT LENGTH('Hello') AS StringLength; SUBSTRING(str, pos, len) – extracts a substring.
SELECT SUBSTRING('Hello World', 1, 5) AS SubStr;Numeric functions
ABS(num) – absolute value. SELECT ABS(-10) AS AbsoluteValue; POWER(num, exponent) – exponentiation.
SELECT POWER(2, 3) AS PowerValue;Date & time functions
NOW() – current date and time. SELECT NOW() AS CurrentDateTime; CURDATE() – current date.
SELECT CURDATE() AS CurrentDate;Aggregate functions
COUNT(column) – count non‑NULL rows. SELECT COUNT(*) AS RowCount FROM my_table; SUM(column) , AVG(column) , MAX(column) , MIN(column) – standard aggregates.
SELECT SUM(price) AS TotalPrice FROM orders;9. SpringBoot startup process
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}main() creates a SpringApplication instance.
Run listeners are registered.
ConfigurableEnvironment is loaded and added to listeners.
ConfigurableApplicationContext is created and returned.
Spring container is refreshed, triggering auto‑configuration and bean instantiation.
10. Project discussion
Share a challenging project, the toughest problem encountered, analysis, and solution.
11. Hand‑written algorithm
Compress a string (example of a typical coding interview task).
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
IT Services Circle
Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
