Graduation season, ByteDance interview questions are welcome! (with answer)

 

Recently, I have received some interview questions from fans from different companies, such as ByteDance, Netease, Meituan, etc. I will sort it out for you when I have time. Maybe the interview will come in handy. I will give you the following aspects Organized:

  • Personal information: (work/internship experience, projects done, attitude and quality)
  • test thinking
  • Situational questions
  • computer network
  • operating system
  • Code/algorithm questions
  • Language (Python/Java)
  • linux
  • database

personal information

1. What is the company's testing process? / How did the testing work work? / How to start the test?

Check whether you are familiar with all aspects of the testing process. Have knowledge: software life cycle, bug life cycle, testing process.

The general process is requirements review meeting ---> test plan (test scope, time node, task assignment, test strategy, environment, risk assessment) ---> test case writing (test thinking), internal/project team review --- > Test execution (completion of development and compilation, testing): finding bugs, locating bugs, submitting and tracking bugs, multiple rounds of regression testing, the end of testing ---> sorting out test reports --> publishing online, online problem tracking.

You can make appropriate adjustments according to your company.

2. What projects have you done and what are you responsible for?

3. Details of each business deduction in the project?

4. Personal planning, how to understand the test position

5. The most challenging thing you have encountered in your life or work recently

test thinking

1. What test does the paper cup do?

Ask the interviewer: Are there any restrictions on the capacity, material, size, shape, and function of this water cup?

Interviewer: no limit

Me: Suppose this water cup is 100ml disposable paper water cup in the office

Functional testing, interface testing, usability testing, compatibility testing, security testing, performance pressure to think

Functional test: Can the water cup be filled with water normally without leaking? 100ml boundary value? Boiling cold water and hot water? Can it be degraded? ....

Interface test: Are the appearance color, design, logo, and interface text correct? .

Ease of use test: heat insulation, easy to hold? Is the mouth of the cup burr? Is the design ergonomic? ....

Compatibility test: gas/solid/liquid? Is it normal in different environments?

Safety test: material quality, whether it can prevent corrosion? Prevent collision, cut hands? Inhibit bacteria? ....

Performance pressure: How many times did you fall? Is it drop resistant? (different heights) extrusion (different angles), is it deformed?......

2. Red envelope test case?

3. How to test WeChat likes?

4. Design test cases for posting to Moments

5. How to design the page for receiving coupons?

6. Design a test case for Douyin video playback page?

7. Design test cases for the Douyin search interface?

8. How to test a bottle of mineral water?

9. For a project, there are additions, deletions, changes, and query interfaces, etc., how to test the interface?

Situational questions

1. How to troubleshoot video freezing

2. After opening the APP, the page is blank, how to troubleshoot the problem?

Answer:

  1. Make sure the network is normal and the URL address entered is correct
  2. View console requests and responses through browser debugging tools or packet capture tools such as fiddler,
  3. Check whether the request address and parameters are normal; whether the status code and response data returned by the background are normal
  4. Generally, after the above steps, the problem can be basically located. For example, if the console reports js exception or the like, it is a front-end problem; if the return status is 500, it is a back-end problem. You can check the server log synchronously to locate it.

3. Design a test case for the like function of WeChat. If you like it but the number of likes does not increase by one, where might the error be reported?

Answer: url positioning error, code error, disconnection operation network is not good, not updated, times limit

4. When the network is good, it is found that 404 occurs during data transmission. What do you think is the problem?

Generally speaking, there are several reasons:

  1. The Web site cannot be accessed on the requested port.
  2. Web service extension locking policy prevents this request.
  3. MIME mapping policy prevents this request
  4. The website has been updated and revised, but some partial sections continue to use the original modules, and the files called by the original modules have been deleted or transferred.
  5. Various script codes or CSS files that track access are invalid but the calling code still exists.
  6. Delete a directory directly
  7. Web page URL generation rules changed
  8. Web page file rename or move location
  9. Import link typos, etc.

5. After A sent a message to B, A saw that the message was sent, but B did not receive it, how to troubleshoot the problem?

6. Why is the webpage loading slow?

7. How to deal with conflicts with developers and how to solve problems encountered

8. What should you do if a bug development is not recognized as a bug?

First confirm whether the development environment is consistent with your own test environment (sometimes the development verifies the bug in the environment where they have updated the code, so the bug does not appear, but it will appear in the test environment), and confirm that it can be reproduced in the test environment, If it is confirmed that it is a defect, maintain effective communication with the development,

If it is a low-level suggested bug, you can first record it on the bug platform and keep the communication first;

If it is a problem with a high bug level, the expected results of the corresponding requirements document and the development instructions are more convincing; patiently explain the harm of the bug, and if it fails, find the product to confirm, confirm that it is a bug and indicate the situation and assign it to the developer again

9. You are testing, and the product team brings you an urgent test, what should you do?

10. What if the progress of colleagues cannot meet expectations and affect the overall progress?

11. What if the leader gives you an unfamiliar event, but it is urgent?

computer network

1. Introducing the OSI Model

The first layer: physical layer, function: use the transmission medium to establish, manage and release physical connections between communicating hosts, realize transparent transmission of bit streams, and provide data transmission services for the data synchronization layer

The second layer: data link layer, function: based on the bit stream provided by the physical layer, by establishing a data link connection, using error control and flow control methods, making the physical line with errors into an error-free data link

The third layer: network layer, function: through the routing selection algorithm, select the appropriate transmission path for the packet through the communication subnet, and realize the functions of flow control, congestion control and network interconnection

The fourth layer: transport layer, function: provide reliable end-to-end link and data transmission services for the processes of computers distributed in different geographical locations; the transport layer shields the details of the underlying data communication from the upper layer

The fifth layer: session layer, function: responsible for maintaining the establishment, management and termination of the connection between two session hosts, as well as the exchange of data

The sixth layer: presentation layer, function: responsible for data format conversion between communication systems, data encryption and decryption, data compression and recovery

The seventh layer: application layer, function: realize the communication process control between the application programs that work together

2. Why does TCP consume a lot of system resources

3. The difference between TCP and UDP

  1. connection-based vs. connectionless;
  2. Requirements for system resources (more TCP, less UDP);
  3. UDP program structure is relatively simple;
  4. stream mode and datagram mode;
  5. TCP guarantees data correctness, UDP may lose packets, TCP guarantees data order, and UDP does not.

4. How does TCP ensure reliable connection

5. How to implement the http session persistence function?

6. HTTP status code?

1XX: Notification. The 1XX series of response codes are used only when communicating with HTTP servers.

2XX: Success. A 2XX series of response codes indicates that the operation was successful.

3XX redirection. The 3XX series of response codes indicate that the client needs to do some extra work to get the resources it needs.

4XX: Client error. These response codes indicate a client error. Either there is a problem with the authentication information, or there is a problem with the representation format or the HTTP library itself. Clients need to correct themselves.

5XX server error. These response codes indicate an error on the server side.

7. HTTP long connection and short connection and their respective applicable scenarios?

8. What is the difference between get and post?

Get:

a. Generally, the request to fetch data from the server can be set to get mode

b. When passing parameters in the Get method, the parameters are generally spliced ​​directly on the url (for example: http://xxx?id=1&type=2)

c. The amount of parameter data that can be passed by the Get request method is limited (because the general parameters are spliced ​​on the url, and the browser has restrictions on the length of the url)

d. Get request is not as secure as post (relatively) because the data is directly spliced ​​on the url, but the execution efficiency of get is faster than post

Post:

a. Generally, the request to submit data to the server will be set to post mode

b.Post method to pass parameters generally puts the parameters in the request body instead of concatenating them in the url

c. The amount of data that can be submitted by the Post request method is not limited

Post request parameter passing is safer than get (relatively not absolute), but the execution efficiency of post is not as good as get.

9. The format of the post body?

10. header of http protocol

11. What are cookies and sessions, why use cookies and sessions?

12. DNS protocol and function?

13. Is the CA certificate in Https on the client side or on the server side?

operating system

1. What is the difference between a process and a thread?

A process is the smallest unit of resource allocation, and a thread is the smallest unit of program execution.
A process has its own independent address space. Every time a process is started, the system will allocate an address space for it and create a data table to maintain the code segment, stack segment and data segment. This operation is very expensive. Threads share the data in the process and use the same address space, so the cost of switching a thread by the CPU is much smaller than that of a process, and the cost of creating a thread is also much smaller than that of a process.
The communication between threads is more convenient. The threads under the same process share data such as global variables and static variables, and the communication between processes needs to be carried out by means of communication (IPC). However, how to deal with synchronization and mutual exclusion is the difficulty of writing multi-threaded programs.
But multi-process programs are more robust. As long as one thread of a multi-threaded program dies, the entire process also dies, and the death of one process will not affect the other process, because the process has its own independent address space.

2. Multi-thread and multi-process, and application scenarios?

3. Process communication method?

4. Memory leak?

5. Heap and stack?

Stack area (stack) - automatically allocated and released by the compiler, storing function parameter values, local variable values, etc. It operates like a stack in a data structure.
Heap area (heap) - generally allocated and released by the programmer, if the programmer does not release it, it may be reclaimed by the OS when the program ends.

6. Heap memory and stack memory?

7. What is deadlock and the conditions of deadlock?

8. What is the cause of the deadlock?

It can be boiled down to the following two points:

a. Competing resources

The resources in the system can be divided into two categories:

Deprivable resources mean that after a process obtains such resources, the resources can be deprived by other processes or systems. Both CPU and main memory are deprivable resources;

Another type of resource is the inalienable resource. When the system allocates this type of resource to a process, it cannot be taken back forcibly, but can only be released after the process is used up, such as tape drives and printers.

One of the competitive resources in the deadlock refers to the competition for inalienable resources (for example: there is only one printer in the system, which can be used by process P1, assuming that P1 has already occupied the printer, if P2 continues to require the printer to print, it will be blocked) resulting in
deadlock Competing resources in locks Another kind of resource refers to competing temporary resources (temporary resources include hardware interrupts, signals, messages, messages in the buffer, etc.), usually, if the order of message communication is improper, deadlock will occur

b. Illegal progress sequence between processes

If P1 keeps the resource R1, and P2 keeps the resource R2, the system is in an unsafe state, because the two processes move forward, and a deadlock may occur

For example, when P1 runs to P1: Request (R2), it will block because R2 is already occupied by P2; when P2 runs to P2: Request (R1), it will also block because R1 is already occupied by P1, so the process occurs deadlock

9. How to prevent deadlock,! Avoid deadlocks, checks for deadlocks?

One-time allocation of resources: allocate all resources at one time, so that there will be no more requests: (destruction of request conditions)

As long as one resource cannot be allocated, no other resources will be allocated to this process: (destroy please keep the condition)

Deprivable resources: that is, when a process obtains some resources but cannot obtain other resources, the occupied resources are released (breaking the inalienable condition)

Orderly resource allocation method: the system assigns a number to each type of resource, and each process requests resources in the order of increasing number, and releases the opposite (destroys the loop waiting condition)

Code questions, algorithm questions

1. decorator and write a decorator example ?

2. Find numbers that occur more than half of the time in an array

3. Space Complexity of Hash Table

4. Algorithm question: Given a string, find all repeated substrings.

5. Algorithm question: Depth traversal of the tree: while loop: stack, first enter the right subtree node, then enter the left subtree node.

6. Algorithm question: Give you a string to find out the palindrome string, design a use case for your algorithm

7. Algorithm question: Preorder traversal of binary tree

Python/Java basics

  1. Features of object-oriented languages?
  2. Deep copy vs shallow copy?

Data types are divided into two basic types and reference types

  1. Basic types: Basic types like Number, String, Boolean, etc.
  2. Reference types: Object and Array

Shallow copy just copies the reference address of the object, and the two objects point to the same memory address, so if any value is modified, the other value will change accordingly. This is shallow copy (for example: assign())

Deep copy is to copy the object and its value. Two objects modify any value and the other value will not change. This is deep copy

  1. Difference between python tuple and list

a=[] this is a list

b=() this is a tuple

Difference: The list can be modified but the tuple cannot be modified. For example, you can use append() to add elements to the list. Since the tuple is not modifiable, there is no problem of adding elements.

The same point: both lists and tuples are containers that contain a number of columns of objects, and both can contain elements of any type or even sequences.

  1. What does python reuse?
  2. What library functions have python used?
  3. To what extent is selenium used?
  4. python decorator, function, usage
  5. java: Let me talk about polymorphism, the difference between interface classes and abstract classes;
  6. Java/Python garbage collection mechanism?
  7. How do java and python create multi-thread and multi-process?

Linux

1. common commands

2. Print current folder files ls -al a all files l detailed information

3. Commands to query cpu and other conditions

Answer: The free command is a quick way to view memory usage, it is an overview of the information collected by /proc/meminfo.

The top command provides real-time resource usage statistics of running programs

The atop command is a monitoring command for the terminal environment. It shows the synthesis of various system resources (CPU, memory, network, I/O, kernel), and color-coded under high load

The htop command shows the real-time memory usage of each process. It provides reports on the resident memory size of all processes, total program memory size, shared library size, and more. Lists can be scrolled horizontally and vertically.

The ps command can display the memory usage of each process in real time.

The smem command allows you to count the memory usage of different processes and users based on /proc information. Analysis of memory usage can export graphs (such as bar charts and pie charts - only available in the GUI window).

The vmstat command displays real-time and average statistics covering CPU, memory, I/O, and more. For example, memory status, not only displays physical memory, but also counts virtual memory.

nmon is an ncurses-based system benchmarking tool that monitors the interaction patterns of CPU, memory, I/O, file system, and network resources. For memory usage, it can display information such as total/remaining memory and swap space in real time.

database

  1. How is the mysql storage engine implemented?
  2. Transaction concept and its characteristics?

concept:

1. Database transaction: A database transaction usually refers to a sequence of operations that read or write to a database.

It exists for two purposes:

  1. Provides a method for database operations to recover from a failure to a normal state, and at the same time provides a method for the database to maintain consistency even in an abnormal state.
  2. When multiple applications access the database concurrently, an isolation method can be provided between these applications to prevent each other's operations from interfering with each other.
  3. What is the difference between multi-table query, normal sql and stored procedure?
  4. Why should B-tree or B+ tree be used for the bottom layer and bottom layer of the index?
  5. What is the difference between B tree and B+ tree?
  6. Are you familiar with the database: How to build a table in the student course selection system to query the names of all students taught by a teacher?
  7. Take the name of the youngest student in each class in a grade?
  8. What is the difference between whereand having?

Answer:

used in different places

where can be used in select, update, delete and insert into values ​​(select * from table where ..) statements. having can only be used in select statements

The order of execution is different

The search condition of where is applied before executing the statement for grouping

The search condition of having is executed after the grouping condition

That is, if where and having are used together, where will be executed first, and after having

clauses are different

The conditional expression having in the where clause can be followed, but some expressions in the having clause cannot be followed; the having clause can use aggregate functions (sum, count, avg, max, and min), and the where clause Can't.

Summarize

1. The WHERE clause is used to filter the rows generated by the operation specified in the FROM clause.
2. The GROUP BY clause is used to group the output of the WHERE clause.
3. The HAVING clause is used to filter rows from the grouped results

  1. Inner join and outer join?

An inner join is a cross join with only conditions. According to a certain condition, the records that meet the conditions are filtered out, and the records that do not meet the conditions will not appear in the result set, that is, the inner join only connects the matching rows.

The result set of an outer join not only contains the rows that meet the join conditions, but also includes all the data rows in the left table, the right table, or both tables. These three cases are called left outer join, right outer join, and full join. outer join.

Left outer join, also known as left join, the left table is the main table, and all records in the left table will appear in the result set. For those records that do not match in the right table, they will still be displayed. The corresponding field values ​​on the right are NULL to fill. Right outer join, also known as right join, the right table is the main table, and all records in the right table will appear in the result set. Left joins and right joins are interchangeable, and MySQL does not currently support full outer joins.

  1. Deduplication of database fields?
  2. SQL statement to query the names of students whose scores are greater than 80 in each course?

SELECT Name FROM Student GROUP BY Subject Having MIN(Grade)>= 80

Guess you like

Origin blog.csdn.net/a448335587/article/details/131463914