khanna sir interview

Upload: priteshp2

Post on 08-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 Khanna Sir Interview

    1/15

    PHP vs ASP

    1.

    ASP and PHP are both programming languages that are commonly used to createwebsites. Unlike the usual static html web pages, ASP and PHP websites are moredynamic and can allow users to interact and exchange information using the website'sdatabases.

    2 . ASP is the short term for Active Server Pages, a type of program that works withMicrosoft alongside IIS or Internet Information Server. ASP needs a Microsoft Server for the website to work. On the other, PHP or Hypertext Preprocessor, runs using Linuxor Unix server. The more updated PHP programs can now run on an NT server.

    3 .

    PHP programs can also run in Windows, Solaris, Unix and Linux while ASP can onlywork with Window-based platforms. Just recently, ASP can now run on a Linuxplatform given that there is an ASP-Apache program installed on its server.

    4 .

    If you were a programmer adept with the C++ language, you would probably be morecomfortable using PHP than ASP. PHP uses C/C++ as base language and most syntaxare similar to each other. Because a big chunk of programmers are still using C++language, PHP are by far more popular than ASP.

    5 .

    ASP is very much similar to the syntax and interface of Visual Basic programming.This is basically because Visual Basic is basically correlated with Microsoft productsand programs. So if you were a programmer, choosing between ASP and PHP wouldbasically depend on which language you are more adept with.

    6 .

    When it comes to costing and expenses, ASP programs needs to run on Windows withIIS installed on the server. You need to purchase both of these components in order for ASP to work. On the other hand, a PHP would only require running on a Linux server,which you can get at no cost.

    7 .

    PHP is very much flexible when it terms of database connectivity. It can connect toseveral databases of which the most commonly used is the MySQL. Note that MySQLwould not cost you a thing to use. But if you were to use ASP, you need to purchaseMS-SQL, which is a Microsoft product.

    8 .

    Loading speed is a big factor in maintaining a website. If you are particular aboutspeed, then you need to go with PHP. PHP codes runs much quicker than ASP basicallybecause it runs in its very own memory space while ASP uses an overhead server and isuses a COM based architecture.

    9 .

    In working with PHP, most tools associated with the program are mostly open sourcesoftware so you need not pay for them. As for ASP, you might need to buy additionaltools to work with its programs.

    10. Both PHP and ASP have its own advantages and disadvantages. It basically depends onwhich part of developing a website you are most concerned with. Are you worriedabout the cost of creating your website? Do you want to use a programming languagethat you are more familiar with? Do you want a more stable and faster website?Choosing between ASP and PHP basically depends on your own personal preference. It

    doesn't hurt to confer with other programmers or webmasters and research moreinformation on which programming would best fit the requirements of your website.

  • 8/7/2019 Khanna Sir Interview

    2/15

    PHP vs JSP

    PHP has a number of things going for it:

    y It is the most widely used Web development platform in the world;y The barrier to entry is really low;y All you need is a Web server (typically Apache) and an editor;y The fact that you can save files in your editor and click reload on your browser, to me, is

    a huge plus. Immediate feedback and greater productivity (imho);y There is lots and lots of information out there on PHP usage; andy PHP hosting is extraordinarily cheap.

    As for Java/JSP, it has a number of advantages:

    y Statically typed. Now I don't consider this a "win" against dynamic typing, they're justdifferent. But the fact is that if you mistype a variable name in Java it'll generate acompiler error;

    y There are a huge amount of third party libraries for Java Web development out there;y IMHO the modern Java Web development approach using, say, Spring (or other IoC

    container) is extremely robust;y Multithreaded and background processing are somewhat kludgy in PHP but far more

    natural in Java;y JSP allow you to define custom tags that can be quite powerful.

    Generally anything can be down by both the languages. Just while working with the WebApplications, PHP tends to do easy things the easy way and also manages difficult things in afairly decent manner. JSP, being built over Java, a generic OOP language, involves morestructure and coding.

    Generally by most of people who have worked on both platforms is production in PHP is quick as compared to Java. But maintenance of PHP code tends to be difficult due to lack of constraints on the developer for structuring the code. But this can be made over by followingproper coding guidelines.

    The lack of tooling for PHP is also many a times a concern.

    But overall, PHP is much better established with libraries, frameworks, patterns and code basefor general Web Dev, while javas base is much more standards oriented. For example we cantake the Portals. Java has a standard Portal Spec, while PHP has hundreds of Portals/Frameworks available not conforming to any standard.

  • 8/7/2019 Khanna Sir Interview

    3/15

    Sr. # Function / Feature JSP PHP 1. Programming

    ApproachCompletely object oriented

    Advantage: Clean code

    Disadvantage: Too descriptive

    Scripting with objectoriented support

    Advantage: Functional and quick coding, you can useOOP practices at your convenience

    Disadvantage: Mayget clumsy

    2 . String and datamanipulation

    Rich library, too much descriptiveand object oriented code.

    Rich functionality.Functional and easycoding.

    3. Web Orientedfeatures

    1.) Includes

    2 .) Mails

    3 .) File Uploads

    4 .) FormHandling

    5 .) Sessions

    Almost everything is built in or supported by libraries. Complicatedand too much of code.

    Inbuilt functionality.Easy to use functions,written for thespecific tasks

    4 . Database Accessfeatures

    Standard JDBC structure/ Use EJB/Struts framework built over JDBC.Descriptive and too much overheador boiler plate code involved. Usesthe same API for all databases usingJDBC drivers.

    Dedicated inbuiltlibraries for most of the commonly useddatabases. Very tightintegration withMySQL andPostGRESQL. Veryminimal boiler platecode required. Thelibraries and resultsare straight forwardand easy to use.

    5 . XML/XSL/XPATH Use standard SAX/DOM parsers. Toomuch boiler plate code involved.Well defined APIs and stableimplementations are available for XSL and XPATH

    SAX and DOMparsers available areeasy to use and to thepoint. Another library, Simple XMLprovides very easyOO approach tohandling XML data.XSL and XPATHfunctionality is also

  • 8/7/2019 Khanna Sir Interview

    4/15

    built in.6 . Extensibility Java Classes and Libraries. Runs in

    sandbox and hard JNI approachneeded to integrate with server programs.

    PHP/C/Any thingexecutable by theunderlying OSplatform. Can veryeasily interact withprograms on theserver. Very goodsupport for nativecode.

    7 . DynamicGraphics/PDF andbells and whistles

    Almost everything has a readymadelibrary

    Supported internallyor though libraries.

    8 . Web Services/SOAP Addon Libraries like Axis, JAX-WS,etc.

    In Built

    9 . Portals Spec JSR-1 68 and 286 (JavaSpecification Requests)http://jcp.org/en/jsr/overview

    Many different Portalframeworks

    ASP.NET vs. ASP

    ASP.NET has better language support, a large set of new controls, XML-based components,and better user authentication.

    ASP.NET provides increased performance by running compiled code.

    ASP.NET code is not fully backward compatible with ASP.

    New in ASP.NET

    y Better language supporty Programmable controlsy Event-driven programmingy XML-based componentsy User authentication, with accounts and rolesy Higher scalabilityy Increased performance - Compiled codey Easier configuration and deploymenty Not fully ASP compatible

    Language Support

    ASP.NET uses ADO.NET.

    ASP.NET supports full Visual Basic, not VBScript.

  • 8/7/2019 Khanna Sir Interview

    5/15

    ASP.NET supports C# (C sharp) and C++.

    ASP.NET supports JScript.

    ASP.NET ControlsASP.NET contains a large set of HTML controls. Almost all HTML elements on a page can bedefined as ASP.NET control objects that can be controlled by scripts.

    ASP.NET also contains a new set of object-oriented input controls, like programmable list-boxes and validation controls.

    A new data grid control supports sorting, data paging, and everything you can expect from adataset control.

    Event Aware Controls

    All ASP.NET objects on a Web page can expose events that can be processed by ASP.NETcode.

    Load, Click and Change events handled by code makes coding much simpler and much better organized.

    ASP.NET Components

    ASP.NET components are heavily based on XML. Like the new AD Rotator, that uses XML tostore advertisement information and configuration.

    User Authentication

    ASP.NET supports form-based user authentication, cookie management, and automaticredirecting of unauthorized logins.

    User Accounts and RolesASP.NET allows user accounts and roles, to give each user (with a given role) access todifferent server code and executables.

    High Scalability

    Much has been done with ASP.NET to provide greater scalability.

  • 8/7/2019 Khanna Sir Interview

    6/15

    Server-to-server communication has been greatly enhanced, making it possible to scale anapplication over several servers. One example of this is the ability to run XML parsers, XSLtransformations and even resource hungry session objects on other servers.

    Compiled CodeThe first request for an ASP.NET page on the server will compile the ASP.NET code and keepa cached copy in memory. The result of this is greatly increased performance.

    Easy Configuration

    Configuration of ASP.NET is done with plain text files.

    Configuration files can be uploaded or changed while the application is running. No need torestart the server. No more metabase or registry puzzle.

    Easy Deployment

    No more server-restart to deploy or replace compiled code. ASP.NET simply redirects all newrequests to the new code.

    Compatibility

    ASP.NET is not fully compatible with earlier versions of ASP, so most of the old ASP codewill need some changes to run under ASP.NET.

    To overcome this problem, ASP.NET uses a new file extension ".aspx". This will makeASP.NET applications able to run side by side with standard ASP applications on the sameserver.

    ASP ASP.NET

    ASP is interpreted.ASP.NETCompiled eventbase programming.

    Control events for text button can behandled at clientjavascript only.

    Since we haveserver controlsevents can handle atserver side.

    More error handling.

    ASP .NET has better language support, a large set of new controls and XML based

  • 8/7/2019 Khanna Sir Interview

    7/15

    components, and better user authentication. ASP .NET provides increased performance by running compiled code. ASP .NET code is not fully backward compatible with ASP. ASP .NET also contains a new set of object oriented input controls, like programmable listboxes, validation controls.A new data grid control supports sorting, data paging, and everything you expect from a

    dataset control.The first request for an ASP.NET page on the server will compile the ASP .NET code and keepa cached copy in memory. The result of this is greatly increased performance.ASP .NET is not fully compatible with earlier versions of ASP, so most of the old ASP codewill need some changes to run under ASP .NET. To overcome this problem, ASP .NET uses anew file extension ".aspx". This will make ASP .NET applications able to run side by side withstandard ASP applications on the same server.

    difference between java and asp.net

    The biggest difference between Java and .NET is the basic philosophy behind the languages.Java is a programming language designed to be run on many different platforms, and so uses acommon language which has to be compiled and run on different platforms (eg.windows, mac and linux). Microsoft, with their offering of .NET, takes on a differentapproach, by allowing you to program in any language you choose, but has compilers for manydifferent languages that generates a platform specific code (i.e. Microsoft or Windows).Therefore, Java can be used to write programs for many different operating systems, and .NETcan be used to make any programming language into a Windows program. This is all based onthe original design goals of the programming language, and has both advantages anddisadvantages over each other. For example, .NET would be good for integrating legacy codefrom different languages into a working program, when you don't want to re-write each pieceof code into the same programming language. Both .NET and Java are otherwise object-oriented programming languages, with their obvious syntax differences.

    Architecture wise the .NET byte codes gets transformed into a intermediatelanguage and cached as native code before execution. All most Java2programming is J2ME specific, but I don't think the Java2 VM Sun providesfor Windows does, one of our Java2 programmers told me that IBM has aJust-In-Time VM for Win32 that does do this, but it's commercial softwareand cost $$$ to license. The result of this is that .NET apps run faster than Java2 apps on Windows with the default Java2 VM provided by Sun.

    Also, Microsoft intermediate language is opened for language developers tobuild on (it's actually an Assembly Language that you can write in if you'dlike), so C#, VB.NET, COBOL.NET, J#, etc.. all are compiled into MIL

    (Microsoft Intermediate Language) if you wanted to create Pearl.NET youcould. The .NET VM (aka Common Language Runtime) was built primarily with the Win32API in mind and is closely knit to the Windows platform.Getting past this the .NET class libraries provide a bit more functionalitythan the class libraries provided by Sun (not much, just a bit though). thisis most just utility items (e.g. in .NET if you want to convert from onedata type to another theirs a static Convert class that works like a magicbox) there are things missing in .NET though (no Vector, but you can makeone pretty easy)

  • 8/7/2019 Khanna Sir Interview

    8/15

  • 8/7/2019 Khanna Sir Interview

    9/15

    assign a value to it, it cannot be changes.Initialization hereDim readonly x as integer In later codeX=100Now x can't be changed

    X=200 *********** Error **********Property SyntaxIn VB.NET, we anymore don't have separate declarations for Get andSet/Let. Now, everything is done in a single property declaration.This can be better explained by the following example.Public [ReadOnly | WriteOnly] Property PropertyName as DatatypeGetReturn m_var End GetSetM_var = valueEnd SetEnd PropertyExample:Private _message as StringPublic Property Message As StringGetReturn _messageEnd GetSet_message = ValueEnd SetEnd PropertyByVal is the default - This is a crucial difference betwen VB 6.0and VB.NET, where the default in VB 6.0 was by reference. Butobjects are still passed by reference.Invoking Subroutines In previous versions of VB, only functionsrequired the use of parentheses around the parameter list. But inVB.NET all function or subroutine calls require parentheses aroundthe parameter list. This also applies, even though the parameter list is empty.User-Defined Types - VB.NET does away with the keyword Type andreplaces it with the keyword StructurePublic Structure StudentDim strName as String

    Dim strAge as ShortEnd StructureProcedures and FunctionsIn VB6 all the procedure parameters are passed by reference (ByRef)by default. In VB.NET they are passed by value (ByVal) by default.Parantheses are required for calling procedures and functionswhether they accept any parameters or not. In VB6 functions returnedvalues using syntax like: FuntionName = return_value. In VB.NET youcan use the Return keyword (Return return_value) to return values or

  • 8/7/2019 Khanna Sir Interview

    10/15

    you can continue to use the older syntax, which is still valid.Scoping VB.NET now supports block-level scoping of variables. If your programs declare all of the variables at the beginning of thefunction or subroutine, this will not be a problem. However, thefollowing VB 6.0 will cause an issue while upgrading to VB .NETDo While objRs.Eof

    Dim J as Integer J=0If objRs("flag")="Y" thenJ=1End If objRs.MoveNextWendIf J ThenMsgbox "Flag is Y"End If In the above example the variable J will become out of scope justafter the loop, since J was declared inside the While loop.Exception HandlingThe most wanted feature in earlier versions of VB was its error handling mechanism. The older versions relied on error handlers suchas "On Error GoTo and On Error Resume Next. VB.NET provides us witha more stuructured approach. The new block structure allows us totrack the exact error at the right time. The new error handlingmechanism is refered to as Try...Throw...Catch...Finally. Thefollowing example will explain this new feature.Sub myOpenFile()TryOpen "myFile" For Output As #1Write #1, myOutputCatchKill "myFile"FinallyClose #1End tryEnd SubThe keyword SET is gone - Since everything in VB.NET is an object.So the keyword SET is not at all used to differentiate between asimple variable assignment and an object assignment. So, if you havethe following statement in VB 6.0Set ObjConn = Nothing

    Should be replaced asObjConn = Nothing.Constructor and Destructor The constructor procedure is one of the many new object-orientedfeatures of VB.NET. The constructor in VB.NET replaces theClass_Initialize in VB 6.0. All occurance of Class_Initialize inprevious versions of VB should now be placed in a class constructor.In VB.NET, a constructor is added to a class by adding a procedurecalled New. We can also create a class destructor, which is

  • 8/7/2019 Khanna Sir Interview

    11/15

    equivalent to Class_Terminate event in VB 6.0, by adding a sub-procedure called Finalize to our class. Usage of Return In VB.NET,we can use the keyword return to return a value from any function.In previous versions, we used to assign the value back with the helpof the function name itself. The following example explains this:Public Function Sum (intNum1 as Integer, intNum2 as Integer) as

    Integer Dim intSum as Integer intSum = intNum1 + intNum2Return intSumEnd FunctionStatic MethodsVB.NET now allows you to create static methods in your classes.Static methods are methods that can be called without requiring thedeveloper to create instance of the class. For example, if you had aclass named Foo with the non-static method NonStatic() and thestatic method Static(), you could call the Static() method like so:Foo.Static()However, non-static methods require than an instance of the class becreated, like so:Create an instance of the Foo classDim objFoo as New Foo()Execute the NonStatic() methodObjFoo.NonStatic()To create a static method in a VB.NET, simply prefix the methoddefinition with the keyword Shared.

    Oracle V ersions

    Since version 5, Oracle's RDBMS release numbering has used the following codes:

    Oracle5

    Oracle6

    Oracle7: 7.0.167.3.4

    Oracle8 Database: 8.0.38.0.6

    Oracle8 i Database Release 1: 8.1.5.08.1.5.1

    Oracle8 i Database Release 2: 8.1.6.08.1.6.3

    Oracle8 i Database Release 3: 8.1.7.08.1.7.4

    Oracle9 i Database Release 1: 9.0.1.09.0.1.5 ( patchset as of December 2003)

    Oracle9 i Database Release 2: 9.2.0.19.2.0.8 (patchset as of April 2007)

    Oracle Database 10 g Release 1: 10.1.0.210.1.0.5 (patchset as of February 2006)

    Oracle Database 10 g Release 2: 10.2.0.110.2.0.5 (patchset as of April 2010)

    Oracle Database 11 g Release 1: 11.1.0.611.1.0.7 (patchset as of September 2008)

    Oracle Database 11 g Release 2: 11.2.0.111.2.0.2 (patchset as of November 2010)

  • 8/7/2019 Khanna Sir Interview

    12/15

    List of Oracle Database Version Release.From Oracle1 to Oracle6 there was no release numbering.Since version 7, Oracle's RDBMS release numbering has used the following codes:

    Oracle7: 7.0.16 7.3.4Oracle8 Database: 8.0.3 8.0.6Oracle8i Database Release 1: 8.1.5.0 8.1.5.1Oracle8i Database Release 2: 8.1.6.0 8.1.6.3Oracle8i Database Release 3: 8.1.7.0 8.1.7.4Oracle9i Database Release 1: 9.0.1.0 9.0.1.5Oracle9i Database Release 2: 9.2.0.1 9.2.0.8Oracle Database 10g Release 1: 10.1.0.2 10.1.0.5Oracle Database 10g Release 2: 10.2.0.1 10.2.0.4Oracle Database 11g Release 1: 11.1.0.6

    Q uestion: What is the difference between Oracle 9 i and Oracle 10g. Whatdifferences are there in options between 9 i and 10g? I'm considering amigration to 10g and I need to get a list of all differences.

    Answer: Each release of Oracle has many differences, and Oracle 10g is a major re-write of the Oracle kernel from Oracle 9i. I keep a list of the differences andmake sure to see these important differences when migrating from 9i to Oracle 10g .While there are several hundred new features and other differences between 9i and10g, here are the major differences between Oracle9i and Oracle10g:

    y Major changes to SQL optimizer internalsy Oracle Grid computingy AWR and ASH tables incorporated into Oracle Performance Pack and Diagnostic Pack

    optionsy Automated Session History (ASH) materializes the Oracle Wait Interface over timey Data Pump replaces imp utility with impdpy Automatic Database Diagnostic Monitor (ADDM)y SQLTuning Advisor y SQLAccess Advisor y Rolling database upgrades (using Oracle10g RAC)y dbms_scheduler package replaces dbms_job for scheduling

    10 G supports grid computing, ASM (Automatic storage management) and Memorymanagement.

    Oralce 10g is higher version of 9i , Oracle 10g has added a follwoing features

    Transparent Data EncryptionAsync commitsCONNECT ROLE can not only connectPasswords for DB Links are encryptedNew asmcmd utility for managing ASM storageGrid computing - an extension of the clustering feature (Real Application Clusters)Manageability improvements (self-tuning features)

  • 8/7/2019 Khanna Sir Interview

    13/15

    Performance and scalability improvementsAutomated Storage Management (ASM)Automatic Workload Repository (AWR)Automatic Database Diagnostic Monitor (ADDM)Flashback operations available on row, transaction, table or database levelAbility to UNDROP a table from a recycle binAbility to rename tablespacesAbility to transport tablespaces across machine types (E.g Windows to Unix)New 'drop database' statementNew database scheduler - DBMS_SCHEDULERDBMS_FILE_TRANSFER PackageSupport for bigfile tablespaces that is up to 8 Exabytes in sizeData Pump - faster data movement with expdp and impdp.

    In Oracle 9i after drop we can't rollback but we can do it in 10g.Moreover, 10g has additional 149 features than 9i.

    Difference between 8 i and 9 i

    In 9i merge insert all case is introduced .

    In 9i newdatatype called timestamp

    In 9i you can moniter index using alter index monitering usage

    or

    u can check user_objects table from system user.

    In 9i new performance monitering tools called STATPACK .

    In 9i You can dynamically change init ora parameter using alter system scope=/path/of your spfile/pfile

    In 9i new concept for undo transaction called UNDO tablespace

    In 9i by default TEMP tablespace is considering while creating new oracle users

    In 9i new partition called LIST

    In 9i tablespace next extent can be managed automatically

    (1) In oracle 8i default tablespace is dictonary managed while in 9i it is locally managed.

    (2)Oracle 9i can support 512 PetaByte of data.

    (3)Oracle can supprt 10 000 concurrent users.

    (4)oracle 9i provides auto undo segment management.

    and there a lot difference in oracle 9i and 8i as 9i Support RAC Concept.

  • 8/7/2019 Khanna Sir Interview

    14/15

    Differences between .Net and Java include

    y J ava is from Sun, .Net is from Microsoft y J ava is a language plus a runtime, .Net is a runtime framework that supports multiple languages,

    Visual Basic and C# (the .Net language most similar to J ava) among them.y C# is very similar to J ava but a few years younger, and a bit nicer in some respects - it has a

    slightly simpler syntax for some common constructs.y J ava is more platform independent, it runs on several operating systems including Windows, Mac

    and Linux. .Net is primarily for Windows. Although the open source project Mono is developing amulti-platform runtime for .Net, so this is less of an issue than it used to be.

    y .Net has a more integrated development environment, as the IDE, runtime and server all come fromMicrosoft as a standard package, while J ava is based on third-party tool and server providers. Itused to be the case that the .Net development environment was clearly superior, but the differenceis smaller these days.

    y It can be argued that J ava gives more f lexibility, as there are more server- and IDE-providers tochoose from, at the cost of some extra overhead for the developer to get the different p ieces towork together.

    Functionality wise, there is not a lot of difference between the two, at least not when used todevelop web applications.

    For desktop applications, .Net naturally has an edge in Windows integration.note: Oracle bought Sun Microsystems (Sun).

    Java is platform independent, only thing we need is jvmonthe platform which comes in all operating systems bydefault,.net is also platform independent as it needsonly .net framework,but since m$ owns the copyright tothe .net framework api's,it becomes platform dependent

    In .NET due to disconnected data access through ADO.NET,has a high level performance against JDBC which requiresmultiple roundtrips to the data baseAnd Now a days MS people are saying that .NET cansupportmore than 40 languages.Its Majaor advantage is theVisualstudio.Net which is highly efficient than anyother IDE..

    ava has support to open source platform whilw .net has

    nodirect support for open source platform

  • 8/7/2019 Khanna Sir Interview

    15/15

    Java V ersions

    y JDK 1.0 (January 23, 1996)

    y JDK 1.1 (February 19, 1997)

    y J2SE 1.2 (December 8, 1998)

    y J2SE 1.3 (May 8, 2000)

    y J2SE 1.4 (February 6, 2002)

    y J2SE 5.0 (September 30, 2004)

    y Java SE 6 (December 11, 2006)

    o 7.1 Java SE 6 Update 10

    o 7.2 Java SE 6 Update 11

    o 7.3 Java SE 6 Update 12

    o 7.4 Java SE 6 Update 14

    o 7.5 Java SE 6 Update 15

    o 7.6 Java SE 6 Update 16

    o 7.7 Java SE 6 Update 17

    o 7.8 Java SE 6 Update 18

    o 7.9 Java SE 6 Update 19

    o 7.10 Java SE 6 Update 20

    o 7.11 Java SE 6 Update 21

    o 7.12 Java SE 6 Update 22

    o 7.13 Java SE 6 Update 23

    o 7.14 Java SE 6 Update 24

    y Java SE 7.0

    y Java SE 8.0

    J DK ( J ava Development Kit)Java Virtual Machine (JVM)J2EE ---Java 2 Enterprise Edition.J2ME---Java 2 Micro Edition.j2se - Java 2 Platform; Second EditionJava 2.0 Standard Edition