This article is a mirror article of machine translation, please click here to jump to the original article.

View: 35590|Reply: 9

[Source] . Net software engineer interview materials and frequently encountered questions

[Copy link]
Posted on 10/15/2015 7:41:38 PM | | | |
NET1Recursive algorithms and bubble sorting
2 PostandgetThe difference
3 .netoperating mechanism
4.netThe lifecycle of the page
5Several ways to pass value between two pages
6How to optimize large amounts of data in a database
7Write oneSqlStatement: Take out the tableAPassed the exam31Article to the first40record (SQL Server,to automatically growIDas the primary key,  Note:IDmay not be continuous).
8Given tabletable1,YesIDLastupdate
9 Ajaxcore object, andajaxHow to write
10How to prevent itsqlInjection
11Ado,netWhat are the common objects?
12How to understand delegation,Is an event a kind of commission?
13There is an arrayA, randomly inserted into this tree group100values, but cannot be repeated
14 What are the main object-oriented ideas? Its benefits?
15 Ado.netMethods and steps to handle data concurrency
16 What is a thing, what is a lock What is a deadlock?
17Maintain database integrity, consistency, do you prefer to use triggers or write your own business logic, and why
18 The difference between value types and reference types
19 Brief descriptionsoap
20 User space, custom controls The difference between server controls

Here is the information:
.NET葵花宝典-new.doc (1.59 MB, Number of downloads: 2, Selling price: 2 Grain MB) asp.net面试题.doc (137 KB, Number of downloads: 9, Selling price: 2 Grain MB) NET常见题目.docx (16.66 KB, Number of downloads: 1, Selling price: 2 Grain MB)





Previous:window under the visualSVN server library migration
Next:Lenovo's official blue screen fault detection tool
 Landlord| Posted on 10/15/2015 7:42:24 PM |
static class1() { count++; } public class1(){count++; }} class1 o1=new class1(); class1o2=new class1(), what is the value of o1.count?

Answer:

Static constructors are a new feature of C# that are not widely used in programming, and their main purpose is to initialize some static variables.
Because the constructor belongs to a class and not to any one instance, the constructor is executed only once, and is automatically called by .NET before creating the first instance of the class or referencing any static member.
This means that when you construct the first instance, which is o1, you need to execute the static constructor in addition to calling it. That is, the initial value of static data member count is 0. Class1 o1 = new Class1(); Then call the static Class1() function, count++ becomes 1, and then call public Class1() The function count++ becomes 2, Class1 o2 = new Class1(); After this sentence is executed, call public Class1() and the function count++ becomes 3. In addition, Baidu Encyclopedia has a specific introduction to static constructors.
Posted on 10/15/2015 8:36:01 PM |
1, try {}There is one in itreturnStatement, then follow thistryAfterfinally {}incodeWill it be executed, when will it be executed, inreturnBefore or after?
Will be executed, will bereturnExecuted before.
2, swtichWhether it can be effectivebyteon, whether it can act inlongon, whether it can act inStringon?
It cannot be used instringon
3. Whether the array is present or notlength()This method? StringDo you havelength()This method?
  Arrays don't have a length() method, there islengthattributes,stringYeslength() method.
4. How many ways can I send a request to a server?
Two types:postway, submit data to the server,getRequest data from the server.
5, <%# %>and<% %>What's the difference?
1.<%# %>is data binding, <%%>is data output
2.<%# %>will be treated as oneLiteralControls, While<%%>is written directly to the output stream
3.<%#%>atDataBindoutput data,While<%%>There is no such limitation.
6, string strTmp = "abcdefgso-and-so";
int i= System.Text.Encoding.Default.GetBytes(strTmp). Length;
int j= strTmp.Length;
After the above code is executed?
i=13,j=10
7. Describe itC #Can the implementation process of the indexer only be indexed based on numbers?
   Other types can be indexed
8, Please program to traverse all TextBox controls on the page and assign it a value to string.Empty?
foreach (System.Windows.Forms.Control control in this. Controls)
{
if (control is System.Windows.Forms.TextBox)
{
System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)control ;  
tb. Text = String.Empty ;
}
}

Posted on 10/15/2015 8:39:09 PM |
The rules for the number of columns are as follows: 1, 1, 2, 3, 5, 8, 13, 21, 34...... What is the 30th digit is to use the recursive algorithm.

public static int Foo(int i)
        {
            if (i <= 0)
                return 0;
            else if(i > 0 && i <= 2)
                return 1;
            else return Foo(i -1) + Foo(i - 2);
        }
Posted on 10/19/2015 10:51:25 PM |
    The full name of ajax is Asynchronous JavaScript and XML, where Asynchronous means asynchronous, which is different from the synchronization method used in traditional web development.

4. About synchronous and asynchronous

Asynchronous transmission is character-oriented transmission, and its unit is characters; Synchronous transmission is a bit-oriented transmission, its unit is zhen, and it requires the clocks of the receiver and sender to be consistent when transmitting.
Posted on 10/19/2015 11:01:05 PM |
1. Get is to get data from the server, and post is to send data to the server.
2. get is to add the parameter data queue to the URL pointed to by the ACTION attribute of the submitted form, and the values correspond to each field in the form, which can be seen in the URL. post is the HTTP post mechanism to place each field in the form and its content in the HTML HEADER to the URL address indicated by the ACTION attribute. Users don't see the process.
3. For the get method, the server side uses Request.QueryString to obtain the value of the variable, and for the post method, the server side uses Request.Form to obtain the submitted data.
4. The amount of data sent by get is small, and cannot be greater than 2KB. The amount of data transmitted by post is large, and it is generally defaulted to unlimited. But theoretically, the largest amount in IIS4 is 80KB, and in IIS5 it is 100KB.
5. Get security is very low, post security is high. But the execution efficiency is better than the Post method.

Recommendations:
1. The security of the get method is worse than that of the Post method, if it contains confidential information, it is recommended to use the Post data submission method;
2. When doing data query, it is recommended to use the Get method; When adding, modifying or deleting data, it is recommended to use the Post method;

Posted on 10/19/2015 11:03:50 PM |
case when 1<2 then 'yes' else 'no' end

Equivalent to your ternary operator 1<2? 'yes':'no'

?

SELECT t_sys_dlxxb.id,
t_sys_dlxxb.dldm,
t_sys_dlxxb.lkh,
t_sys_dlxxb.lm,
t_sys_dlxxb.xzqm,
t_sys_dlxxb.xzqh,
t_sys_dlxxb.lkldm || (case when t_sys_dlxxb.zddl is not null then '('|| t_sys_dlxxb.zddl||')' else t_sys_dlxxb.zddl end),
t_sys_dlxxb.pysx,
t_sys_dlxxb.xtsx,

FROM t_sys_dlxxb
Posted on 10/19/2015 11:16:18 PM |





 Landlord| Posted on 10/19/2015 11:40:48 PM |

One. Fill in the blanks
1. Object-oriented languages have (inheritance), (polymorphism), and (encapsulation).

2. Objects that can be accessed with foreach need to implement the type of IEnumberable interface or declaration (GetEnumberator) method.

3. List the five main objects in the ADO.net (Command), (Connection), (DataReader), (DataSet), and (DataAdapter).

4. The ternary operator in C# is __(?:)__

5. When the integer a is assigned to an object, the integer a will be __(boxed)___

6. Class members have __(3)__ accessible forms

7.float f=-123.567F; int i=(int)f; The value of i is now _(-123)__

8. The keyword for delegate declaration is ___( delegate) _

9. All custom user controls in the Asp.net must be inherited from (System.Web.UI.UserControl)

10. In .Net, all serializable classes are marked as __[serializable]___

11. In .Net managed code we don't have to worry about memory vulnerabilities because of the GC

12. When class T only declares a private instance constructor, then outside of the program text of T, a new class from T cannot be derived from T, and any instance of T can not be created directly.

Two. Multiple-choice questions
1. The following statement is correct: BC
A. There can be virtual methods in the interface. B. A class can implement multiple interfaces.
C. Interfaces cannot be instantiated.   D. Implemented methods can be included in the interface.

2. To read records from the database, you may use BCD
A. ExecuteNonQuery     B. ExecuteScalar
C. Fill                 D. ExecuteReader

3. For a class that implements the IDisposable interface, which of the following can be executed to release or reset the non-custodial funds
Related application-defined tasks? (Multiple choice)   (   ABC    )
A.Close    B.Dispose   C.Finalize   D.using  E.Quit

4. Which of the following descriptions of ref and out is correct? (Multiple choice)   (    ACD   )
    A. With ref parameters, the parameters passed to the ref parameter must be initialized first.  
    B. Using the out parameter, the parameter passed to the out parameter must be initialized first.   
    C. With ref parameters, the parameters must be explicitly passed to the method as ref parameters.  
    D. With the out parameter, the parameter must be explicitly passed to the method as an out parameter.

5. When operating with SQL Server databases, (A) should be selected.
   A.SQL Server .NET Framework data provider;
B.OLE DB .NET Framework data provider;
C.ODBC .NET Framework data provider;
D. Oracle .NET Framework data provider;

6. Among the following options, (C) is the reference type.
   A.enum type B.struct type C.string type D.int type

7. The description of the code hidden file in the ASP.NET is correct (C)
   A. The logic of the program of the web form page consists of code, which is created to interact with the form. The programming logic is uniquely different from the user interface. This file is called a "code-hidden" file, and if created in C#, it will have a ".ascx.cs" extension.
B. The code-hidden files for all web forms pages in the project are compiled into .EXE files.
C. The code-hidden files of all web forms pages in the project are compiled into project dynamic link library (.dll) files.
D. None of the above is true.

8. The following description is incorrect (A)
A. Abstract classes are supported in C++, but not in C#.
B. Members of a class can be declared in a header file in C++ and members of a class can be defined in a CPP file, and in C# there is no header file and members of a class are declared and defined in the same place.
C. In C#, you can use the new modifier to explicitly hide members inherited from the base class.
D. In C#, to redefine the virtual function of the base class in the derived class, it must be preceded by Override.

9. The data types of C# are (B)
   A. Value types and call types B. Value types and reference types
C. Reference and Relationship Types D. Relationship Types and Call Types

10. The following description is incorrect (D)
A. Classes cannot be inherited multiple times, but interfaces can
B. Abstract classes can define members themselves, but interfaces cannot
C. Neither abstract classes nor interfaces can be instantiated
D. A class can have multiple base classes and multiple base interfaces
11. In the DOM, the method of loading an XML document (D)
    A.save method B.load method C.loadXML method D.send method

12. The following description of the constructor is correct (C)
A. The constructor can declare the return type.
B. Constructors cannot be modified with private
C. The constructor must be the same as the class name
D. Constructors cannot have parameters

13. Here are some definitions of enums in C#, where the wrong usage is (A)
A.public enum var1{ Mike = 100, Nike = 102, Jike }
B.public enum var1{ Mike = 100, Nike, Jike }
C.public enum var1{ Mike=-1 , Nike, Jike }
D.public enum var1{ Mike , Nike , Jike }

14.int[][] myArray3=new int[3][]{new int[3]{5,6,2},new int[5]{6,9,7,8,3},new int[2]{3,2}}; myArray3[2][2] has a value of (D)
     A.9 B.2 C.6 D. Crossing the line

15. An interface is a reference type in which (A) can be declared, but not a public domain or a private member variable
A.. Methods, Attributes, Indexers, and Events B. Methods, Attribute Information, Genus
C. Indexers and fields D. Events and fields;

16.ASP. In the .NET framework, server controls are specifically designed to work with web forms. There are two types of server controls, they are (A)
   A.HTML and Web Controls B.HTML Controls and XML Controls
C.XML and Web Controls D.HTML and IIS controls

17.ASP. .NET, register a user control on the web forms page, specify the name of the control as "Mike", and the correct registration instruction is (D)
A.<%@Register TagPrefix = “Mike” TagName = “Space2” Src = “myX.ascx”%>
B.<%@Register TagPrefix = “Space2” TagName = “Mike” Src = “myX.ascx”%>
C.<%@Register TagPrefix = “SpaceX” TagName = “Space2” Src = “Mike”%>
D. None of the above is true

18. In ADO.NET, for the ExecuteNonQuery() method and the ExecuteReader() method of the Command object, the error described below is (C)
   A. Sql statements such as insert, update, delete and other operations are mainly executed by the ExecuteNonQuery() method;
B. ExecuteNonQuery() method returns the number of lines affected by executing the SQL statement.
C.Select operation Sql statement can only be executed by the ExecuteReader() method;
D.ExecuteReader() method returns a DataReder object;


19. The following ASP.NET statement (B) correctly creates a connection to the SQL Server 2000 database.
    A. SqlConnection con1 = new Connection(“Data Source = localhost; Integrated Security = SSPI; Initial Catalog = myDB”);
B. SqlConnection con1 = new SqlConnection(“Data Source = localhost; Integrated Security = SSPI; Initial Catalog = myDB”);
C. SqlConnection con1 = new SqlConnection(Data Source = localhost; Integrated Security = SSPI; Initial Catalog = myDB);
D. SqlConnection con1 = new OleDbConnection(“Data Source = localhost; Integrated Security = SSPI; Initial Catalog = myDB”);

20. In Winform, the description of the properties and events of the ToolBar control is incorrect (D)
A. The Buttons property represents all toolbar buttons for the ToolBar control
B. The ButtonSize property indicates the size of the toolbar buttons on the ToolBar control, such as height and width
C. The DropDownArrows property indicates whether the down arrow key is displayed next to the toolbar button (which has a column of values that need to be displayed as a drop).
The D. ButtonClick event is triggered when the user clicks anywhere in the toolbar

21. When executing a stored procedure in ADO.NET, if you want to set the output parameters, you must set the direction of the parameters and (D) at the same time, and set the parameter size if necessary.
   A. Size; B. Upper limit; C. Initial value; D. Type

22. If you set the form's FormBoderStyle to None, then (A).
A. The form cannot be resized without a border; B. The form has no border but can be resized;
C. The form has a border but cannot be resized; D. The form is transparent;

23. If you want to set the form to transparent, then (B)
    A. To set the FormBoderStyle property to None; B. To set the Opacity property to a value less than 100%;
C. To set the locked property to True;        D. To set the Enabled property to True;

24. The following is the correct understanding of indexers in C# (B/C)
    A. The indexer must have two or more parameters B. The indexer's parameter type must be integer
C. The indexer has no name D. None of the above

25. The following description is incorrect (C/D)
    A. Forms are also controls; B. Forms are also classes; C. Controls are inherited from forms; D. The parent class of a form is a control class

26. To operate on the registry, it must contain (D)
    A.System.ComponentModel namespace; B.System.Collections namespace;
C.System.Threading namespace; D.Microsoft.Win32 namespace;

27. To create a multi-document application, you need to set the (D) property of the form to true.
    A.DrawGrid;    B.ShowInTaskbar;     C.Enabled;     D.IsMdiContainer;


28. If you set treeView1=new TreeView(), treeView1.Nodes.Add("root node") returns a value of type (A).
   A.TreeNode;  B.int;  C.string;  D.TreeView;

29. The following description of XML is incorrect (D)
A.XML provides a way to describe structured data;
B.XML is a simple, platform-agnostic, and widely adopted standard;
C.XML documents can carry a variety of information;
D.XML only to generate structured documents;

30. Packing and unpacking operations occur in: (C)
    A. Between classes and objects B. Between objects and objects
C. Between reference type and value type D. Between reference type and reference type

31. If the user class wants to support the Foreach statement, the interface that needs to be implemented is: (A)
A.Ienumerable       B.Ienumerator    C.Icollection        D.IcollectData

What does the 32.Net Framework interact with COM components? (   C )
    A.Side By Side     B.Web Service    C.Interop     D.PInvoke

33..Net relies on which of the following technologies to solve the Dll Hell problem in COM? ( A   )
    A.Side By Side     B.Interop    C.Pinvoke      D.COM+

34. Are packing and unpacking operations mutually reversed? (  B  )
    A. Yes B. No

35. Which of the following is an array that can be lengthened? (  D  )
A.Array        B.string[]       C.string[N]        D.ArrayList

36. Which of the following user-defined exception classes needs to inherit from: (A)
    A.Exception  B.CustomException   C.ApplicationException  D.BaseException
Posted on 7/16/2017 7:29:37 PM |
Thanks for sharing the resources
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com