JavaGuide Interview Preparation Guide

repository·master·Indexed 25 days ago

https://github.com/snailclimb/javaguide-interview

A curated collection of interview preparation materials for Java developers. It provides summarized interview questions covering core Java (Basics, Collections, Concurrency, JVM), computer science fundamentals (Networking, Operating Systems, Data Structures, Algorithms), databases and caching (MySQL, Redis), and system architecture (Spring, Spring Boot, Design Patterns, Distributed Systems).

Tokens
103.6K
Snippets
81
Records
475
Agent score
82%

What's inside javaguide-interview

  1. Overview of Redis Data Types

    master

    Redis provides several data types categorized into basic and special types:

    5 Basic Data Types:

    • String: Simple key-value pairs.
    • List: Linked lists of strings.
    • Set: Unordered collections of unique elements.
    • Hash: Maps between string fields and string values.
    • Zset (Sorted Set): Ordered sets where every member is associated with a score.

    3 Special Data Types:

    • HyperLogLog: Probabilistic data structure for cardinality estimation.
    • Bitmap: Bit-level operations on strings.
    • Geospatial: For storing and querying geographic coordinates.

    Other types include Bloom filter and Bitfield.

  2. Overview of JavaGuide Interview Preparation Guide

    master
    This repository is an interview preparation version of JavaGuide, specifically designed for rapid interview study. It provides summarized interview questions across various technical domains. For users with more preparation time, the full version at javaguide.cn is recommended for more detailed explanations. PDF downloads are available for offline reading and printing.
  3. Understand MySQL storage engine architecture

    master
    MySQL uses a pluggable storage engine architecture. This means storage engines are assigned at the table level, not the database level. You can configure different tables within the same database to use different engines (e.g., InnoDB for transactional tables and MyISAM for specific read-intensive tasks) to suit different requirements. You can also implement custom storage engines by following the standard MySQL interfaces.
  4. Understand API Gateway core responsibilities

    master

    An API Gateway acts as a unified entry point between clients and backend services. Its primary responsibilities are divided into two categories:

    1. Request Forwarding: Routing client requests to the correct target service. Typical functions include dynamic routing, load balancing, and protocol conversion.
    2. Request Filtering: Intercepting requests before or after they reach backend services. Typical functions include identity authentication, permission verification, rate limiting, circuit breaking, and logging.

    Using a gateway prevents code duplication, centralized management issues, and high maintenance costs across microservices.

  5. Understand the String Constant Pool

    master

    The String Constant Pool is a specialized area used to reduce memory consumption by avoiding duplicate String objects.

    • Mechanism: It uses a StringTable (implemented as a HashTable) to map string keys to their object references in the heap.
    • Configuration: The capacity can be adjusted via -XX:StringTableSize.
    • Evolution: In JDK 1.7 and later, the String Constant Pool was moved from the Permanent Generation to the Java Heap to allow for more efficient garbage collection.
  6. Understand WebSocket protocol

    master

    WebSocket is a full-duplex communication protocol based on TCP, allowing both client and server to send and receive data simultaneously. It is an application-layer protocol designed to overcome the limitations of HTTP's unidirectional communication.

    Common Use Cases:

    • Video danmaku (bullet chat)
    • Real-time message pushing
    • Real-time gaming
    • Multi-user collaborative editing
    • Social chatting
  7. Understand Operating System fundamentals

    master

    An Operating System (OS) is a software program that manages computer hardware and software resources. Its core component is the Kernel, which acts as a bridge between applications and hardware, managing memory, devices, file systems, and applications.

    Key distinctions:

    • Kernel vs. CPU: The Kernel is a software layer responsible for management (e.g., memory management), while the CPU is hardware responsible for executing instructions and computations.
    • 6 Major OS Functions:
      1. Process and Thread Management: Creation, destruction, blocking, waking, and inter-process communication.
      2. Storage Management: Allocation and management of memory and external storage (disks).
      3. File Management: Reading, writing, creating, and deleting files.
      4. Device Management: Handling requests/releases for I/O and external storage devices.
      5. Network Management: Configuring, connecting, and securing network communications.
      6. Security Management: User authentication, access control, and file encryption.
  8. Understand the Java Collection Framework hierarchy

    master

    The Java Collection Framework is primarily derived from two major interfaces:

    1. Collection interface: Used for storing single elements. It has three main sub-interfaces:
      • List: Stores ordered and repeatable elements.
      • Set: Stores unique (non-repeatable) elements.
      • Queue: Stores ordered and repeatable elements based on specific queuing rules.
    2. Map interface: Used for storing key-value pairs. It functions like a mathematical function $y=f(x)$, where the key is the input and the value is the output. Keys are unordered and unique, while values are unordered and can be repeated.
  9. Understand the relationship between Spring, Spring MVC, and Spring Boot

    master

    The Spring ecosystem consists of several interconnected modules:

    • Spring: The core framework providing essential features like IoC (Inversion of Control) via the Spring-Core module. Most other modules depend on this.
    • Spring MVC: A module within Spring designed for building Web applications using the Model-View-Controller architecture. It separates business logic, data, and display.
    • Spring Boot: An extension of Spring designed to simplify development by reducing configuration requirements and providing 'out-of-the-box' functionality. It uses Spring MVC for web applications but automates much of the setup.
  10. Understand PING working principle (ICMP)

    master

    The ping command operates at the Network Layer using ICMP. It utilizes two specific ICMP message types:

    • ICMP Echo Request (Type 8): Sent by the ping command to the target host.
    • ICMP Echo Reply (Type 0): Sent by the target host back to the source if connectivity is normal.

    If the target host is unreachable or if network administrators have disabled ICMP responses, the ping command will fail to receive a reply.

  11. Understand Spring IoC (Inversion of Control)

    master

    IoC (Inversion of Control) is a design philosophy where the responsibility for creating and managing objects is transferred from the application code to an external container (the IoC container, such as Spring).

    Traditional Approach: Class A manually creates an instance of Class B using the new keyword. IoC Approach: Class A requests an instance of Class B from the IoC container.

    Benefits:

    1. Reduced Coupling: Objects do not need to know the specific implementation details of their dependencies.
    2. Easier Resource Management: Simplifies managing object lifecycles, such as implementing singletons.
  12. Understand the Three Core Features of OOP

    master

    Object-Oriented Programming is built on three pillars:

    1. Encapsulation: Hiding the internal state (attributes) of an object and requiring all interaction to be performed through public methods (getters/setters). This protects data integrity.
    2. Inheritance: Allowing a new class (subclass) to acquire the properties and methods of an existing class (superclass). This promotes code reuse and establishes an "is-a" relationship.
    3. Polymorphism: The ability of an object to take on many forms. Specifically, a parent class reference can point to a subclass instance, and the JVM determines which method to execute at runtime based on the actual object type.