iFlytek Salary Offers Revealed + Comprehensive Java Interview Prep
The article shares iFlytek's recent campus salary packages, then dives into a detailed Java interview guide covering Redis data types, key expiration handling, thread safety, ThreadLocal usage, MySQL covering and composite indexes, slow‑query analysis, and SQL‑injection prevention techniques.
iFlytek Salary Offers
iFlytek's campus recruitment salaries have started to be disclosed. In Hefei, backend positions pay 20‑22k, 23‑25k, and 26‑29k (k * 14) with a 70% base + 30% performance bonus; 90% of employees can easily achieve the full bonus. Salary levels depend heavily on degree and school prestige.
Although the overall reputation of iFlytek is considered weak, candidates who want to stay in Hefei and lack better offers may still consider it.
Interview Experience Overview
When asked about internship experience, candidates should prepare a concise self‑introduction highlighting contributions, even if the internship involved mainly maintenance tasks. It is advisable to frame simple responsibilities as meaningful achievements.
Developed core order‑module workflow, ensuring precise order‑status transitions and data consistency with inventory and payment modules.
Implemented a behavior‑risk blacklist dashboard supporting view, batch block, and unblock operations.
Encapsulated a rate‑limiting component using Redisson + AOP to protect critical APIs such as paid services and course search.
Redis Data Types
Common Redis data types include five basic types—String, List, Set, Hash, Zset—and three special types—HyperLogLog, Bitmap, Geospatial. Their underlying implementations rely on eight data structures (SDS, LinkedList, Dict, SkipList, Intset, ZipList, QuickList, etc.).
Since Redis 3.2, List implementation switched from pure LinkedList/ZipList to QuickList (a combination of both). From Redis 7.0, ZipList is replaced by ListPack.
Additional structures such as Bloom filter and Bitfield are also available.
Handling Massive Key Expiration
Increased request latency : Expiring many keys at once consumes CPU, raising latency.
High memory usage : Expired keys occupy memory until fully deleted, possibly causing OOM.
Mitigation strategies:
Avoid clustering expirations; randomize TTLs.
Enable lazy free by setting lazyfree-lazy-expire yes in redis.conf, which deletes expired keys asynchronously.
Thread Safety
Thread safety ensures data correctness when multiple threads access the same data. Unsafe access can cause data corruption or loss.
Approaches to guarantee safety:
Prefer no sharing—use local variables or ThreadLocal for per‑thread copies.
If sharing is necessary, use immutable objects (e.g., String, final fields).
When mutable sharing is unavoidable, use concurrent collections ( ConcurrentHashMap, CopyOnWriteArrayList), atomic classes ( AtomicInteger, AtomicLong), or explicit locks ( synchronized, ReentrantLock), and coordination tools like CountDownLatch, Semaphore, CyclicBarrier.
ThreadLocal Mechanics
ThreadLocalprovides a per‑thread variable container. Each thread holds a ThreadLocalMap where the key is the ThreadLocal instance and the value is the thread‑specific data.
ThreadLocalMap(ThreadLocal<?> firstKey, Object firstValue) { /* ... */ }When multiple ThreadLocal objects exist in the same thread, they share the same ThreadLocalMap, each with its own key‑value pair.
Covering Index
A covering index contains all fields required by a query, allowing MySQL to retrieve rows directly from the index without a “back‑table” lookup.
If a query needs only the indexed columns, MySQL can fetch the data solely from the index, eliminating the extra row lookup.
Composite Index & Left‑most Prefix Rule
Creating a composite (union) index on score and name:
ALTER TABLE `cus_order` ADD INDEX id_score_name(score, name);The left‑most prefix rule means MySQL matches query conditions from the leftmost indexed column outward. Queries that omit the leftmost column cannot use the index.
Example prefixes for index (column1, column2, column3) are (column1), (column1, column2), and (column1, column2, column3). All queries containing these prefixes avoid full table scans.
Demonstration:
Create table student(id int, name varchar(100), class varchar(100)) and add index (name, class).
Test three queries:
# Can use index
SELECT * FROM student WHERE name = 'Anne Henry';
EXPLAIN SELECT * FROM student WHERE name = 'Anne Henry' AND class = 'lIrm08RYVk';
# Cannot use index
SELECT * FROM student WHERE class = 'lIrm08RYVk';Query analysis: a=1 AND c=1 uses only the a prefix of index (a,b,c), then filters c=1 manually. c=1 cannot use the index because the leftmost column a is missing. b=1 AND c=1 also cannot use the index.
MySQL 8.0.13 introduced Index Skip Scan (ISS) to allow certain non‑prefix queries to avoid full scans, though it has limited usefulness and a known bug (Bug #109145) fixed in later versions.
Analyzing Slow Queries
Use EXPLAIN SELECT … to inspect execution plans. Important fields include select_type, table, type (execution strategy), and rows (estimated rows scanned). Lower values indicate better performance.
mysql> EXPLAIN SELECT `score`, `name` FROM `cus_order` ORDER BY `score` DESC;SQL Injection & Defense
SQL injection occurs when user input is concatenated directly into SQL statements, allowing attackers to alter query logic.
String sql = "SELECT * FROM users WHERE username = '" + username + "' AND password = '" + password + "'";Typical bypass: entering admin' -- comments out the password check.
Defensive measures:
Use prepared statements ( PreparedStatement, MyBatis #{}) to separate SQL syntax from data.
Validate user input (e.g., email, phone formats).
Reference materials are listed at the end of the article.
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.
JavaGuide
Backend tech guide and AI engineering practice covering fundamentals, databases, distributed systems, high concurrency, system design, plus AI agents and large-model engineering.
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.
