7125855 Written Test Paper

Embed Size (px)

Citation preview

  • 7/28/2019 7125855 Written Test Paper

    1/12

    ROLL NO : ______________________

    ENTIRE QUESTION PAPER IS DIVIDED INTO THREE SECTIONS WHERE IN CANDIDATE IS ASKED TO ATTEMPTEVERY QUESTION. EACH QUESTION SHOULD BE ANSWERED BY MARKING THE CHOSEN ANSWER.

    DURATION: 90 MINUTES

    SECTION A

    JSP ( 20 QUESTIONS 30 MINUTES )

    Q1). Which one of the following JSP methods CANNOT be defined within a JSP page?

    a) jspDestroy()b) jspRestore()c) _jspService()d) jspInit()e) _jspRemove()

    Ans :

    jspResotre() and _jspRemove() .

    Q2). Which one of the following interfaces is used within a Servlet to allow another Servlet to process all or part of arequest?

    a) javax.servlet.http.HttpSessionb) javax.servlet.RequestDispatcherc) javax.servlet.ServletContextd) javax.servlet.ServletRequeste) javax.servlet.ServletConfig

    Ans:b] javax.servlet.RequestDispatcher

    Q3). Which one of the following correctly nests one custom tag within another?

    a)

    b) c) d) e)

    Ans:C)

    Q4). A Web application is located in the directory /tomcat/webapps/stocks.

    Referring to the scenario above, what is the location of the application's deployment descriptor file?

    a) /tomcat/webapps/stocks/WEB-INF/confb) /tomcat/webapps/stocksc) /tomcat/webapps/stocks/docsd) /tomcat/webapps/stocks/conf e) /tomcat/webapps/stocks/WEB-INF

    Ans:e ) /tomcat/webapps/stocks/WEB-INF

    Q5). Which one of the following choices describes elements that are all required in the taglib element of a web.xml file?

    a) , < taglib-location>b) , , c) , d) , , e) ,

  • 7/28/2019 7125855 Written Test Paper

    2/12

    Q6). Which JSP tag obtains a reference to an instance of a Java object defined within a given scope?

    a) b) c) d) e)

    Ans:e)

    Q7). Your Web application, analyzestocks, depends on a JAR file, db.jar, provided by an outside vendor.Referring to the scenario above, where do you place db.jar?

    a) analyzestocks/WEB-INF/libb) analyzestocks/WEB-INFc) analyzestocksd) analyzestocks/WEB-INF/classese) analyzestocks/classes/lib

    Ans :e) analyzestocks/classes/lib

    Q8). Which one of the following is a valid attribute for a JSP page directive?

    a) buffering="none"b) isThreadSafe="false"c) importer="package.class"d) extender="package.class"e) caching="false"

    Ans:b) isThreadSafe="false"

    Q9). What tier in a 3-tier architecture is responsible for generating the user interface?

    a) Enterpriseb) GUIc) Applicationd) Integratione) Presentation

    Ans :e) Presentation

    Q10). Which interface in the java.sql package is used to access database stored procedures?

    a) CallableStatementb) ProcedureStatementc) Statementd) StoredProceduree) PreparedStatement

    Ans:a) CallableStatement

    Q11). Which one of the following techniques allows multiple users to share a single database connection?

    a) Have each user use the single DB username and password for connection to the database.b) Have the database functions placed in a single bean and have all users connect to that bean.

    c) Have each user connect to the database using his own username and password.d) Have the database accept multiple connections on multiple ports.e) Have all of the database functions reside in a .JAR file on each client machine.

    Ans:b) Have the database functions placed in a single bean and have all users connect to that bean.

    Q12). Which one of the following web.xml elements do you use to define an initialization parameter for your servlet?

    a) b) c)

  • 7/28/2019 7125855 Written Test Paper

    3/12

    d) e)

    Ans:e)

    Q13). Which one of the following provides a reference to the "this" variable within a JSP page?

    a) The getThisProperty() methodb) The getProperty() methodc) The getFocus() methodd) The implicit page objecte) The servlet outputstream object

    Ans:d) The implicit page object

    Q14). Which one of the following implicit objects is typically used to retain information about a user between JSP pages?

    a) pageb) configc) responsed) applicatione) session

    Ans:e) session

    Q15). Which one of the following results in an error stating that a JavaBean was NOT found?

    a) You are trying to write a second response to the client browser.b) You have attempted to use the getProperty action before the useBean tag.c) You have set "lang=" incorrectly.d) You have not compiled your applet using the latest API.e) You have not defined the JavaBean classpath.

    Ans:b) You have attempted to use the getProperty action before the useBean tag.

    Q16). What method do you override to initialize instance variables in a JSP declaration?

    a) initb) servicec) startd) HttpJsppage constructor e) jspInit

    Ans :e) jspInit

    Q17). Which class or interface do you use to retrieve the HttpSession object associated with the current user?

    a) HttpServletb) ServletContextc) HttpServletRequestd) ServletConfige) HttpServletResponse

    Ans:

    c) HttpServletRequest

    Q18). What attribute of the page directive do you use to have uncaught run-time exceptions automatically forwarded to anerror processing page?

    a) page.error()b) Exceptionc) javax.throwabled) Responde) errorPage

    Ans:

  • 7/28/2019 7125855 Written Test Paper

    4/12

    e) errorPage

    Q19). Why are Web Archive (WAR) files used?

    a) To offer an easy and standard way to deploy Web Applicationsb) To optimize for better performancec) To heavily compress for faster downloadsd) To offer an integrated solution for developer environmentse) To offer advanced security for Web Applications

    Q20). When building a Web Archive (WAR) target for a Web Application, the class files for the application are placed inwhich one of the following directories?

    a) /classesb) /WEB-INF/classesc) /WEB-INF/libd) /xmle) /WEB-INF

    SECTION B

    JAVASCRIPT ( 20 QUESTIONS 30 MINUTES )

    Q1). document.form[0].action = "cgi-bin/process.cgi";

    What does the above code segment do?

    a) It changes the first form's display within the browser.b) It submits the first form.c) It changes the order in which the forms are processed.d) It changes the script that processes the first form's results.e) It changes the f irst form's method of submitting.

    Ans:c) It changes the order in which the forms are processed.

    Q2). What code always brings window "newWindow" to the front?

    a) newWindow.Visibility(top)b) setPosition.newWindow.top

    c) newWindow.position(top)d) onFocus.newWindow.showe) newWindow.focus()

    Ans:e) newWindow.focus()

    Q3). function surfto(form) {var idx=form.s1.selectedIndexif(form.s1.options[idx].value != 0)location=form.s1.options[idx].value;

  • 7/28/2019 7125855 Written Test Paper

    5/12

    } Choose OneU2U3U4

    Which one of the following does the above code create?

    a) Four hyperlinksb) Four buttons, each loading a corresponding URL when clickedc) Four check boxes and a button that loads the selected document when clickedd) A pull-down menu and a button that loads the selected document when clickede) A pull-down menu with four choices that loads a selected when focus is removed

    Ans:e) A pull-down menu with four choices that loads a selected when focus is removed

    Q4). function echo(form,currentfield) {if(currentfield == "first")form.second.value=form.first.value;elseform.first.value=form.second.value;}

    Function echo() above does which one of the following?

    a) It copies the text from the second field to the first.b) It swaps the text entered between fields.c) It moves the text from the first field to the second.d) It copies the text from the first field to the second.e) It moves the text from the second field to the first.

    Ans :c) It moves the text from the first field to the second.

    Q5). function submitIt(form) {dn = -1;for(j=0; j

  • 7/28/2019 7125855 Written Test Paper

    6/12

    How many times does the above "while" loop iterate?

    a) 9b) 10c) At least 9d) At least 10e) It is impossible to tell

    Ans :b) 10

    Q7). total=0;for(var j=0;j

  • 7/28/2019 7125855 Written Test Paper

    7/12

    What does the above code create?

    a) Five buttons, each loading a corresponding URL when clickedb) A pull-down menu and a button that loads the selected document when clickedc) Five checkboxes and a button that loads the selected document when clickedd) Five radio buttons and a button that loads the selected document when clickede) Five hyperlinks

    Ans:a) Five buttons, each loading a corresponding URL when clicked

    Q11).

    Referring to the above code, what code initially places the cursor in text field "a"?a) b) c) d) e)

    Ans:e)

    Q12). setTimeout("cycle()",3 * 3000);

    How often is function cycle() called in the above code?

    a) 3 millisecondsb) 3.003 secondsc) 3000 millisecondsd) 9 secondse) 9000 seconds

    Ans:

    Q13). var sample="test";var result=sample.big();

    Referring to the above code, what is the value of "result" after execution?

    a) TESTb) testc) TESTd) teste) Unable to tellbig() is not defined

    Ans:

    e) Unable to tellbig() is not defined

    Q14). function loadOver() {

    code here

    }

  • 7/28/2019 7125855 Written Test Paper

    8/12

    Referring to the above code, what statement inside function loadOver() causes button "Reload" to emulate the Refreshbutton of a browser?

    a) parent.ctr.location="javascript:location.reload()"b) self.counter.location="location.history(0)"c) parent.history(0)d) document.location.href = thise) location.reload()

    Ans)e) location.reload()

    Q15). What code removes every 'x' from String "S"?

    a) var SCopy = '';for(var i = 0; i < S.length; i++)if(S.charAt(i)!='x') {SCopy += S.charAt(i);S = SCopy;

    b) for(var i = 1; i < S.length; i++) {if(S.char(i) == 'x') S += S.charAt(i); }

    c) while(i=1;i

  • 7/28/2019 7125855 Written Test Paper

    9/12

    Ans:d) circumference = 2 * Math.PI * radius

    Q20). txt = new String("Sample text.");function textColor() {return "" + this + "";}

    Using the code above, what code assigns a "color" property to all string objects defaulted "gray" and facilitates printingcolored text to a browser?

    a) String.color = "gray";String.colored = textColor;

    b) String.color = "gray"c) String.prototype.color = "gray";

    String.prototype.colored = textColor;d) String.txt.color = "gray"e) color.String = "gray"

    SECTION C

    ORACLE AND SQL-SERVER ( 20 QUESTIONS 30 MINUTES )

    Q1). What is used by Oracle to control concurrent access to data?

    a) locksb) transaction manager c) net 8d) session manager e) memory holes

    Ans:a) locks

    Q2). Which of the following correctly describe the restrictions on the use of LONG columns (choose all that apply):

    a) LONG columns cannot appear in WHERE clauses

    b) A table can contain only one LONG column.c) LONG columns cannot be indexed.d) You cannot create an object type with a LONG attribute.

    Ans:a) LONG columns cannot appear in WHERE clausesb) A table can contain only one LONG column

    Q3). To enable a UNIQUE constraint ______

    a) This is hard to determine.b) you must have the privileges necessary to create an index on the table.c) you must have the privileges necessary to create a rollback segment on the table.d) you must have the privileges necessary to create a schema on the table.

    Q4). What PL/SQL statements ensure that all database changes brought about by SQL operations are either made

    permanent or undone at the same time (choose all that apply):

    a) COMMITb) ROLLBACKc) CANCELd) CONFIRMe) None of the choices

    Ans:a) COMMIT

    Q5). What can occur when multiple users try to access the same schema object (fill in the blank):

  • 7/28/2019 7125855 Written Test Paper

    10/12

    Please write in your answer in the form below------------------------------------------------------------

    Q6). The CHAR datatype specifies a variable-length character string.

    a) This is hard to determineb) Falsec) Trued) None of the choices

    Ans:b) False

    Q7). PL/SQL has which types of subprograms (choose all that apply):

    a) This is hard to determineb) pointersc) proceduresd) linkse) functionsf) packages

    Ans:c) procedures

    Q8). nvarchar2 has an upper limit of how many bytes (fill in the blank):

    Please write in your answer in the form below

    Ans: with an upper limit of 4000 bytes------------------------------------------------------------

    Q9). What statement do you use to define a logical table based on one or more tables (fill in the blank):Please write in your answer in the form below

    Ans: To define logical relations between the table we can go for Views the keyword we use for this is View-----------------------------------------------------------------------------------------------------------------------------------------------

    Q10). In PL/SQL, the EXIT-WHEN statement lets you:

    a) this statement is not valid

    b) complete a loop if further processing is impossiblec) This is hard to determine.d) complete a loop if further processing is desirable.

    Ans:d) complete a loop if further processing is desirable.

    Q11). The SQL server that Michael manages crashed. The disk drives were not damaged but there was data that had notbeen written to some databases. Which transactions will be rolled forward in each database when his SQL server startsthe automatic recovery process?

    a) All committed transactions that are in the transaction log between the last checkpoint and the failureb) All committed transactions that are in the transaction logc) All committed transactions that are in the transaction log between the last two checkpointsd) All uncommitted transactions that are in the transaction log

    Ans:If Auto Commit is True then during the recovery the data will get recovered.

    Q12). What functions are performed by the SQL Server Agents?(Choose all that apply)

    a) Notificationb) Job executionc) User security managmentd) Replication managemente) Alert management.

  • 7/28/2019 7125855 Written Test Paper

    11/12

    Q13). Exchange and SQL 7.0 are running on the same server. You notice the performance in exchange is degraded. TheMin server memory, Maximum server memory and set working area are set as they were automatically in the installation.What do you do to free memory for exchange?

    a) Increase Min server memoryb) Set working area to 0c) Set working area to 1d) Increase memory allocated to the procedure cache optione) Reduce Min server memory

    Q14). You define full-text indexing on the ProductName column in the Products table. You then execute a full-text queryon the column. You specify a word that you know is present in the column, but the result set is empty. What is the mostlikely cause?

    a) The Microsoft Service is not runningb) The SQL ServerAgent Service is not runningc) The catalog is not populatedd) You did not create a unique SQL Server index on the ProductName column

    Q15). You start SQL-Server with the -f option. Unfortunately now you can't establish a connection to your SQL-Server.What should you do?

    a) Edit regsitryb) Restore registry from backupc) Rebuild master databased) Reinstall SQL -Server e) Run regrebuld.exe

    Q16). You must create a database for a motorbike dealership. You need to track the new and used motorbike inventory.Each manufacturer assigns a unique identification number to each bike. Each motorbike could be sold more than once bythe same person. Provincial laws prohibit the same motorbike from being sold more than once on the same day. Youcreate a customer table and assign each customer a unique ID and store their address and phone number. Thetransaction table stores the customer ID, motorbike ID, date of sale, salesperson ID. Which column can you use togetherwith the motorbike id number to uniquely identify each transaction?

    a) Salesperson IDb) Year of the motorbikec) Modeld) Date of sale.

    Ans:d) Date of Sale

    Q17). Your company has 3 offices each of which is responsible for sales in their respective territory. Which of the followingactions should you take to ensure a successful merge replication among you three offices?

    a) You must include all tables with primary keys that are referenced by the foreign keys in the replicated tablesb) Prior to merge replication, create a unique identifier column in each table that are to be included in the

    publicationc) Do nothing, DTS will take care of it.d) Prior to merge, you must create an index in the tables that are to be included in the publication.

    Q18). You want to set up replication between two databases, so the financial data and the sales data will be the same.You want the data to replicate at 1:00 a.m. every morning. You would like to completely remove all data from the financialdatabase each night and overwrite data from the sales database. Which database replication model would you choose?

    a) Transactional replicationb) DTC replicationc) Subscriber replicationd) Snap shot replication

    e) Merge replication

    Q19). What is the commonly fixed database role of a db_datawriter?

    a) Add, change or delete data from all the tablesb) Assign statement and object permissionsc) Backup and restore databasesd) Read data from any table

  • 7/28/2019 7125855 Written Test Paper

    12/12