Archive for the ‘answers’ Category

some javascript stuff

June 1, 2007
  1. What’s relationship between JavaScript and ECMAScript? – ECMAScript is yet another name for JavaScript (other names include LiveScript). The current JavaScript that you see supported in browsers is ECMAScript revision 3.
  2. What are JavaScript types? – Number, String, Boolean, Function, Object, Null, Undefined.
  3. How do you convert numbers between different bases in JavaScript? – Use the parseInt() function, that takes a string as the first parameter, and the base as a second parameter. So to convert hexadecimal 3F to decimal, use parseInt (“3F”, 16);
  4. What does isNaN function do? – Return true if the argument is not a number.
  5. What is negative infinity? – It’s a number in JavaScript, derived by dividing negative number by zero.
  6. What boolean operators does JavaScript support? – &&, || and !
  7. What does “1”+2+4 evaluate to? – Since 1 is a string, everything is a string, so the result is 124.
  8. How about 2+5+”8″? – Since 2 and 5 are integers, this is number arithmetic, since 8 is a string, it’s concatenation, so 78 is the result.
  9. What looping structures are there in JavaScript? – for, while, do-while loops, but no foreach.
  10. How do you create a new object in JavaScript? – var obj = new Object(); or var obj = {};
  11. How do you assign object properties? – obj[“age”] = 17 or obj.age = 17.
  12. What’s a way to append a value to an array? – arr[arr.length] = value;
  13. What is this keyword? – It refers to the current object.

Do U Really Know about ASP.NET

May 28, 2007

Everyone who writes code

  • Describe the difference between a Thread and a Process?
  • process can have multiple threads, thread share memory with each other but process doesn’t, can communicate with other thread without any intermediate but process has to,
  • What is a Windows Service and how does its lifecycle differ from a “standard” EXE?
  • window service runs in background and doesn’t have any user interface is can’t be handle or control by any user as it handle/control by service manager, can run automatically on OS boot doesn’t depend on user, good in service oriented architecture and long running process. it has simple lifecycle start from INIT event and then START event and then STOP and finally DISPOSE event
  • What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
  • What is the difference between an EXE and a DLL?
  • dll is unexecutable but exe is executable, faster than exe, , can only use by ref but exe can use independently, doesn’t have any entry point but exe does has Main() handled by OS
  • What is strong-typing versus weak-typing? Which is preferred? Why?
  • strong typing check type of object at compile time so minimize chances of run time error and increase performance but increase programmer work but on the other hand weak typing check type of object @ runtime so maximize chances of run time error but minimize chance of compile time error 😀 and reduce programmer work @ some extent. I PREFER strong typing coz of performance and less run time error chances.
  • Corillian’s product is a “Component Container.” Name at least 3 component containers that ship now with the Windows Server Family.
  • What is a PID? How is it useful when troubleshooting a system?
  • How many processes can listen on a single TCP/IP port?
  • What is the GAC? What problem does it solve?

Mid-Level .NET Developer

  • Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming.
  • Describe what an Interface is and how it’s different from a Class.
  • What is Reflection?
  • What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?
  • Are the type system represented by XmlSchema and the CLS isomorphic?
  • Conceptually, what is the difference between early-binding and late-binding?
  • Is using Assembly.Load a static reference or dynamic reference?
  • When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate?
  • What is an Asssembly Qualified Name? Is it a filename? How is it different?
  • Is this valid? Assembly.Load(“foo.dll”);
  • How is a strongly-named assembly different from one that isn’t strongly-named?
  • Can DateTimes be null?
  • What is the JIT? What is NGEN? What are limitations and benefits of each?
  • How does the generational garbage collector in the .NET CLR manage object lifetime? What is non-deterministic finalization?
  • What is the difference between Finalize() and Dispose()?
  • How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?
  • What does this useful command line do? tasklist /m “mscor*”
  • What is the difference between in-proc and out-of-proc?
  • What technology enables out-of-proc communication in .NET?
  • When you’re running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?

Senior Developers/Architects

  • What’s wrong with a line like this? DateTime.Parse(myString);
  • culture is not mentioned so could have problem in different cultures like if u DateTime dt = DateTime.Parse(“8/5/2000”) for english culture it would be “friday August/5/2000” but for french culture it would be “Tuesday May/8/2000”
  • What are PDBs? Where must they be located for debugging to work?
  • PDB is program database file which contains information about program in debug mode means contains program state and debugging information. it should be in bin\debug folder.
  • What is cyclomatic complexity and why is it important?
  • Write a standard lock() plus “double check” to create a critical section around a variable access.
  • What is FullTrust? Do GAC’ed assemblies have FullTrust?
  • GAC is Global Assembly Cache repository where public/global assemblies are kept to be accessible by different applications and GAC assemblies has Full trust which means your code is allowed to do anything in the framework, meaning that all (.Net) permissions are granted. Permission/Trust Level can be customize/change by using CASPOL 🙂
  • What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?
  • What does this do? gacutil /l | find /i “Corillian”
  • List all those assemblies of GAC, whose name contains Corillian
  • What does this do? sn -t foo.dll
  • What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
  • Contrast OOP and SOA. What are tenets of each?
  • How does the XmlSerializer work? What ACL permissions does a process using it require?
  • Why is catch(Exception) almost always a bad idea?
  • Somehow to use catch(Exception) is not bad idea but when we use only Catch(Exception) then it could be design flaw means can be consider bit bad idea coz every kind of exception would be caught by this but the prefered way is to use specialized exception or custom exception not to use only generic level of execptions.
  • What is the difference between Debug.Write and Trace.Write? When should each be used?
  • Debug.Write works when u r working in debugging mode or u may say in development phase but when the application goes in release mode means in deployment phase @ user end then Trace.Write works but if u also has use Debug.Write it doesn’t generate error in Release mode, compiler simply ignores
  • What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
  • Does JITting occur per-assembly or per-method? How does this affect the working set?
  • Contrast the use of an abstract base class against an interface?
  • interface is kind of pure abstract class. all contents (properties/methods/events) must be pure abstract and public and can’t be concrete but in case of abstract base class u can have concrete and private contents.
  • What is the difference between a.Equals(b) and a == b?
  • a.Equals(b) compares object type and a==b compare value of objects
  • In the context of a comparison, what is object identity versus object equivalence?
  • How would one do a deep copy in .NET?
  • Explain current thinking around IClonable.
  • IClonable interface is used to clone objects like constructor copy in c++
  • What is boxing?
  • Convertion of value type to ref type
  • Is string a value type or a reference type?
  • What is the significance of the “PropertySpecified” pattern used by the XmlSerializer? What problem does it attempt to solve?
  • Why are out parameters a bad idea in .NET? Are they?
  • Can attributes be placed on specific parameters to a method? Why is this useful?