Back-end Engineer Job Hunting Record: Employment Strategies and Experience Sharing in Second-tier Cities

The content of this article comes from the contribution of "Promotion and Salary Increase" planet star friend , coordinates the second line, graduated last year, only has internship experience, no real project experience, after a period of self-study, looking for a job in Golang back-end development.

Let me tell you about the self-assessment of this friend:

  1. I had about 4 interviews in the second-tier cities last week, and I feel that I can answer the stereotyped essays well, because there are many interview questions in the planet.

  2. But asking questions about the project is very frustrating, or particularly frustrating, because there is no real one-year work experience, there are many things that I don’t know how to say, and I can’t stand scrutiny .

My feelings after I helped him do the interview review:

  1. The basics are indeed good, but the project experience is really stretching, and many concepts are not clear.

  2. A very important point: I am very unconfident, and when I encounter someone I don’t know how to do, I doubt myself and try to make up for it. You only have one year of work experience, can you know everything you want! ? No matter how many years of work experience you have, if you are not responsible for some things, you just don’t know how to do it. There is nothing shameful about it.

  3. If you are a confident candidate, will you know where your skill boundaries are? What I am responsible for, I am proficient in; what other people in the group are responsible for, I have cooperated. Some of them I know are in use, but I haven’t practiced them, but I can talk to you about my implementation ideas. If you let me do it, I will design it like this: blah blah blah…

Review interview

The following are some interview questions and answers based on his " one-year work experience ", hoping to inspire those who lack project experience.

This friend built a toB e-commerce SAAS platform in his former company. The business difficulty is not high, and he actually did not participate in much development work. He has no overall vision and does not know how to "open black". (We can not develop in real, but when we smoke with friends, we also talk about the technical difficulties of the project, so as to prepare for writing resumes in the future, so as to avoid being blind at that time~)

Q1

Q: You said that the service has been split, why should it be split, and what is the basis for the split?

First of all, our project is not a microservice architecture, but a middle platform architecture. The basis for splitting is to split from business and functional modules, and different groups develop different services. At present, we split them into: commodity services, order services, payment services, message services, and basic services.

Q2

Q: Which module is the page that interacts with the front end?

The overall project is designed with front and back ends separated, each module will interact with the front end, and Go writes services and interfaces.

(I'm just curious, what exactly does the interviewer want to ask...)

Q3

Q: You said that you are mainly responsible for the order module, so how is the status and circulation of this order realized?

We do this by:

  1. Order Status Definition: First, the different statuses of the order need to be defined. Common order statuses include: pending payment, paid, pending shipment, shipped, completed, canceled, etc. According to business needs, we can also define more order statuses according to the actual situation.
  2. Order flow: The status of the order will change with the user's operation and system processing. The flow of orders usually includes the following links:
    • Order: After the user places an order, the order status is pending payment.
    • Payment: After the user completes the payment, the order status becomes paid.
    • Delivery: The merchant performs delivery operations according to the inventory situation, and the order status changes to pending delivery.
    • Logistics update: After the merchant updates the logistics information, the order status changes to shipped.
    • Confirm receipt: After the user confirms the receipt, the order status changes to completed.
    • Cancel order: After the user or merchant cancels the order, the order status becomes canceled.
  3. Status change trigger: The change of the order status is usually triggered by the user's operation, the automatic processing of the system or the operation of the merchant. For example, after the user makes a successful payment, the system will automatically update the order status to paid; after the merchant delivers the goods, the system will automatically update the order status to shipped.
  4. Status transfer record: In order to track the change of order status, the transfer history of order status is usually recorded in the database. Every time the order status changes, information such as the corresponding status change time and operator will be recorded.
  5. Background management interface: In order to facilitate merchants to manage orders, a background management interface is usually provided for viewing order lists, processing order status changes, updating logistics information, and other operations.

Q4

Question: You said that after the order is completed, the message queue is connected to asynchronously update the inventory sales. If multiple customers place an order for a product, how to ensure that the product will not be sold more, and how to deal with it in a concurrent scenario, similar to two requests to buy at the same time a commodity.

Ensuring that items are not oversold is a common problem in concurrent scenarios. In order to solve this problem, the following measures can be taken:

  1. Inventory Control: When processing an order, it is necessary to control the inventory of the goods. In each order, it is necessary to check whether the inventory quantity of the product is sufficient, and if the inventory is insufficient, it is not allowed to continue to place an order. This can be achieved by using transactions in the database, ensuring accurate control of inventory under concurrent conditions.
  2. Lock mechanism: In a concurrent scenario, a lock mechanism can be used to ensure atomic operations on inventory. For example, you can use the database's row-level locks or optimistic locks to control concurrent access to the inventory. This ensures that when multiple requests access the inventory at the same time, only one request can successfully update the inventory, and other requests will wait or be processed accordingly.
  3. Message queue sequential processing: In the message queue, sequential processing can be used to ensure the processing order of orders. Even if multiple customers place an order for the same product at the same time, the message queue will send order messages to consumers in order for processing. This avoids race conditions in concurrency and ensures that orders are processed in order.
  4. Idempotent design: When processing orders, you can design idempotent operations, even if the same order request is processed multiple times, there will be no side effects on the system. This avoids duplication of orders, even if multiple requests arrive at the same time, they will only be processed once.

Through the combined application of the above measures, it can be guaranteed that the product will not be sold too much in the concurrent scenario. The specific implementation method will vary according to the system architecture and business requirements. During the design and implementation process, factors such as concurrency, performance, and data consistency need to be considered comprehensively.

For more solutions, please refer to the spike system design I shared before.

Q5

Q: Is this project going from 0 to 1 or is there already a complete project in normal iteration?

Not from 0 to 1, this project was developed in PHP before. We rewritten it in Go language.

Q6

Q: What is the user group like and how many users are there?

We are a Saas system. The customers I come into contact with are B-end customers, and we will work with technical support to solve some problems and needs reported by customers.

About a dozen B-end users are connecting, and the C-end users corresponding to B-end users are not very clear. Because our project supports privatization and independent deployment,

Q7

Q: Will orders be kept in a log, for example, how many orders are traded every day.

Can do persistent storage and store it in MySQL; can also do logs, and the company has colleagues who are responsible for data analysis. About a few thousand orders, I am mainly in charge of the product center, and I don't know much about the order part.

Q8

Q: Do you maintain your database yourself? What type of phone field is used to store it?

Yes, we can maintain our own locally developed database; if you want to modify the field information of the test library and the official library, you need to apply to the leader.

phone is 11-bit varchar

Q9

Q: Is it directly connected to the database during the usual development process, or is there a cache layer in the middle?

Some are directly connected and some are added to the redis cache layer. Different scenarios are handled in different ways.
For example, in the product center I am in charge of, the hot product interface will use cache.

The sale status of the product will not go to the cache, but directly query the database, and directly query the database according to the product specification and location selected by the user.

Q10

Q: You are talking about redis cache, when do you check the database?

Look at the scenario and specific requirements, as mentioned earlier:

The sale status of the product will not go to the cache, but directly query the database, and directly query the database according to the product specification and location selected by the user.

Q11

Question: In a scenario where a user purchases a product and the database crashes halfway through writing, how to ensure correct writing?

In the case of processing a user's purchase of an item, it is very important to ensure that it is correctly written to the database. In order to ensure the integrity and consistency of data, the following measures can be taken:

  1. Use transactions: put the operation of writing to the database in a transaction. A transaction is a set of atomic operations that are either all successfully committed or all rolled back. In the process of purchasing goods, you can put related database operations (such as creating orders, deducting inventory, recording transaction logs, etc.) in the same transaction. If an error occurs during transaction execution, the transaction can be rolled back to ensure data consistency.
  2. Database locking: When writing to the database, the locking mechanism of the database can be used to ensure the correct writing of data. For example, you can use row-level locks or table-level locks to control concurrent access to prevent multiple users from modifying the same piece of data at the same time. This ensures that data collisions do not occur during writes.
  3. Exception handling and retries: When writing to the database, exception handling is required, with appropriate retries in case of errors. For example, exceptions in database operations can be caught, and operations can be rolled back and retried until data is successfully written to the database.
  4. Data backup and recovery: Perform regular database backups and ensure the integrity and reliability of the backups. If a crash or data loss occurs during the writing process, the data can be restored through the backup to ensure the correctness of the data.
  5. Monitoring and alarming: Set up database monitoring and alarming systems to detect database abnormalities and faults in time, and take corresponding measures to repair them. This reduces the risk of data loss and allows potential problems to be dealt with promptly.

Q12

Q: In your project, in which scenarios can coroutines be used?

  1. Concurrent requests: In an e-commerce project, it may be necessary to send requests to multiple services at the same time, such as commodity inventory query, price calculation, logistics query, etc. Using coroutines, these requests can be sent concurrently, and the results can be aggregated and processed after all requests are completed, improving the efficiency and response speed of requests.
  2. Concurrent data processing: E-commerce projects usually need to process a large amount of data, such as order data and user data. Using coroutines can process these data concurrently, improving the efficiency of data processing. For example, coroutines can be used to concurrently read and write to a database for batch insertion or update of data.
  3. Asynchronous task processing: There may be some time-consuming tasks in e-commerce projects, such as sending emails, generating reports, and processing pictures. Using coroutines can convert these tasks into asynchronous operations, improving the concurrency and response performance of the system. For example, mail notifications for orders can be processed asynchronously using coroutines without blocking the execution of the main thread.
  4. Concurrent inventory update: In e-commerce projects, inventory update is an important operation. The use of coroutines can update the inventory concurrently, avoiding the performance bottleneck caused by the serial execution of the inventory update operation. By using coroutines, multiple inventory update requests can be processed at the same time, improving the efficiency of inventory updates.

Q13

Q: Can linux command operation be used? How to check the operation log at ordinary times? Is there still a special log library on the db?

The operation log of the management background can be directly viewed in the management background, and there is a table for recording.

Error logs and request logs are viewed by viewing log logs: for example, tail -f xxx.log

Also add:

  • cat: used to view the contents of the file, you can use the cat filename command to view the contents of the log file.
  • tail: Used to view the end of the file, you can use the tail filename command to view the latest content of the log file in real time.
  • grep: Used to search for specified strings in files, you can use the grep pattern filename command to search for specific content in log files.
  • less: It is used to view the content of the file by page. You can use the less filename command to view the content of the log file page by page.

In practical applications, logs are usually recorded in files, and the logs can be viewed and analyzed through the above commands. The location and naming of log files may vary for different applications and configurations.

In addition, some applications will record the logs in the database for easier query and analysis. These applications usually provide specialized logging libraries or tools for managing and querying log data. For example, Elasticsearch, Logstash, and Kibana (ELK Stack) are a set of commonly used log management and analysis tools, which can store log data in Elasticsearch and use Kibana for visualization and query.

Summarize

Personally, I think the above questions are relatively simple and more in line with the job search setting of "one year of work experience".

Why does this friend feel that there is no way to start, and it is not good? The reason lies in the lack of real project experience.

Either spend time trying to catch up on project experience, or find someone who understands to do more mock interviews for the project, this is the right way to find a job. Don't try to take shortcuts.

improve together

​It is difficult to do it alone, but it is easy to do it in groups. It is lonely to practice alone.

Welcome to join our small circle , practice deliberately together, and grow together!

WeChat ID: wangzhongyang1993

Official account: Programmer promotion and salary increase journey

You are also welcome to pay attention to my account , like, leave a message, and forward it. Your support is the biggest motivation for me to write more!

Guess you like

Origin blog.csdn.net/w425772719/article/details/132664840