What are the collections of Session Object? Contents collection contains all the variables established for a session without using the tag. Static collection contains all the objects created What is the difference between ASP and HTML? Or Why ASP is better than HTML? - ASP executes code on the server side whereas the browser interprets HTML. - ASP can use any scripting languages - Gets feedback from the user and return information to the user - Create pages that will be customized to display only things that will be of interest to a particular user - Can edit contents of a web page by updating a text file or a database rather than the HTML code itself What are the event handlers of Application Object? Application_OnStart- This event will be fired when the first visitor hits the page. Application_OnEnd- This event runs when the server is stopped. Name some of the ASP components? Ad Rotator component- a way to manage advertisements on the web site. Content Linker component - a techn...
How do I simulate optional parameters to COM calls? You must use the Missing class and pass Missing.Value (in System.Reflection) for any values that have optional parameters. What do you know about .NET assemblies? Assemblies are the smallest units of versioning and deployment in the .NET application. Assemblies are also the building blocks for programs such as Web services, Windows services, serviced components, and .NET remoting applications. What’s the difference between private and shared assembly? Private assembly is used inside an application only and does not have to be identified by a strong name. Shared assembly can be used by multiple applications and has to have a strong name. What’s a strong name? A strong name includes the name of the assembly, version number, culture identity, and a public key token. How can you tell the application to look for assemblies at the locations other than its own install? Use the directive in the XML .config file for a given application. ...
Question: Please find out the least k numbers out of n numbers. For example, if given the 8 numbers 4, 5, 1, 6, 2, 7, 3 and 8, please return the least 4 numbers 1, 2, 3 and 4. Analysis: The naïve solution is sort the n input numbers increasingly, and the least k numbers should be the first k numbers. Since it needs to sort, its time complexity is O(n log n) . Interviewers will ask us explore more efficient solutions. Solution 1: O( n log k ) time efficiency, be suitable for data with huge size A data container with capacity k is firstly created to store the least k numbers, and then a number is read out of the n input numbers at each time. If the container has less than k numbers, the number read at current round (denoted as num ) is inserted into container directly. If it contains k numbers already, num canno...