2021秋招英文面经
2021-09-25 17:22:41
- Hashcode() vs Equals()
1 | Java equals() and hashCode() methods are present in Object class. So every java class gets the default implementation of equals() and hashCode(). |
- Override vs Overwrite (存疑)
1 | In Java, there is no overwrite keyboard, or we can say override is the same conception as overrwrite. Therefore, this is a question for C++. |
- How to make code scalable?
1 | From the aspect of code, it should be humongous. |
- Testing tactics you often use in your daily work
Black-box testing and white-box testing.
Black-box testing is also known as
- Garbage collection vs tradition memory management
- Memory leak
- CPU keep rising but ram maintain the same?
- How to fix slow tests suite -
- Identify flaky test
- Break the tests suite into several categories
- Mock response/testing data if needed. Reduce the external dependency when it comes to
Testing - Create more unit tests instead of integration test. Reuse dataset for integration test
- Difference between inheritance vs composition
- How do you speed up release cycle - Continuous deploymen
- Dependency injection
- What needs to be paying attention to when adding a new class into collection framework
- What is race condition vs deadlock?
- Given a function, when you keep divide by 10 to find out how many digits it has, what’s the time complexity of it? - log
- When does O(nlogm) is faster than O(n+m) - it depends on the the value of m, if m is huge, then obviously the first one is better. Otherwise the second one.
- How to handle thread pool exhaustion - Thread exhaustion happens when you create too many threads to handle requests, which eventually cause taking up too many
Resources. - How to test web service QPS when it scale up?
- Convert text to bytes and find the sentences between two new lines? What would be the problem?
- Under what circumstance you should not use java garbage collection?
- What are some pros and cons for predefined testing?
- How do you select dataset for testing?
- How do you test a shortest path?
- How to scale up a service from 1 tps to 1000 tps? Broad questions -
- Codewise - Find bottleneck and fix it.
- Hardware wise
- There are 200 servers with distributed system. There are some random system that would be down during a specific time. Why?
- What is same origin policy? How to overcome?
- The graph is showing you fluctuate 500 errors - Why is that?
- The graph is showing you fluctuate latency time - Why is that
- What is the most important object oriented programming principle for complex system? - Separation of concerns - Make everything one module and start from there
- Choose the most appropriate data structure for each problem type:
- A hierarchical file system model = …………………………
- An undo / redo history in an app = …………………………
- Orders to be processed in-order and sequentially = …………………………
- Boolean option flags in a memory constrained device = …………………………
- What are some potential reasons that the query is slow?
1
2
3
4
5
6
7SELECT *
FROM Deployment
WHERE Deployment.ApplicationId =
(SELECT ApplicationId
FROM Applications
WHERE Name = params.AppName)
AND Deployment.Timestamp < params.SinceTime - Your team is building a RESTful API of the following form, that returns the car history given the VIN number (which is a unique identifier of all registered vehicles).
- How would you benchmark the performance and load capacity of this API
System design: - How to show a Facebook post to this person’s friend
- If there are 100 servers running google doc, how do you utilize load balancer - Please talk about load balance strategy.