Preparations before the interview --- C # knowledge Review ---- 02,
After a large number of resumes were delivered yesterday, we will receive interview invitations one after another. We will prepare for a battle tomorrow, so we will be able to survive and try again.
1. Database paradigm
This is an entry-level question, but all database classes have to be asked,
But we began to endorse the answer.
The attributes of the second Paradigm (2NF) with no duplicate columns in the first paradigm (1NF) depend entirely on the primary key [Removing the dependence of partial molecular functions] The third paradigm (3NF) attributes do not depend on other non-primary attributes. [transfer dependencies are eliminated.]
What else does BCNF seem to be very clear, but it seems to be ignorant if you don't.
Let's talk about my memory.
The first paradigm, 1NF, has no repeated columns, and fields are not redundant and necessary. This must be remembered
The second paradigm, 2NF, satisfies the first paradigm and the table must have a primary key
The third paradigm, 3NF, satisfies the second paradigm and the table must reference other tables through the primary key.
Is the above better? At this time, you thought the answer was completed and the interviewer caught it again. You mentioned the primary key.
Extended question: Principle of database primary key Creation
We often see the principle, what principle, not the ID we often use, self-growth, uniqueness, as if there is no principle.
In fact, we have noticed a lot in our daily work, but we don't know how to describe it.
You can read the following principles:Http://www.cnblogs.com/studyzy/p/3309350.html
The analysis is very thorough, especially 《Database primary key and business primary key. You can use this to have a good talk with the interviewer, so that you will have in-depth research on this and improve your own strength and image.
When it comes to the primary key, it will continue to develop to the index. Just ask which types of indexes A database has.
A) clustered indexes. Table data is stored in the order of indexes.
B) Non-clustered indexes. The table data storage sequence is irrelevant to the index sequence.
About Index: http://kb.cnblogs.com/page/45712/
Continue to ask about database optimization, horizontal partitioning, and vertical table sharding.
This can be referred to: http://www.cnblogs.com/yukaizhao/archive/2010/05/31/sql-server-table-split-partition.html
All of the above are just a few clicks. Students will just smile. Students who don't want to. If you want to, copy the link and check it to improve internal force.
Finally, we recommend an article on SQL Server High Performance writing: http://kb.cnblogs.com/page/156213/
2. Differences between the value type and the reference type in C #
Most of the time, because we didn't clarify this underlying problem, our program seems to be right, but the running results do not meet our expectations.
Baidu's article: http://jingyan.baidu.com/article/7082dc1c524b14e40b89bd6d.html
It vividly explains the value type and reference type as well as the heap and stack. If you still cannot remember the heap, the triangle-like image in the article is a heap shape, whether it is clear a lot.
Remember to add that the space allocated in the stack varies with the value types. The space allocated in the stack is the same for different reference types, and the space in the stack is different.
All value types of C # are implicitly derived from System. ValueType:
Such as Sbyte, byte, short, int, long, DateTime, ushort, unit, ulong, char, float, double, decimal, bool, struct, enum, and can be empty, such as int? Yes Value Type
Reference Type: array, class, interface, Delegate, Object, String
The exception is that a value-type instance is stored on the stack. However, when an instance of a class has a field of value type, the actual field will be kept in the same place as the instance of the class, that is, the stack. Is it suddenly tall?
Don't panic. This is just an entry. The interviewer started to expand.
Can String be inherited !!!
F12 we found that string is modified by sealed.
Bad English
Sealed: sealed,
The class or method modified by it cannot be inherited or overwritten.
You can extend the keyword to override, overload, and so on.
For more information about override and overload, see http://www.cnblogs.com/netlyf/archive/2009/09/08/1562642.html
There are also differences such as Final, finaly, and finallize.
Final modifier (keyword) If a class is declared as final, it means that it cannot generate a new subclass and cannot be inherited as a parent class. Therefore, a class cannot be declared both abstract and final. Declare variables or methods as final to ensure that they are not changed during use. Variables declared as final must be declared with an initial value, which can only be read and cannot be modified in future references. Methods declared as final can only be used and cannot be overloaded. In a word, when final modifies a class: A bachelor without an ancestor (cannot inherit or be inherited). When final modifies a variable or method, it is fixed and can only be used and cannot be changed.
Finally provides finally blocks for troubleshooting. If an exception is thrown, the matched catch clause is executed, and the control enters the finally block (if any)
3. finalize method name. Use the finalize () method to perform necessary cleanup before the Garbage Collector clears objects from the memory. This method is called by the garbage collector when it determines that this object is not referenced. It is defined in the Object class, so all classes inherit it. Subclass overwrites the finalize () method to sort system resources or perform other cleanup tasks. The finalize () method is called before the Garbage Collector deletes an object.
PS, from Network
Final is not a keyword in C #, but it often appears in the C # interview questions. For example, the difference between Final, Finally, and finalize is beyond the scope of C, the three keywords are evaluated by J # And #,.. Net fault tolerance method ,. net garbage collection mechanism, the strange thing is that every time I interview C # programmers, most people are familiar with the Final keyword. On the contrary, they answer the question first. Before coming to the interview, I have prepared some online courses.
The above is just a smile for bojun. Come on tomorrow!