1. Given a rectangular (cuboidal for the Puritans) cake with a rectangular piece removed (any size or orientation), how Wo Uld you cut the remainder of the cake into and the equal halves with one straight cut of a knife?
2. Given an array of size N in which every number is between 1 and N, determine if there was any duplicates in it. You is allowed to destroy the array if your like.
3. Write a routine to draw a circle (x * * 2 + y * * 2 = R * * 2) without making use of any floating point computations at Al L.
4. What's wrong with the following code?
char* Gethello ()
{string s= "Hello";
return s;
}
int main (int argc, char** argv)
{
printf ("%s", Gehello ());
}
Answer:gethello is returning local variable which is illegal outside the scope of it.
5. Find the nearest common parent for given, nodes in tree.
6. Write a routine that prints out a 2-d array in spiral order!
7. Given a list of numbers (fixed list) now Given any other list, how can efficiently find out if there is any elemen T in the second list, is an element of the first list (fixed list).
8 difference between ref and out
A variable passed as an out argument need isn't be initialized. However, the out parameter must is assigned a value before the method returns.
An argument passed to a ref parameter must first is initialized. Compare this to a ' out ' parameter, whose argument does not having to being explicitly initialized before being passed to an O UT parameter.
9 CLR, CTS, CLS
Clr:common Language Runtime It is above the operating system it's haveing jiterinside so it'll convert MSIL code into O perating system Nativecode.
Cts:it is haveing information of all the data types of different languages It is componet of the CLR
Cls:it is haveing set of rules of the different languages and their specifications It is also a component of CL
What is the CLR?
The. NET Framework provides a runtime environment called the Common Language Runtime or CLR (similar to the Java Virtual M Achine or JVM in Java), which handles the execution of code and provides useful services for the implementation of the pro Gram. CLR takes care of code management at program execution and provides various beneficial services such as memory management, Thread management, security management, code verification, compilation, and other system services. The managed code, targets CLR benefits from useful features such as cross-language integration, Cross-language Excepti On handling, versioning, enhanced security, deployment support, and debugging.
What is CTS?
Common Type System (CTS) Describes how types is declared, used and managed in the runtime and facilitates cross-language Integration, type safety, and high performance code execution.
What is CLS?
The CLS is simply a specification, defines the rules to support language integration in such a, that programs Writt En in any language, yet can interoperate with one another, taking full advantage of inheritance, polymorphism, exceptions, and other features. These rules and the specification is documented in the ECMA proposed standard document, "Partition I Architecture",
What is strong name?
A name, consists of an assembly ' s identity-its simple text name, version number, and culture information (if provided) -strengthened by a public key and a digital signature generated over the assembly.
What is Application Domain?
The primary purpose of the AppDomain is to isolate a application from other applications. Win32 processes provide isolation by has distinct memory address spaces. This was effective, but it was expensive and doesn ' t scale well. The. NET runtime enforces AppDomain isolation by keeping control over the use of memory–all memory in the AppDomain is M Anaged by the. NET runtime, so the runtime can ensure that AppDomains does not access each other's memory. Objects in different application domains communicate either by transporting copies of Objects across application domain bo Undaries, or by using a proxy to exchange messages.
What's Global Assembly Cache (GAC) and what is the purpose of it?
Each computer where the common language runtime is installed have a machine-wide code cache called the global Assembly Cach E. The global assembly cache stores assemblies specifically designated to being shared by several applications on the compute R. Should share assemblies by installing them into the global assembly the cache is only if you are need to.
What's Reflection in. NET?
All. NET compilers produce metadata on the types defined in the modules they produce. This metadata was packaged along with the module (modules in turn was packaged together in assemblies), and can be accessed By a mechanism called reflection. The System.Reflection namespace contains classes that can is used to interrogate the types for a module/assembly.
What's the managed and unmanaged code in. Net?
The. NET Framework provides a run-time environment called the Common Language Runtime, which manages the execution of code and provides services, the development process easier. Compilers and tools expose the runtime ' s functionality and enable you to write code, that benefits from this managed execut Ion environment. Code that you develop with a language compiler that targets the runtime is called managed code; It benefits from features such as Cross-language integration, cross-language exception handling, enhanced security, Versio Ning and deployment support, a simplified model for component interaction, and debugging and profiling services
What is namespaces?
The namespace keyword is used to declare a scope. This namespace scope lets your organize code and gives you a-to create globally-unique types. Even if you don't explicitly declare one, a default namespace is created. This unnamed namespace, sometimes called the global namespace, was present in every file. Any identifier in the global namespace are available for use in a named namespace. Namespaces implicitly has public access and that is not modifiable.
What is the access-specifiers available in C #?
Private, Protected, Public, Internal, Protected Internal.
Advantage of ADO?
* ADO Does not Depend on continuously Live Connections
* Database Interactions is performed Using Data Commands
* Data Can be Cached in Datasets
* Datasets is independent of Data Sources
* Data is Persisted as XML
* Schemas Define Data Structures
What is Remoting?
The process of communication between different operating system processes, regardless of whether they is on the same comp Uter. The. NET Remoting system is a architecture designed to simplify communication between objects living in different Applica tion domains, whether on the same computer or not, and between different contexts, whether in the same application domain Or not.
White box and black box testing?
White Box testing strategy deals with the internal logic and structure of the code. White box testing is also called as glass, structural. In order to implement white box testing, the tester have to deal with the code and hence are needed to possess knowledge of Coding and logic
Black-box test design is usually described as focusing on testing functional requirements. The test Designer selects valid and invalid input and determines the correct output. There is no knowledge of the test object ' s internal structure
ValueType and reference in C #
Value Type:
In value type the value was stored on the stack and can be used directly. This means the copy of the value is stored and not the reference to the value. Value type cannot is NULL, the default value for this is zero [0]. Memory of variables in value type is automatically freed.
The value of value types is stored on the managed stack, and can be used directly. This means: The value is stored, and not a reference to the value. This also means, each value type have its own copy of the data. Reference Types on the other hand have a Reference to the data, and several variables can Reference the same data.
Reference Types
In contrast to value types, the value of a reference types was allocated on the heap.
This means the actual value was stored and not the copy of it. Reference type can be null and memory of the variables is not automatically freed, it needs a garbage collector to do th Is.
Delegate
Defines a reference type the can encapsulate one or more methods with a specific function prototype. Delegates provide the underlying mechanism (acting as a kind of pointer to member function) for events in the common Langu Age runtime component model.
Challenge it! C # test Development Engineer English question