Some Questions about "Parameters" may be asked during the interview ~, Questions and interviews
In this article, we will continue to talk about "Parameters". We know that the parameters include "default parameters", "optional parameters", "ref Parameters", "out Parameters", and "variable parameters".
Below are a few small questions that may be asked during the interview.
Q: When I pass parameters as follows, what is the final m value?
1 static void Main (string [] args) 2 {3 int k = 0; 4 5 Run (k ++, k ++, k ++ ); 6} 7 8 static void Run (int I, int j, int m) 9 {10 // The last m equals how many 11 consoles. writeLine (m); 12}
A: No matter whether the problem is not pediatric, since it has been asked and is in the parameter blog, of course, either directly add 2 or 0, if you are in
If you write k ++ directly in the local code area, then k = k; k = k + 1 is undoubtedly, that is, assigning values first and then auto-incrementing. If it is used as a parameter, is it the same?
The answer is in IL.
From the perspective of IL, we can see that even if the ++ operation is in the form of parameters, three add operations are executed in sequence, and then call our run method after the add operation is complete.
The final result is undoubtedly 2.
Q: I know that the default parameter is a new feature of C #4.0. Is it a syntactic sugar?
1 static void Run(int i = 4)2 {3 4 }
A: As you can say, we know that C # has A limit that the default value must be A constant value that can be determined during compilation. Since it is A constant value, this value must be
Will be embedded into the Assembly metadata, old rules, continue to look at the generated IL code.
If you observe it carefully, you will find two different places.
①: Opt in the parameter list. This parameter is actually indicated by the OptionalAtrribute mark on the compiler. Since it is a feature, it will also be embedded into the assembly.
In the metadata, let's look at its source code and find that there is nothing valuable, that is, to mark whether this parameter is optional.
② We will find that there is a param parameter. In fact, this parameter is a default value mark for the parameter by the compiler. continue to look at the source code.
Here we find that a constructor needs to pass a default value, which is taken from the defined constant value, that is, 4.
Therefore, it is indeed a syntactic sugar. In fact, the real code should be like this, but the assignment operation is assigned to the compiler.
1 static void Run(int i)2 {3 i = 4;4 5 //....6 }
Q: I know that Param has more semantics than int [] In some scenarios. For example, can the following code describe its implementation principles?
1 public class Program 2 {3 static void Main (string [] args) 4 {5 Add (new int [3] {1, 2, 3 }); 6 7 // is there a better semantic 8 AddRange (1, 2, 3 ); 9} 10 11 // <summary> 12 // The int [] array 13 // </summary> 14 // <param name = "nums" must be passed here"> </param> 15 static void Add (int [] nums) 16 {17 18} 19 20 /// <summary> 21 /// you can directly pass the data element value here, int [] 22 /// </summary> 23 // <param name = "nums"> </param> 24 static void AddRange (params int [] nums) not required) 25 {26 27} 28}
A: In the add scenario, the semantics increases A lot, and I also write less code. What if param is implemented? Continue
Check the IL code.
From the IL, we can see that the so-called caller, that is, AddRange (1, 2, 3); it has a new arr before the call, and
Add it to arr and then call the AddRange array. It can be seen that it is a syntactic sugar.
Okay, that's probably the case. It's late at night and it's time to go to bed.
Questions about the interview
Hello! Let me be more specific! It must be useful to you!
Top 10 general questions for interviews
Question 1: "Could you introduce yourself ?"
Suggestion: This is a must-have question for the interview. The content of the interview should be consistent with your resume, and the statement should be colloquial. The answer should be concise, with a clear logic and irrelevant content.
Question 2: "What hobbies do you have ?"
Suggestion: 1. Do not say you have no hobbies. 2. You can answer questions based on the positions you want to interview. For example, if you are interviewing editors, you can focus on literature hobbies and classical classics. 3. You can also talk about your personal interests. Do not be all similar to others (music or sports). 4. Answer the questions carefully. Do not be too broad. For example, do not say exercise, football or basketball.
Question 3: "Do I have any part-time job or social practice at school? Please pick one and talk about it. What do you learn from it ?"
Suggestion: if you have the deepest experience, highlight the problems you and your peers encountered in this practice and how to solve the problems, as well as their experiences, the answer should be as close as possible to the team collaboration and problem-solving thinking methods. The expression must be clear-minded and logically clear.
Question 4: "Do you think you have any shortcomings ?"
Suggestion: Honestly pick your own character or one or two other shortcomings, and emphasize that you are trying to correct and overcome them.
Question 5: "Why do you choose our company ?"
Suggestion: do a survey on the company's industry and the company's situation before the interview. You can answer this question from three perspectives: 1. Industry. 2. Company. 3. position. The industry can answer questions from positive trends and optimistic prospects of the entire industry. The company can answer questions from the company's corporate culture philosophy and your own career plans. The positions provided by the company provide you with a lot of space and platforms to answer your questions.
Question 6: "How do you understand your interview ?"
Suggestion: Try to have a certain understanding of your job title and function scope before the interview. Let's talk about the role this job plays in the company's architecture and the skills required to do a good job.
Question 7: "How will you start your work if I hire you ?"
Suggestion: 1. Emphasize that, because you are a fresh graduate, there are some shortcomings in experience, and you will learn from old employees with an empty mind. 2. We also need to emphasize that we will learn while thinking and exploring. 3. You can talk about your views and plans on the work.
Question 8: "Why must we hire you ?"
Suggestion: presents your self-confidence and provides a concise answer. For example, through this interview, I am more determined that I can show my talents in our position and grow with the company. (Note: here we use "Our company" instead of "your company", which gives the interviewer a good sense of intimacy)
Question 9: "You are a fresh graduate and lack of experience. How can you be competent for this job ?"
Suggestion: emphasize some experience you have learned during your previous part-time or practical activities, especially when you are willing to learn and have strong learning abilities.
Question 10: "What are your requirements for salary ?"
Suggestion: before the interview, you should first have an understanding of the current industry, the position and the average salary level of the company. Unless you think you are good or have a high requirement on the bottom line, it is more appropriate to raise the price according to the approximate market price (after all, it is a fresh graduates ). Generally, each company has its own employee's salary budget for the probation period. If it is not lower than your bottom line, we suggest you accept it. Learn something first and then reflect your own value.
I hope to accept it if you are satisfied! Thank you !!
Good luck !!
Which questions are frequently asked during interviews? Why not do it well in the past? How to answer some common questions?
Hello!
Analysis of common interview questions
I. Self-Introduction
In general, enterprises will first ask an open-ended question during the interview, giving job seekers the opportunity to freely introduce themselves. For example, "Why are you applying for this job", "Please introduce yourself", "What are your interests and hobbies", "apply for this job, what advantages and disadvantages do you think you have? "How do you do the job well.
To answer this kind of question, you just need to remember two key points:
1. The answer should closely follow the responsibilities and requirements of the post and be concise and objective as possible. We should focus on distinguishing and concise self-recommendation. For example, when you look at advertisements, you can only remember one advertisement. For a minute or two self-introductions, the interviewer can only remember one or two of your characteristics. When introducing yourself, objective facts are more credible than exaggerated discussions. For example, "I have analyzed the recruitment information of your organization, from ...... We can see that you want to recruit ...... (Job requirements), and I ...... (Its own advantages ). My goal is ...... (Career Planning), and your organization is ...... (Company needs) ";" through your (interviewer) Introduction just now, I think of a work experience ......"
2. self-introduction should not completely repeat the resume content. "My name is XXX. I majored in XX from XX School and graduated from an undergraduate course (specialist. In addition to the introduction you can see on your resume, I would like to talk about my expertise in XXX. My biggest feature is ...... (Based on job requirements )".
Ii. Doubt (challenge issues ).
Enterprises often examine the emotional intelligence of candidates by means of a sudden doubt: "We think you are too young/too old to be suitable for this job. What do you think "; "Tell me your shortcomings, OK?", "what do you think you lack when applying for this job", "Why do we hire you if your major is not the same?", etc.
It should be pointed out that, since enterprises come to an interview, they are an affirmation of their resumes. Suddenly, I want the applicant to state the reasons and refute them. Therefore, the answer must be calm, do not be emotional, tit for tat, to avoid the interviewer's dislike.
We may wish to start with "Your words have some reason, but not all of them. Pay attention to the justification. "After reading the recruitment advertisement of your company, I found that what you most value is ...... And I ...... (Hard work, proof of performance) ";" I won't say my disadvantage is that I am too invested in my work and don't pay attention to rest (smile, ease the interview atmosphere ). My biggest drawback is that senior managers are very nervous, extremely nervous, and sometimes even incoherent or even speechless. Even if you do not make any mistakes, you will be blushing. I guess this is a continuation of the teacher's phobias at school (note that the last sentence is enough for the interviewer to forgive you for this shortcoming )".
To answer a challenge question, sometimes we can switch our thinking to avoid conflicts. For example, when you are dealing with your own shortcomings, you can focus on your efforts to overcome these shortcomings and extend your advantages through the shortcomings.
Finally, I would like to give you another example that uses empathy for your reference: "If you say that your goal for the next five years will be a department supervisor, isn't that enough to squeeze my position out? How dare I use you ?" A job seeker replied, "My excellent job proves your ability to recognize people. When I became the supervisor, you have been promoted to the manager position for your performance ."
Iii. traps.
Trap problems sometimes place job seekers on a specific background: "Through your resume, we find that your professional skills are solid and your experience is rich. Here is a 'case ', please give your opinion ". Before talking about it, we recommend that you be modest: "A Little Bit knowledgeable, not proficient. We can discuss it together ". Leave yourself some room.
Sometimes, companies may ask "you should be contacted by many companies if you look at your resume". "Do you have a good time with your colleagues? Do you often contact me? "," Can you take the company's information (or the customer can pull it) "," Do you think the former leaders are fair to you? "and other issues. A simple answer is "yes", "no", "good", "bad", "yes", "no", "fair", or "unfair ", it is difficult to satisfy the interviewer. When answering these traps, you may wish to take a look at "Tai Chi ". For example, "maybe I can find a job with a higher salary, but the development prospects of your company are what I value most, and I think it is most important to cherish the existing talent, what do you think (return the problem to the other party and check if the other party has experienced interviewers) ";" it is impossible for each other ...... remaining full text>