Source: Alibaba Cainiao Java Internship Phone Interview Experience, Failed~!~
https://www.nowcoder.com/discuss/67251?type=2&order=0&pos=7&page=1
Java-specific questions removed
-
Is a user request handled by one thread per request on the server? After searching, I found there are two models: blocking and non-blocking. Nowadays, technology based on I/O multiplexing is generally used, like the Reactor pattern, which only needs one thread or a small number of threads to handle a large number of requests.
-
Server pressure handling strategies This is an even bigger question. After searching on Baidu, there are two points: caching and distributed systems. A netizen answered with message queues, which can alleviate situations with sudden large concurrent volumes.
-
Finding the top ten numbers among many numbers Can use a variant of quicksort
-
How is the time complexity of heap sort calculated? n×log n, which is n times, each time extracting from the heap bottom to top takes log n times
-
HTTP and TCP Not sure what specifically was being asked, perhaps the relationship?
-
Why are four steps needed to close a TCP connection (four-way handshake)? Two FIN+ACK, with unsent data inserted in the middle. In situations with delayed ACK.
Source: NetEase Internal Referral (C++/C Development) Offer Journey
https://www.nowcoder.com/discuss/3038?type=2&order=0&pos=15&page=4
- What forms of polymorphism exist in C++? Polymorphism is one interface with multiple implementations. Static polymorphism and dynamic polymorphism. Static polymorphism is implemented through generic programming, dynamic polymorphism is implemented through virtual functions.
- How is dynamic binding implemented? Static binding: compile-time binding, called through objects Dynamic binding: runtime binding, implemented through addresses Dynamic binding is implemented through virtual tables.
- What types of type conversions are there? C-style conversions, explicit type casting, implicit type conversion. C++ has four types of type conversions: static_cast, const_cast, dynamic_cast, reinterpret_cast. They are used for built-in static type conversion (int, float), removing the const property of a type, dynamic type conversion (must be parent-child classes), and reinterpreting types without substantive conversion (pointer forced conversion), respectively.
- Memory alignment principles The basic data type members of a structure must start aligned at integer multiples of the member size, structures as members must align at integer multiples of the widest data type. The size of a structure is aligned at integer multiples of its largest internal member.
- How are templates implemented? The compiler remembers the template name when encountering a template declaration. When called, it generates specific type code based on the parameter types passed to the template, then compiles it.
- Uses of pointers and const? Const type pointers, pointers to const type, const type pointers to const type.
- Virtual functions, pure virtual functions, virtual functions and destructors? Why should destructors be defined as virtual functions? http://liaoxl.github.io/blog/20131205/virtual-destructor/ According to this article, if defined as a virtual function and the child class also implements it, both the child class destructor and the parent class destructor will be called.
- Inline functions
- const and typedef
- What sorting algorithms are there? How is quicksort implemented? Best-case time complexity, average time complexity. Insertion, bubble, heap sort, merge sort, bucket sort, shell sort, quicksort.
- What is extern “C” used for? Mainly used to call programs written in C.
2017 Summer Internship C++ Interview Experience (Alibaba, NetEase Games, Tencent, etc.)
Source: https://www.nowcoder.com/discuss/23512?type=2&order=0&pos=20&page=2
- How is map implemented? What are the differences between red-black trees and AVL trees? Why do data structures like map and set use red-black trees for implementation? Have you heard of skip-list?
- Have you used vector.reserve()? How does the vector array grow?
- Are you familiar with map-reduce?
- Are you familiar with Linux? Directory permissions, what does 644 represent? What does executable permission for a directory represent?
- Do you regularly use vi? Are you familiar with common Linux commands? (like awk, grep, etc.) Have you used gdb for debugging?
- What are the differences between TCP/UDP? How is congestion control implemented? How is reliable transmission implemented? Applications of UDP? Reliable/Unreliable, Byte stream/Datagram, Connection-oriented/Connectionless, High overhead/Low overhead, With congestion control/Without congestion control, Full-duplex/Simplex The purpose of congestion control is to prevent sending data packets beyond the network’s capacity, involving all hosts and routers. Congestion control assumes packet loss occurs when data packets exceed the network’s capacity, so when sending data packets, it needs to start slowly, gradually reaching the network’s capacity, increasing the congestion window exponentially to the slow start threshold, then entering congestion avoidance state where the congestion window grows linearly until congestion occurs. If a data packet’s ACK is not received before the timeout timer expires, it’s assumed that congestion has occurred, then the slow start threshold is set to half the current window size, and the slow start algorithm is executed. If three duplicate ACK packets are received, it’s assumed the lost packet hasn’t been received, so the unacknowledged packet is retransmitted early rather than waiting for the timeout timer to expire - this is fast retransmit. In case of fast retransmit, the slow start algorithm isn’t executed; instead, the congestion window is set to the slow start threshold, then congestion avoidance is executed - this is fast recovery.
Author: Simon_ Link: https://www.nowcoder.com/discuss/23512?type=2&order=0&pos=20&page=2 Source: Nowcoder
Summary:
I think Alibaba focuses more on projects, distributed systems, and multithreading knowledge. NetEase Games seems to focus more on algorithms and C++. Tencent asks about everything, from C++ memory structure, RTTI, to network programming, to algorithm implementation for brain teasers. You can prepare better based on the company you’re applying to. Let’s work hard together.
Books I read before preparing for internships include “C++ Primer”, “Inside the C++ Object Model”, “Effective C++”, “The Annotated STL Sources”, “Coding Interviews”, plus some books on networking and operating systems. I also solved the first 120 problems on LeetCode.
Some advice for juniors and sophomores looking for C++ development internships:
- It’s best to go through C++ Primer several times before looking for internships. Make notes on things you don’t understand for future reference. When you read “The Object Model”, you’ll find that concepts you couldn’t understand in Primer will become clear. (For Primer study methods, I followed the first answer in https://www.zhihu.com/question/32087709)
- It’s also good to read “The Annotated STL Sources”. Interviewers love to ask about the underlying implementation or dynamic growth of vector, map, etc. It might be difficult to understand these concepts just by reading blogs and interview experiences.
- “Coding Interviews” covers algorithm questions for most companies’ first interviews. I think it’s best to understand each problem. The first 100 problems on LeetCode are indeed very classic, and you can reinforce your knowledge of binary search, hash, dynamic programming, binary trees, etc. through practice.
- For networking, TCP/IP Illustrated Volume 1 is essential, and if you have time, you can also read Unix Network Programming. If you have even more time, it’s best to read through Chen Shuo’s “Linux Multithreaded Server Programming” to gain an understanding of multithreading.
- The final piece of advice is to prepare as early as possible. During the resume submission and interview period, it’s only suitable to organize Nowcoder interview experiences and your own experiences, filling in knowledge gaps. After all, interview questions are random, and to perform better in interviews, it’s best to accumulate knowledge regularly.
C/C++ Backend Development Tencent Internship Spring Recruitment First Interview, Failed~
https://www.nowcoder.com/discuss/68508?type=0&order=0&pos=8&page=0
- The underlying implementation of vector. I talked a lot about this, so he asked what specific actions insert performs, what resize function calls, and expansion situations.
- Inter-process communication mechanisms Pipe, Named pipe (FIFO) Signal Message queue Shared memory Semaphore Socket
Alibaba Cainiao Network Second Interview
http://blog.csdn.net/caishenfans/article/details/44496581
-
Difference between fill and memset fill is an STL algorithm that calls the copy constructor; for basic types, it should directly copy bit by bit. memset is a C algorithm that copies byte by byte to the position pointed to by the original pointer.
-
C++ memory management methods RAII stands for Resource Acquisition Is Initialization It utilizes the guarantee that destructors of stack objects will be automatically called during stack unwinding to correctly release previously acquired resources. RAII only works properly if stack unwinding executes normally. Both function calls and normal C++ exception handling flow (exceptions within try-catch blocks) involve stack unwinding.
-
Implementation of smart pointers When another smart pointer copies the current smart pointer, the reference counter increments by 1. When assignment occurs between two smart pointers, the reference count of the object pointed to by the left pointer decrements by 1, and the right one increments by 1. At destruction, the reference count similarly decrements by 1. When the reference count reaches 0, the object is reclaimed. A set of operators is redefined: -> pointer, returns a pointer to the original pointer. Dereference *T, returns the dereference of the original pointer.
Alibaba Internship Phone Interview Experience, Over an Hour
https://www.nowcoder.com/discuss/3836
- What is a binary balanced tree, how to insert nodes, delete nodes, describe the key steps.
How Students Can Get an Alibaba Technical Offer: “Alibaba Internship Interview Experience (Successful)”
https://yq.aliyun.com/articles/6395
Alibaba C++ Development Internship Second and Third Interview Experience (Failed)
https://www.nowcoder.com/discuss/27801?type=2&order=3&pos=55&page=1
Internship Interview Summary
https://www.nowcoder.com/discuss/25302?type=2&order=3&pos=190&page=1
Zhihu and Nowcoder Summary
Alibaba C++ Development Internship Second and Third Interview Experience (Failed)
30 Interview Experiences for [Alibaba, Tencent, ByteDance] and 12 Other Companies in [C++ Direction]
Alibaba Campus Recruitment Internship First Interview Experience
Goodbye to Alibaba Autumn Recruitment
Baidu Three Interviews (Offer) && Alibaba Four Interviews (In Progress)
Non-Key University Junior Spring Recruitment Internship Interview Experience
Alibaba, Morgan, Nomura, Tencent, Microsoft, TuDuck Technology Interview Experience Sharing
Alibaba Four Interview Experiences + Successfully Received Offer
My 2016 Written Test and Interview Experience (For Next Year’s Juniors and Sophomores)