Upwork/oDesk ColdFusion MX 7
·
1. Which of the given options is
correct for the following code?
<cfupdate
datasource="MIS" tablename="user">
Answers:
• cfupdate is a
tag and datasource is a tag value
• cfupdate is an
attribute and user is attribute value
• tablename is a
tag and user is the tag value
• datasource is
the attribute name and MIS is the attribute value
2. What is the default value for the encoding
parameter of the hash function?
Answers:
• UTF-8
• It is specified
by the defaultCharset entry in the neo-runtime.xml file
• It varies
depending upon the locale settings of your computer
• ASCII
• EBCDIC
• UCS-2
• UTF-16
3. What does the Randomize function return?
Answers:
• A pseudo-random
integer number, in the range 0-5
• A pseudo-random
number, in the range 0-10
• A pseudo-random
decimal number, in the range 0-100
• A pseudo-random
decimal number, in the range 0-1
4. What is the output of the following code:
<cffunction name="thefunc"
returntype="numeric">
<cfargument name="x"
required="yes" type="numeric" default=2>
<cfreturn x*x>
</cffunction>
<cfoutput>
#thefunc()#
</cfoutput>
Answers:
• 2
• 3
• 4
• 5
5. Which ColdFusion tag is used to import a
Java Server Page (JSP) tag library?
Answers:
• cfjimport
• cfimport
• cfinclude
• cfinsert
• cfsetting
6. When would you prefer to use the
encrypt/decrypt functions instead of the hash function?
Answers:
• When you want
to encrypt blocks of text larger than 1 kb
• Hash is a
superior function, it is always preferred over encrypt/decrypt
• When you want
the ability to decrypt the encrypted string
• When you want
to use Blowfish algorithm for encryption
• When you want to
use MD5 algorithm for encryption
7. Which of the following is a correct way of
commenting in Coldfusion?
Answers:
• //
• <!-- -->
• /* */
• <!---
--->
8. What will XResult contain:
<cfset XResult = xmlSearch(XMLObject,
"//@size")>
Answers:
• An array
containing the attributes named size that fall directly beneath the root node
• An array
containing the nodes named size that fall directly beneath the root node
• An array
containing the attributes named size that fall anywhere beneath the root node
• An array
containing the nodes named size that fall anywhere beneath the root node
• An array
containing the elements named size that fall directly beneath the root node
9. The <cfhttp> tag can have multiple
<cfhttpparam> tags, subject to certain limitations. Which are these
limitations?
Answers:
• The formField
type attribute is only meaningful with the cfhttp tag POST and GET methods
• The file and
formField type attributes cannot be used with the cfhttp tag TRACE method
• The file type
attribute is only meaningful with the cfhttp tag POST and PUT methods
• Both a and c
• Both b and c
• All the above
10. What does the cfNTauthenticate tag do?
Answers:
• Returns the
version of Windows NT running on the web server
• It verifies if
the database being used by the application is running
• Authenticates a
user name and password against the Windows NT domain
• It
authenticates an original version of the ColdFusion server
11. The emp_data table has following values
for its department field:
marketing, production, production, sales,
NULL, NULL, Marketing, Null
What will the following query return:
<cfquery name="GetDeptData"
datasource="myDSN">
select distinct(department) as department_name
from emp_data
</cfquery>
Answers:
• marketing, production,
sales
• marketing,
production, sales, NULL
• marketing,
production, sales, NULL, NULL
• marketing,
production, sales, NULL, Marketing
• marketing,
production, sales, NULL, NULL, Marketing
• Impossible to
say, because it depends upon the underlying database
12. Which of the following tags is not useful
in handling exceptions?
Answers:
• cftry
• cfcatch
• cfrethrow
• cfabort
• cferror
13. which ColdFusion tag is used to define the
application scope like, enabling sessions, setting timeouts and specifying
client variable storage?
Answers:
• cfsession
• cfcookie
• cfapplication
• cfindex
14. Which of the statements with respect to
the following code is correct?
<cffunction name="daysmonths"
returntype="date">
<cfreturn
dateadd("d",1,Now())>
</cffunction>
<cfoutput>
#daysmonths()#
</cfoutput>
Answers:
• daysmonths() is
a user defined function
• date() is a
user defined function
• The output will
display tomorrows date
• The output will
display today's date
• The cffunction
tags are optional in this code
15. Which operator will be evaluated first in
the following statement:
<cfquery name="GetEmpData"
datasource="myDSN">
select (age + 3 * 4 / 2 - 8) from emp
</cfquery>
Answers:
• +
• -
• /
• *
16. When would you prefer to use the
<cfstoredproc> tag in place of the <cfquery> tag?
Answers:
• When you want
to execute a stored procedure instead of an in-line query
• When you want
to execute a stored procedure that returns multiple recordsets
• When you want
to execute a stored procedure that accepts parameters
• Never, because
<cfstoredproc> doesn't offer any advantages over <cfquery>
17. Which of the following techniques allow
the Coldfusion code to be used at many places with in an application?
Answers:
• cfinclude tag
• User Defined
functions
• CFML tags and
CFX
• Both a and c
• a, b, and c
18. The following structure stores the address
of one of the employees:
<cfset AddrStr= StructNew()>
<cfset
AddrStr.Address1="23/16">
<cfset AddrStr.Address2="Lismore Street">
<cfset AddrStr.City="Manly">
<cfset AddrStr.Pincode="2065">
And the other Structure stores
"AddStr" as its one of the keys:
<cfset EmpStr = StructNew()>
<cfset EmpStr.Key=AddrStr>
What would you put inside
<cfoutput></cfoutput> tags to print the value of "City"
on the page?
Answers:
•
#EmpStr.key.City#
•
#EmpStr["key"].City#
•
#EmpStr.key["City"]#
•
#EmpStr["key"]["City"]#
• Any of the
above
• Both a and c
• EmpStr.key.City
19. What happens when the following code is
included in a cfm file:
<cflog file="myAppLog"
text="User Kim logged on.">
Answers:
• "User Kim
logged on" will be displayed in the browser
• A new log file
by the name of Kim will be created
• "User Kim
logged on" will replace the last record in the ColdFusion log file
• "User Kim
logged on" will be appended to the ColdFusion log file
20. Query of Queries cannot be performed on
cfassociate.
Answers:
• True
• False
21. What does the cfproperty tag do?
Answers:
• Defines
properties of a ColdFusion file
• Defines
properties of a ColdFusion user defined function
• Sets properties
for the ColdFusion application
• Defines
properties of a ColdFusion component
22. What will XResult contain:
<cfset XResult = xmlSearch(XMLObject,
"//info")>
Answers:
• An array
containing the info nodes that fall directly beneath the root node
• An array
containing the info nodes that fall anywhere beneath the root node
• All info nodes
will be returned along with their child and sub-child nodes
• This XPath
expression is erroneous
• An array
containing the attributes of all the info nodes that fall anywhere beneath the
root node
23. There are 5 info nodes in an XML document.
How will you obtain the value of the 3rd info node?
Answers:
• <cfset
XResult = xmlSearch(XMLObject, "/info[2]")>
• <cfset
XResult = xmlSearch(XMLObject, "/info[3]")>
• <cfset
XResult = xmlSearch(XMLObject, "/info[4]")>
• <cfset
XResult = xmlSearch(XMLObject, "/info(1)")>
• <cfset
XResult = xmlSearch(XMLObject, "/info[first()+2]")>
• <cfset
XResult = xmlSearch(XMLObject, "/info[last()-2]")>
24. Which of the following verity query types
is not valid?
Answers:
• Natural
• Search
• Internet
• Simple
• Explicit
25. Which of the following tags was introduced
in the ColdFusion MX series?
Answers:
• cfcalendar
• cfapplet
• cfbreak
• cfdirectory
26. What is correct syntax for accessing an
item of a structure?
Answers:
•
StructFind(item, struct)
•
StructFind(struct, item)
•
FindStruct(struct, item)
•
FindStruct(item, struct)
27. Consider the following <cfquery>
tag:
<cfquery name="GetTableData"
datasource="myDSN">
SELECT * FROM myTable
</cfquery>
Which condition should the WHERE clause
contain so that only those rows are returned that contain null in column
column1?
Answers:
• WHERE column1
is null
• WHERE column1 =
null
• WHERE column1
EQUALS null
• WHERE column1
NOT null
• WHERE column1
CONTAINS null
28. Which of the following makes CFMX7 better
than the previous MX version?
Answers:
• It has added
support for dot notation within a recordset name
• It has added result
attribute
• Deprecated
connectString, dbName, dbServer, provider, and providerDSN attributes
• It has added
cfquery.ExecutionTime
29. Evaluate the following SQL statement:
<cfquery name="GetEmpData"
datasource="myDSN">
SELECT e.employee_id, (.15* e.salary) + (.5 *
e.commission_pct) + (s.sales_amount * (.35 * e.bonus)) AS CALC_VALUE FROM
employees e, sales s WHERE e.employee_id = s.emp_id;
</cfquery>
What will happen if all the parentheses are
removed from the calculation in the SQL query?
Answers:
• The value
displayed in the CALC_VALUE column will be lower
• The value
displayed in the CALC_VALUE column will be higher
• There will be
no difference in the value displayed in the CALC_VALUE column
• An error will
be reported
30. Which of the following statements is
correct with regard to Coldfusion Comments?
Answers:
• Nesting of
coldfusion comments is not allowed
• The comments
can be embedded in a function or tag name
• The comments
are allowed in the body of the document only
• The comments
are cleared by coldfusion engine before presenting output to the browser
31. Which of the following can be used to
convert real number into integers?
Answers:
• Ceiling
• Int
• Round
• Fix
• All of the
above
• a, c, and d
32. A code has to be generated by using 'PageCode'
and 'ProductCode,' whose numeric values are derived from a database:
<cfset ArPage=ArrayNew(1)>
<cfset ProductCode = #PCode#>
<cfset ClassCode = #CCode#>
You have to assign value "superherb"
to ArPage where index is concatenation of ProductCode and ClassCode. Which of
the following ways would you use?
Answers:
• <cfset
ArPage[#ProductCode##ClassCode#] = "Superherb">
• <cfset
ArPage[#ProductCode# #ClassCode#] = "Superherb">
• <cfset
#ArPage[ProductCode & ClassCode]# = "Superherb">
• <cfset ArPage[#ProductCode#
& #ClassCode#] = "Superherb">
33. Which of the following constitute the core
components of ColdFusion MX?
Answers:
• ColdFusion
application server
• ColdFusion
Markup Language
• ColdFusion MX
Administrator
• All of the
above
34. Which of the following is not a valid
array function?
Answers:
• ArrayAppend
• ArrayInsertAt
• ArraySize
• ArrayPrepend
• None of the
above
35. You need to set the value for 'UserName'
to ''Guest'' if a user does not fill in the user name in the Coldfusion form.��Which of the following ways help you
implement this?
Answers:
• <cfset
Form.UserName=''Guest''>
• <cfparam
name=''Form.UserName'' default=''Guest''>
• <cfparam
name=''Form.UserName'' optional=''Guest''>
• <cfparam
name=''Form.UserName'' value=''Guest''>
36. What will be the result of placing the
following code in any cfm file:
<!---
<cflock timeout=20
scope="Session" type="Exclusive">
<cfset StructDelete(Session,
"ShoppingCartItems")>
</cflock>
--->
Answers:
• The page will
be timed out after 20 seconds
• The current
session will time out after 20 minutes
• Delete all
session variables
• Nothing will
happen
37. Which of the following allows the use of
CFML tags within its body?
Answers:
• UDF
• CFScript
• UDF and
CFScript
• None of the
above
38. Which of the following structure
assignments is correct?
Answers:
• <cfset
objStruct.value1 = "value">
• <cfset
objStruct[0].value1 = "value">
• <cfset
objStruct[0] = "value">
• All the above
39. Which of the following statements is
correct with regard to Coldfusion functions?
Answers:
• Nesting of
functions is not allowed
• Functions can
be created using cffunction or cfscript tag
• Function may
return a value
• In-built
functions can't be used with user defined ones
40. Which encryption engine is used by the
ColdFusion MX encrypt and hash functions?
Answers:
• PGP 8.0
• Java
Cryptography Extension (JCE)
• CryptoText
Encryption Library
• Microsoft High
Encryption Pack
41. Which of the following is an invalid
variable scope?
Answers:
• Super
• This
• Caller
• Server
42. What is the result of the following code:
<cfset mystring = "'Newton's Law',
'Fermat's Theorem'">
<cfoutput>
#PreserveSingleQuotes(mystring)#
</cfoutput>
Answers:
• 'Newton's Law',
'Fermat's Theorem'
• Newton's Law,
Fermat's Theorem
• "Newton's
Law", "Fermat's Theorem"
• 'Newtons Law',
'Fermats Theorem'
43. What will XResult contain:
<cfset XResult = xmlFind(XMLObject,
"//info@size='3'")>
Answers:
• All the info
elements that have an attribute called size with a value of 3
• The size
attribute of the third info node
• The info
attribute of the third size node
• The statement
contains an error
44. Which of the following statements are true
when you upload an image file using the <cffile> tag?
Answers:
• You can know
the size and dimensions of the image before actually uploading the image
• You can give
your own file name when the file is uploaded for the first time
• You can set the
action parameter value to "copy, rename"
• Both a and b
• Both b and c
45. You want create PDF files of your XHTML
documents using ColdFusion MX. How can you do this?
Answers:
• It cannot be
done
• You will have
to write your own highly complex code for doing this
• You can use
XSLT and XSL-FO to render the XHTML as a PDF
• There is a
function available in ColdFusion for creating PDFs
46. If the following code is inserted into
your website, when will the cookies expire?
<CFCOOKIE NAME="CFID"
VALUE="#Session.CFID#">
<CFCOOKIE NAME="CFTOKEN"
VALUE="#Session.CFTOKEN#">
Answers:
• when the
session ends
• When the
application ends
• This code has
no effect on the expiration of the cookies
47. Which of the following ColdFusion tags is
used to get the elements, variables and values of ColdFusion objects?
Answers:
• cfcollect
• cfcomponent
• cfdump
• cfdocument
48. Which of the below statements are correct
regarding the following code:
<cfset a = GetTickCount()>
<cfloop from="1"
to="10000" index="i">
</cfloop>
<cfset b = GetTickCount()>
<cfscript>
c = GetTickCount();
for (i = 1; i LTE 10000; i = i+1) ;
d = GetTickCount();
</cfscript>
<cfoutput>#b-a# vs.
#d-c#</cfoutput>
Answers:
• The results are
always the same each time the code is run
• The results
vary each time the code is run
• This code will
give an error when run
49. Which of the following statement is
correct?
Answers:
• The coldfusion
script is contrary to Java script
• The coldfusion
script runs on client system
• The coldfusion
script is used for creating user defined functions
• The coldfusion
script provides access to some of the in-built coldfusion functions
50. You want to display the titles of books
that meet the following criteria:
1. Purchased before November 11, 2002
2. Price is less than $500 or greater than
$900
You want to sort the result by the date of
purchase, starting with the most recently bought book.
Which of the following queries will you use in
the <cfquery> tag?
Answers:
• SELECT
book_title FROM books WHERE price between 500 and 900 AND purchase_date <
'11/11/2002' ORDER BY purchase_date;
• SELECT
book_title FROM books WHERE price IN (500, 900) AND purchase_date <
'11/11/2002' ORDER BY purchase date ASC;
• SELECT
book_title FROM books WHERE price < 500 OR>900 AND purchase_date DESC;
• SELECT
Book_title FROM books WHERE price < 500 OR price > 900 AND purchase_date
< '11/11/2002' ORDER BY purchase date DESC;
51. A company has the following departments:
Marketing, Designing, Production, Packing
What will the following query return?
<cfquery name="GetDeptData"
datasource="myDSN">
select * from departments where department
< 'Marketing'
</cfquery>
Answers:
• The query will
return "Designing, Marketing"
• The query will
return "Designing, Production, Packing"
• The query will
return "Packing"
• Strings cannot
be compared using < operator
• The query will
return "Designing"
52. What is the output of the following code:
<CFPARAM DEFAULT="ProjectManager"
NAME="Status">
<CFPARAM DEFAULT="Six Sigma"
NAME="ProjectType">
<CFIF
IsDefined("FORM.Status")>
Welcome <CFOUTPUT>#FORM.Status#</CFOUTPUT>
<CFELSEIF IsDefined("Status")>
You are not a
<CFOUTPUT>#Status#</CFOUTPUT>
<CFELSE>
Welcome
</CFIF>
Answers:
• Welcome
ProjectManager
• You are not a
ProjectManager
• Welcome
• Six Sigma
ProjectManager
• You are not a
Six Sigma
• None of the
above
53. Which of the following constitute the
common characteristics shared by most of the Coldfusion Tags?
Answers:
• They start with
cf
• They have a
closing tag as well
• They have
attributes and most attributes have values
• All of the above
• Both a and b
54. Which of the following characters need
escaping?
Answers:
• #
• "
• '
• @
• All of the
above
• a, b, and c
55. What is the output of the following code:
<cfscript>
function autoLeadIn(string,count) {
output = '';
if(Trim(string) NEQ '') {
textarray = ListToArray(string, "
");
if(ArrayLen(textarray) LTE count) {
count = ArrayLen(textarray);
}
for(i=1; i LTE count; i=i+1)
{
output = output & textarray[i];
if(i neq count) {
output = output & " ";
}
}
}
return output;
}
</cfscript>
<cfoutput>#autoleadin("qwerty
asdfg, poiuy, zxcvb",3)#</cfoutput>
Answers:
• qwerty asdfg,
poiuy,
• qwerty asdfg,
poiuy
• qwerty asdfg
• qwerty asdfg,
poiuy, zxcvb
56. You have created an extension to
Coldfusion tag named "CalcClass." It needs one integer argument named
"IntValue." Which of the following enables you to call that in the
Coldfusion code?
Answers:
• <cftag
class=CalcClass IntValue=20>
• <cfx
name=CalcClass IntValue=20>
•
<cfx_CalcClass IntValue=20>
• <cfx
tag=CalcClass IntValue=20>
57. Your website has to display the personal
information of the user when he logs in. The table storing the personal details
is 'TbUser' (with primary key Uid) and the data source is 'UserDSN.' The user
id ('Uid') is passed by the login screen. Which of the following helps you
retrieve the information from the database?
Answers:
• <cfselect
name="GetUserDetails" DSN="UserDSN"> select * from
TbUser where Uid = #This.Uid# </cfselect>
• <cfquery
name="GetUserDetails" datasource="UserDSN"> select *
from TbUser where Uid = #URL.Uid# </cfquery>
• <cfselect
name="GetUserDetails" DSN="UserDSN"> select * from
TbUser where Uid = #Form.Uid# </cfselect>
• <cfquery
datasource="UserDSN"> select * from TbUser where Uid = #URL.Uid#
</cfquery>
58. What is the output of the following code:
<cfscript>
function calculateresult()
{
var a=55;
var b=5;
b=b-a*b+a;
return b;
}
</cfscript>
<cfoutput>#calculateresult()#</cfoutput>
Answers:
• -215
• 215
• -325
• 325
59. What is the output of the following code:
<cfoutput>reverse(6*2) equals
#reverse(6*2)#</cfoutput>
Answers:
• reverse(6*2)
equals 12
• reverse(2*6)
equals 21
• reverse(6*2)
equals 21
• reverse(2*6)
equals 12
60. Which of the following tags do not work in
the ColdFusion MX series?
Answers:
• cfauthenticate
• cfapplication
• cfloginuser
• cfmodule
61. What is the output of the following code:
<cfscript>
function calculateresult()
{
var a=55;
var b=5;
b=a+b;
b=b+b;
return b;
}
</cfscript>
<cfoutput>#calculateresult()#</cfoutput>
Answers:
• 100
• 120
• 10
• 65
62. What is the output of the following code:
<cfoutput>
<cfset stringToSearch =
"The quick brown fox jumped over the lazy dog.">
#find("the",stringToSearch)#
#find("the",stringToSearch,35)#
#find("no such
substring",stringToSearch)#
</cfoutput>
Answers:
• 3300
• 0 0 33
• 0 33 0
• 33 0 0
63. You need to create a website using
ColdFusion that spans across several servers. What will be the preferred
technique for maintaining session state across the servers considering that some
users might have cookies disabled on their browsers?
Answers:
• Use session
variables
• Use the CFID
and CFTOKEN cookies to track sessions
• Pass the CFID
and CFTOKEN variables to every URL, form action and hyperlink and set the
ClientManagement attribute of your CFApplication tag to "yes"
• Pass the CFID
and CFTOKEN variables to every URL, form action and hyperlink and set the
ClientManagement attribute of your CFApplication tag to "no". Set the
"ClientStorage" attribute of the CFAPPLICATION tag to your specified
datasource
• This cannot be
accomplished
64. What is the output of the following code:
<cfoutput>#IncrementValue(123.35)#</cfoutput>
Answers:
• 123
• 124
• 123.5
• 122
• 100
65. What is the output of the following code:
<cfset myArray = ArrayNew(1)>
<cfset myArray[1] = "Test
Value">
<cfset temp =
ArrayAppend(myArray, "Akash")>
<cfset temp =
ArrayAppend(myArray, "Peterson")>
<cfset temp
= ArrayAppend(myArray, "Dave Heartsdale")>
<cfset temp = ArrayAppend(myArray, "Aaron Smith")>
<cfoutput>
<p>This
array has #ArrayLen(MyArray)# elements.
</cfoutput>
Answers:
• This array has
1 elements
• This array has
5 elements
• Test Value,
Akash, Peterson, Dave Heartsdale, Aaron Smith
• This array has
Test Value, Akash, Peterson, Dave Heartsdale, Aaron Smith
66. Examine the data in the EMPLOYEES table
given below:
LAST_NAME
DEPTARTMENT_ID
SALARY
ALLEN
10
3000
MILLER
20
1500
King
20
2200
Davis
30
5000
Which of the following queries will execute
without error?
Answers:
• <cfquery
name="GetEmpInfo" datasource="myDSN"> SELECT * FROM
employees where salary > (SELECT MIN(salary) FROM employees GROUP BY
department_id) </cfquery>
• <cfquery
name="GetEmpInfo" datasource="myDSN"> SELECT * FROM
employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY
department_id) </cfquery>
• <cfquery
name="GetEmpInfo" datasource="myDSN"> SELECT distinct
department_id FROM employees Where salary IN (SELECT AVG(salary) FROM employees
GROUP BY department_id) </cfquery>
• <cfquery
name="GetEmpInfo" datasource="myDSN"> SELECT
department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM
employees GROUP BY AVG(SALARY)) </cfquery>
67. A coldfusion list is defined as follows:
<cfset list1="24,25,26,27,">
<cfset list2="24,,25,26,27">
<cfset
list3="24,,,,25,26,27,">
<cfset
list4="24,25,,26,,27,,">
What will you get on printing
"listlen" for all the above lists?
Answers:
• 4, 5, 7, 7
• 4, 4, 7, 7
• 4, 4, 4, 4
• 4, 5, 6, 6
68. You have written a cfquery
("HireSalaries") to retrieve two derived columns "Year" and
"AverageHike." Which of the following is the right way to plot an
area type line graph with this cfquery?
Answers:
•
<cfchartseries chartWidth=380 show3D="yes"> <cfchart
type="area" query="HireSalaries"
valueColumn="AverageHike"
itemColumn="Year"/></cfchartseries>
• <cfchart
chartWidth=380 show3D="yes"> <cfchartseries
type="area" query="HireSalaries"
value="AverageHike" item="Year"/></cfchart>
• <cfchart
chartWidth=380 show3D="yes"> <cfchartseries
type="area" query="HireSalaries"
valueColumn="AverageHike"
itemColumn="Year"/></cfchart>
69. Which of the following statements with
respect to the below code is correct?
<cfset RandomItem = RandRange(1,
greatoffers.recordcount)>
<CFOUTPUT QUERY="greatoffers"
MAXROWS=1 STARTROW=#RandomItem#>
<B>#ProductTitle#</B> - #DollarFormat(greatoffers.Special_Price)#<BR>
</CFOUTPUT>
Answers:
• This code will
display the first record from the complete greatoffers table
• This code will
display a random record from the complete greatoffers table leaving out the
first record
• This code will
display a random record from the complete greatoffers table
• This code will
display the last record from the complete greatoffers table
• This code will
display a random record from the complete greatoffers table leaving out the
last record
70. Which of the following statements is
incorrect with regard to Coldfusion Tags?
Answers:
• Cold fusion has
vast library of in built tags
• CFX tags are
written using java or C++
• They must have
a closing tag
• The tags
without body can be closed using '/>' on the same line
71. Which of the following is not an in-built
complex data type in Coldfusion?
Answers:
• query
• array
• hashtable
• structure
72. Which function has been used to generated
the following output?
pro%20discount
Answers:
• URLEncode
• HtmlEditFormat
• UrlDecode
•
URLEncodedFormat
73. What is the output of the following code:
<cfset yourDate = CreateDate(2002, 11,
23)>
<cfoutput>
This is day #Day(YourDate)# in the month of
#MonthAsString(Month(yourDate))#, which has
#DaysInMonth(yourDate)#
days.
</cfoutput>
Answers:
• This is day 30
in the month of November, which has 30 days
• This is day 23
in the month of November, which has 30 days
• This is day 30
in the month of March, which has 30 days
• 23rd of
November, which has 30 days
74. An admin(role-type) function(ChkBalance)
has to be created for printing the account balance of all the users. Which of
the following ways helps one do this?
Answers:
• <cffunction
name="ChkBalance" returnType="numeric"
roles="admin" access="remote" output="yes">
• <function
name="ChkBalance" return="numeric" roles="admin"
access="local" output="no">
• <cffunction
name="ChkBalance" return="String" role="admin"
accessMode="remote" return=yes">
• <cffunction
id="ChkBalance" returnType="numeric" role="admin"
accessMode="local" return="no">
75. Which of the following is an incorrect
floop syntax:
Answers:
• <cfloop
index . . .
• <cfloop
counter . . .
• <cfloop
condition. . .
• <cfloop
query . . . <cfloop list . . .
76. What will the following code do when
included in a ColdFusion application?
<cfloop collection="#session#"
item="j">
<cfoutput>#j# has value of :
#session[j]#<br></cfoutput>
</cfloop>
Answers:
• It will list
out all the application variables
• It will list
out all the cookies
• It will list
out all the session variables
• It will list
out the Html header
77. What is the output of the following code:
<cfoutput>#REReplace("I love
jelly","jell(y|ies)","cookies")#</cfoutput>
Answers:
• I love jelly
• I love jellies
• I Love jelly, cookies
• I love cookies
78. What is the output of the following code:
<cfset stringToSearch = "The quick
brown fox jumped over the lazy dog.">
<cfoutput>
#findoneof("aeiou",stringToSearch)#
#findoneof("aeiou",stringToSearch,4)#
#findoneof("@%^*()",stringToSearch)#
</cfoutput>
Answers:
• 3 6 0
• 360
• 3 6
• 3 6 0 0
79. What will the xInfo variable contain:
<cfset xInfo =
objXML.xmlRoot.xmlChildren[6]["info"].xmltext>
Answers:
• It returns the
text of the 6th tag named info
• It returns the
text of the 5th tag named info
• It returns the
attribute of the 5th tag named info
• It returns the
text of the 5th element named info surrounded by the <info></info>
tags
• None of the
above
80. Which of the following is not passed as
reference to the object?
Answers:
• structure
• array
• cfobject
• query
81. Which of the following statements is
correct with regard to Function?
Answers:
• Positional
arguments must be used in Function
• Named arguments
must be used in Function
• Either named or
positional arguments can be used in Function
• Both named and
positional arguments can be used in Function
82. Which of the following has the highest
operator precedence?
Answers:
• MOD
• *
• NOT
• +
83. Which of the following ColdFusion tags
aborts the processing of the current ColdFusion page?
Answers:
• cfabort
• cfabandon
• cfkill
• cfswitch
84. What is the output of the following code:
<cfoutput>
#dateformat(CreateDate(2001,08,10),"dd,mmm,yyyy")#
</cfoutput>
Answers:
• 8,OCT,2001
• 10,08,2001
• Aug,10,2001
• 10,Aug,2001
85. How will you test whether a cookie has
already been set on the clients browser?
Answers:
• <CFIF
IsDefined(COOKIE("VistorId"))>
• <CFIF
IsDefined("CFCOOKIE.VistorId")>
• <CFIF
IsDefined("COOKIE.VistorId")>
• None of the
above
86. Examine the code given below:
<cfquery name="GetEmpData"
datasource="myDSN">
SELECT employee_id FROM employees WHERE
commission_pct=.5 OR salary > 23000
</cfquery>
Which of the following statements is correct
with regard to this code?
Answers:
• It returns
employees whose salary is 50% more than $23,000
• It returns
employees who have 50% commission rate or salary greater than $23,000
• It returns
employees whose salary is 50% less than $23,000
• None of the
above
87. What will be the output of the given
expression:
evaluate("23" & 2 + 5)
Answers:
• 51
• 30
• 237
• 230
88. You have defined a field (EmailAd) on your
user registration form to get the user email. Which of the following helps you
validate the data before passing it to the database?
Answers:
•
IsValid("email", Form.EmailAd)
•
IsEmail(Form.EmailAd)
•
IsEmail(#Form.EmailAd#)
•
IsValidType("email", Form.EmailAd)
89. You wrote the following code to set the
prices of the items in an array:
<cfset numArray = ArrayNew(1)>
<cfset ArraySet(numArray, 1, 8 ,25)>
<cfset numArray[3] = "225">
<cfset PriceFound = False>
<cfset ElementNo = 0>
Storing the special price 225, you wrote the
following code to find the array number:
<cfloop condition = "(NOT PriceFound)
AND (ElementNo LT ArrayLen(numArray))">
<cfset ElementNo = ElementNo + 1>
<cfif
numArray[ElementNo] IS "225">
<cfoutput> PriceFound at ElementNo #ElementNo#<br></cfoutput>
<cfset PriceFound = true>
</cfif>
<cfoutput> Searching element . . . #ElementNo#<br></cfoutput>
</cfloop>
What will be the output?
Answers:
• Three lines for
'Searching element . . . ' and one line indicating the 'PriceFound at ElementNo
3'
• Two lines for
'Searching element . . . ' and one line indicating the 'PriceFound at ElementNo
2'
• Eight lines for
'Searching element . . . ' and one line indicating the 'PriceFound at ElementNo
3'
• A syntax error
90. Which of the following constitute the four
categories of the Coldfusion data types?
Answers:
• application,
binary, variant, and local
• simple,
complex, aggregate, and binary
• primary,
secondary, complex, and object
• simple,
complex, binary, and object
91. You have to pass a string named
"StrName" and an array named "ArrItems" to a custom tag.
Which of the following ways serves the purpose?
Answers:
• <cf_CustTag
StrName,ArrItems>
• <cf_CustTag
stringval=StrName arrayval=ArrItems>
• <cf_CustTag
stringval=#StrName# arrayval=#ArrItems#>
• <cf_CustTag
#StrName# #ArrItems#>
92. Which encryption algorithms are supported
by the encrypt/decrypt functions?
Answers:
• MD5
• SHA
• DES
• AES
• Blowfish
93. Which of the following functions are
specially used with regular expressions?
Answers:
• REFind
• REFindNoCase
• REReplace
• REReplaceNoCase
• All of the
above
94. Which encryption algorithms does the hash
function support?
Answers:
• CFMX_COMPAT
• MD5
• SHA
• SHA-256
• SHA-384
• SHA-512
• CBC
• Blowfish
95. Which of the following does not constitute
flow control tag in Coldfusion?
Answers:
• cfabort
• cfset
• cfdefaultcase
• cfloop
96. You have retrieved the list of all the
customers and the products bought for the day, using a cfquery. The structure
"CNameStr" stores the value of a customer's first, middle, and the
last name in the keys "First", "Middle", and
"Last." While printing the report, you want to create the following
label, only if the middle name exists:
<cfoutput>Middle Name:
#CNameStr.Middle#</cfoutput><br>
Which of the following code blocks serves this
purpose with <cfif></cfif> tags?
Answers:
• <cfif
StructKeyExists(CNameStr,Middle)>
• <cfif
StructKeyExists(CNameStr,"Middle")>
• <cfif
StructKeyExists("CNameStr","Middle")>
• <cfif
KeyExists("CNameStr",Middle)>
• <cfif
KeyExists(CNameStr,Middle)>
97. Which of the following is useful in
Dynamic Evaluation?
Answers:
• DEval
• Dynamic
• Evaluate
• Eval
98. With respect to the following code, which
option is correct?
<cfoutput>
#GetHttpTimeString(now())#
</cfoutput>
Answers:
• It will get the
current GMT time
• It will get the
current time of the users computer
• It converts the
current time into a string and stores it in a variable
• It will get the
current web server time
99. What is the output of the following code:
<cfsilent>
<cfset a = 100>
<cfset b = 99>
<cfset c = b-a>
<cfoutput>Inside cfsilent
block<br>
b-a = #c#</cfoutput><br>
</cfsilent>
<cfoutput>
b-a = #c#
</cfoutput>
Answers:
• -1=-1
• b-a=c
• b-a = -1
• Nothing will be
displayed
100. How do you decrypt text that has been
encrypted using the hash function?
Answers:
• By using the
unhash function
• By hashing the
encrypted text again
• It cannot be
done
• By using the
decrypt function
101. What is the output of the following code:
<cfset strabc=setVariable("abc","abc123")>
<cfset
strxyz=setVariable("xyz","xyz321")>
<cfoutput>
strabc = #strabc# , strxyz =
#strxyz#
</cfoutput>
Answers:
• strabc = abc ,
strxyz = xyz
• strabc = 123 ,
strxyz = 321
• strabc = abc123
, strxyz = xyz321
• strabc = abc
123 , strxyz = xyz 321
• strabc =
abc,123 , strxyz = xyz,321
• None of the
above
102. Which ColdFusion tag is used to stop the
processing on the current page and opens a new ColdFusion or html file?
Answers:
• cfredirection
• cfrelocate
• cflocation
• cfnewpage
103. Which of the following statement(s) are
correct?
Answers:
• <cfdirectory
directory="//12.12.54.65/c/" name="dirQuery"
action="LIST">
• <cfdirectory
directory="c:\inetpub\wwwroot" name="dirQuery"
action="LIST">
• <cfdirectory
directory="http://12.12.54.65/c/" name="dirQuery"
action="LIST">
• Both a and b
• Both b and c
104. Which of the following statements about
User defined functions (UDFs) are correct.
Answers:
•
<cfscript> code can call functions but not tags
• User defined
functions written in <cfscript> can call CFML tags
•
<cffunction> is one of the tags in ColdFusion MX used for creating UDFs
•
<cfreturn> is one of the tags in ColdFusion MX used for creating UDFs
105. Which of the following functions is not
available with Coldfusion arrays?
Answers:
• ArrayLen
• ArraySort
• ArrayDelete
• ArrayAppend
106. Which of the following constitutes CFML?
Answers:
• Functions and
expressions
• Variables and
constants
• Flow control
structures
• All of the
above
• both a and b
107. Which of the following statements is
correct with regard to user defined functions?
Answers:
• Function
overloading is allowed in user defined functions
• Function
definitions can be nested in user defined functions
• Function name
must be different from the inbuilt function name, however it can be same as
some variable
• A user defined
function can be recursive
108. Which of the following attributes of the
cfquery tag was introduced in ColdFusion MX 7?
Answers:
• username
• debug
• result
• timeout
109. You created a Coldfusion form to get the
guest information from your website. The name of the input elements is same as
that in the database. The name of the data source is "GuestDSN" and
the table name is "TbGuest." Which of the following codes helps you
insert data in the table?
Answers:
• <cfinsert
DSN="GuestDSN" table="TbGuest">
• <cfinsert
datasource="GuestDSN" tablename="TbGuest">
• <insert
datasource="GuestDSN" tablename="TbGuest">
• <insert
DSN="GuestDSN" table="TbGuest">
110. Which of the following statements
regarding placing meta tags at the location *********** in the following code
are correct?
<cfset
browsers="MSIE,Mozilla">
<cfif 1. Which of the given options is
correct for the following code?
<cfupdate datasource="MIS"
tablename="user">
Answers:
• cfupdate is a
tag and datasource is a tag value
• cfupdate is an
attribute and user is attribute value
• tablename is a
tag and user is the tag value
• datasource is
the attribute name and MIS is the attribute value
2. What is the default value for the encoding
parameter of the hash function?
Answers:
• UTF-8
• It is specified
by the defaultCharset entry in the neo-runtime.xml file
• It varies
depending upon the locale settings of your computer
• ASCII
• EBCDIC
• UCS-2
• UTF-16
3. What does the Randomize function return?
Answers:
• A pseudo-random
integer number, in the range 0-5
• A pseudo-random
number, in the range 0-10
• A pseudo-random
decimal number, in the range 0-100
• A pseudo-random
decimal number, in the range 0-1
4. What is the output of the following code:
<cffunction name="thefunc"
returntype="numeric">
<cfargument name="x"
required="yes" type="numeric" default=2>
<cfreturn x*x>
</cffunction>
<cfoutput>
#thefunc()#
</cfoutput>
Answers:
• 2
• 3
• 4
• 5
5. Which ColdFusion tag is used to import a
Java Server Page (JSP) tag library?
Answers:
• cfjimport
• cfimport
• cfinclude
• cfinsert
• cfsetting
6. When would you prefer to use the
encrypt/decrypt functions instead of the hash function?
Answers:
• When you want
to encrypt blocks of text larger than 1 kb
• Hash is a
superior function, it is always preferred over encrypt/decrypt
• When you want
the ability to decrypt the encrypted string
• When you want
to use Blowfish algorithm for encryption
• When you want
to use MD5 algorithm for encryption
7. Which of the following is a correct way of
commenting in Coldfusion?
Answers:
• //
• <!-- -->
• /* */
• <!---
--->
8. What will XResult contain:
<cfset XResult = xmlSearch(XMLObject,
"//@size")>
Answers:
• An array
containing the attributes named size that fall directly beneath the root node
• An array
containing the nodes named size that fall directly beneath the root node
• An array
containing the attributes named size that fall anywhere beneath the root node
• An array
containing the nodes named size that fall anywhere beneath the root node
• An array
containing the elements named size that fall directly beneath the root node
9. The <cfhttp> tag can have multiple
<cfhttpparam> tags, subject to certain limitations. Which are these
limitations?
Answers:
• The formField
type attribute is only meaningful with the cfhttp tag POST and GET methods
• The file and
formField type attributes cannot be used with the cfhttp tag TRACE method
• The file type
attribute is only meaningful with the cfhttp tag POST and PUT methods
• Both a and c
• Both b and c
• All the above
10. What does the cfNTauthenticate tag do?
Answers:
• Returns the
version of Windows NT running on the web server
• It verifies if
the database being used by the application is running
• Authenticates a
user name and password against the Windows NT domain
• It
authenticates an original version of the ColdFusion server
11. The emp_data table has following values
for its department field:
marketing, production, production, sales,
NULL, NULL, Marketing, Null
What will the following query return:
<cfquery name="GetDeptData"
datasource="myDSN">
select distinct(department) as department_name
from emp_data
</cfquery>
Answers:
• marketing, production,
sales
• marketing,
production, sales, NULL
• marketing,
production, sales, NULL, NULL
• marketing,
production, sales, NULL, Marketing
• marketing,
production, sales, NULL, NULL, Marketing
• Impossible to
say, because it depends upon the underlying database
12. Which of the following tags is not useful
in handling exceptions?
Answers:
• cftry
• cfcatch
• cfrethrow
• cfabort
• cferror
13. which ColdFusion tag is used to define the
application scope like, enabling sessions, setting timeouts and specifying
client variable storage?
Answers:
• cfsession
• cfcookie
• cfapplication
• cfindex
14. Which of the statements with respect to
the following code is correct?
<cffunction name="daysmonths"
returntype="date">
<cfreturn
dateadd("d",1,Now())>
</cffunction>
<cfoutput>
#daysmonths()#
</cfoutput>
Answers:
• daysmonths() is
a user defined function
• date() is a
user defined function
• The output will
display tomorrows date
• The output will
display today's date
• The cffunction
tags are optional in this code
15. Which operator will be evaluated first in
the following statement:
<cfquery name="GetEmpData"
datasource="myDSN">
select (age + 3 * 4 / 2 - 8) from emp
</cfquery>
Answers:
• +
• -
• /
• *
16. When would you prefer to use the
<cfstoredproc> tag in place of the <cfquery> tag?
Answers:
• When you want
to execute a stored procedure instead of an in-line query
• When you want
to execute a stored procedure that returns multiple recordsets
• When you want
to execute a stored procedure that accepts parameters
• Never, because
<cfstoredproc> doesn't offer any advantages over <cfquery>
17. Which of the following techniques allow
the Coldfusion code to be used at many places with in an application?
Answers:
• cfinclude tag
• User Defined
functions
• CFML tags and
CFX
• Both a and c
• a, b, and c
18. The following structure stores the address
of one of the employees:
<cfset AddrStr= StructNew()>
<cfset
AddrStr.Address1="23/16">
<cfset AddrStr.Address2="Lismore
Street">
<cfset AddrStr.City="Manly">
<cfset AddrStr.Pincode="2065">
And the other Structure stores
"AddStr" as its one of the keys:
<cfset EmpStr = StructNew()>
<cfset EmpStr.Key=AddrStr>
What would you put inside
<cfoutput></cfoutput> tags to print the value of "City"
on the page?
Answers:
•
#EmpStr.key.City#
•
#EmpStr["key"].City#
•
#EmpStr.key["City"]#
•
#EmpStr["key"]["City"]#
• Any of the
above
• Both a and c
• EmpStr.key.City
19. What happens when the following code is
included in a cfm file:
<cflog file="myAppLog"
text="User Kim logged on.">
Answers:
• "User Kim
logged on" will be displayed in the browser
• A new log file
by the name of Kim will be created
• "User Kim
logged on" will replace the last record in the ColdFusion log file
• "User Kim
logged on" will be appended to the ColdFusion log file
20. Query of Queries cannot be performed on
cfassociate.
Answers:
• True
• False
21. What does the cfproperty tag do?
Answers:
• Defines
properties of a ColdFusion file
• Defines
properties of a ColdFusion user defined function
• Sets properties
for the ColdFusion application
• Defines
properties of a ColdFusion component
22. What will XResult contain:
<cfset XResult = xmlSearch(XMLObject,
"//info")>
Answers:
• An array
containing the info nodes that fall directly beneath the root node
• An array
containing the info nodes that fall anywhere beneath the root node
• All info nodes
will be returned along with their child and sub-child nodes
• This XPath
expression is erroneous
• An array
containing the attributes of all the info nodes that fall anywhere beneath the
root node
23. There are 5 info nodes in an XML document.
How will you obtain the value of the 3rd info node?
Answers:
• <cfset
XResult = xmlSearch(XMLObject, "/info[2]")>
• <cfset
XResult = xmlSearch(XMLObject, "/info[3]")>
• <cfset
XResult = xmlSearch(XMLObject, "/info[4]")>
• <cfset
XResult = xmlSearch(XMLObject, "/info(1)")>
• <cfset
XResult = xmlSearch(XMLObject, "/info[first()+2]")>
• <cfset
XResult = xmlSearch(XMLObject, "/info[last()-2]")>
24. Which of the following verity query types
is not valid?
Answers:
• Natural
• Search
• Internet
• Simple
• Explicit
25. Which of the following tags was introduced
in the ColdFusion MX series?
Answers:
• cfcalendar
• cfapplet
• cfbreak
• cfdirectory
26. What is correct syntax for accessing an
item of a structure?
Answers:
•
StructFind(item, struct)
•
StructFind(struct, item)
•
FindStruct(struct, item)
•
FindStruct(item, struct)
27. Consider the following <cfquery>
tag:
<cfquery name="GetTableData"
datasource="myDSN">
SELECT * FROM myTable
</cfquery>
Which condition should the WHERE clause
contain so that only those rows are returned that contain null in column
column1?
Answers:
• WHERE column1
is null
• WHERE column1 =
null
• WHERE column1
EQUALS null
• WHERE column1
NOT null
• WHERE column1
CONTAINS null
28. Which of the following makes CFMX7 better
than the previous MX version?
Answers:
• It has added
support for dot notation within a recordset name
• It has added
result attribute
• Deprecated
connectString, dbName, dbServer, provider, and providerDSN attributes
• It has added
cfquery.ExecutionTime
29. Evaluate the following SQL statement:
<cfquery name="GetEmpData"
datasource="myDSN">
SELECT e.employee_id, (.15* e.salary) + (.5 *
e.commission_pct) + (s.sales_amount * (.35 * e.bonus)) AS CALC_VALUE FROM
employees e, sales s WHERE e.employee_id = s.emp_id;
</cfquery>
What will happen if all the parentheses are
removed from the calculation in the SQL query?
Answers:
• The value
displayed in the CALC_VALUE column will be lower
• The value
displayed in the CALC_VALUE column will be higher
• There will be
no difference in the value displayed in the CALC_VALUE column
• An error will
be reported
30. Which of the following statements is
correct with regard to Coldfusion Comments?
Answers:
• Nesting of
coldfusion comments is not allowed
• The comments
can be embedded in a function or tag name
• The comments
are allowed in the body of the document only
• The comments
are cleared by coldfusion engine before presenting output to the browser
31. Which of the following can be used to
convert real number into integers?
Answers:
• Ceiling
• Int
• Round
• Fix
• All of the
above
• a, c, and d
32. A code has to be generated by using
'PageCode' and 'ProductCode,' whose numeric values are derived from a database:
<cfset ArPage=ArrayNew(1)>
<cfset ProductCode = #PCode#>
<cfset ClassCode = #CCode#>
You have to assign value "superherb"
to ArPage where index is concatenation of ProductCode and ClassCode. Which of
the following ways would you use?
Answers:
• <cfset
ArPage[#ProductCode##ClassCode#] = "Superherb">
• <cfset ArPage[#ProductCode#
#ClassCode#] = "Superherb">
• <cfset
#ArPage[ProductCode & ClassCode]# = "Superherb">
• <cfset
ArPage[#ProductCode# & #ClassCode#] = "Superherb">
33. Which of the following constitute the core
components of ColdFusion MX?
Answers:
• ColdFusion
application server
• ColdFusion
Markup Language
• ColdFusion MX
Administrator
• All of the
above
34. Which of the following is not a valid
array function?
Answers:
• ArrayAppend
• ArrayInsertAt
• ArraySize
• ArrayPrepend
• None of the
above
35. You need to set the value for 'UserName'
to ''Guest'' if a user does not fill in the user name in the Coldfusion form.��Which of the following ways help you
implement this?
Answers:
• <cfset
Form.UserName=''Guest''>
• <cfparam
name=''Form.UserName'' default=''Guest''>
• <cfparam
name=''Form.UserName'' optional=''Guest''>
• <cfparam
name=''Form.UserName'' value=''Guest''>
36. What will be the result of placing the
following code in any cfm file:
<!---
<cflock timeout=20
scope="Session" type="Exclusive">
<cfset StructDelete(Session,
"ShoppingCartItems")>
</cflock>
--->
Answers:
• The page will
be timed out after 20 seconds
• The current
session will time out after 20 minutes
• Delete all
session variables
• Nothing will
happen
37. Which of the following allows the use of
CFML tags within its body?
Answers:
• UDF
• CFScript
• UDF and
CFScript
• None of the
above
38. Which of the following structure
assignments is correct?
Answers:
• <cfset
objStruct.value1 = "value">
• <cfset
objStruct[0].value1 = "value">
• <cfset
objStruct[0] = "value">
• All the above
39. Which of the following statements is
correct with regard to Coldfusion functions?
Answers:
• Nesting of
functions is not allowed
• Functions can
be created using cffunction or cfscript tag
• Function may return
a value
• In-built
functions can't be used with user defined ones
40. Which encryption engine is used by the
ColdFusion MX encrypt and hash functions?
Answers:
• PGP 8.0
• Java
Cryptography Extension (JCE)
• CryptoText
Encryption Library
• Microsoft High
Encryption Pack
41. Which of the following is an invalid
variable scope?
Answers:
• Super
• This
• Caller
• Server
42. What is the result of the following code:
<cfset mystring = "'Newton's Law',
'Fermat's Theorem'">
<cfoutput>
#PreserveSingleQuotes(mystring)#
</cfoutput>
Answers:
• 'Newton's Law',
'Fermat's Theorem'
• Newton's Law,
Fermat's Theorem
• "Newton's
Law", "Fermat's Theorem"
• 'Newtons Law',
'Fermats Theorem'
43. What will XResult contain:
<cfset XResult = xmlFind(XMLObject, "//info@size='3'")>
Answers:
• All the info
elements that have an attribute called size with a value of 3
• The size
attribute of the third info node
• The info
attribute of the third size node
• The statement
contains an error
44. Which of the following statements are true
when you upload an image file using the <cffile> tag?
Answers:
• You can know
the size and dimensions of the image before actually uploading the image
• You can give
your own file name when the file is uploaded for the first time
• You can set the
action parameter value to "copy, rename"
• Both a and b
• Both b and c
45. You want create PDF files of your XHTML
documents using ColdFusion MX. How can you do this?
Answers:
• It cannot be
done
• You will have
to write your own highly complex code for doing this
• You can use
XSLT and XSL-FO to render the XHTML as a PDF
• There is a
function available in ColdFusion for creating PDFs
46. If the following code is inserted into
your website, when will the cookies expire?
<CFCOOKIE NAME="CFID"
VALUE="#Session.CFID#">
<CFCOOKIE NAME="CFTOKEN"
VALUE="#Session.CFTOKEN#">
Answers:
• when the
session ends
• When the
application ends
• This code has
no effect on the expiration of the cookies
47. Which of the following ColdFusion tags is
used to get the elements, variables and values of ColdFusion objects?
Answers:
• cfcollect
• cfcomponent
• cfdump
• cfdocument
48. Which of the below statements are correct
regarding the following code:
<cfset a = GetTickCount()>
<cfloop from="1"
to="10000" index="i">
</cfloop>
<cfset b = GetTickCount()>
<cfscript>
c = GetTickCount();
for (i = 1; i LTE 10000; i = i+1) ;
d = GetTickCount();
</cfscript>
<cfoutput>#b-a# vs.
#d-c#</cfoutput>
Answers:
• The results are
always the same each time the code is run
• The results
vary each time the code is run
• This code will
give an error when run
49. Which of the following statement is
correct?
Answers:
• The coldfusion
script is contrary to Java script
• The coldfusion
script runs on client system
• The coldfusion
script is used for creating user defined functions
• The coldfusion
script provides access to some of the in-built coldfusion functions
50. You want to display the titles of books
that meet the following criteria:
1. Purchased before November 11, 2002
2. Price is less than $500 or greater than
$900
You want to sort the result by the date of
purchase, starting with the most recently bought book.
Which of the following queries will you use in
the <cfquery> tag?
Answers:
• SELECT
book_title FROM books WHERE price between 500 and 900 AND purchase_date <
'11/11/2002' ORDER BY purchase_date;
• SELECT
book_title FROM books WHERE price IN (500, 900) AND purchase_date <
'11/11/2002' ORDER BY purchase date ASC;
• SELECT book_title
FROM books WHERE price < 500 OR>900 AND purchase_date DESC;
• SELECT
Book_title FROM books WHERE price < 500 OR price > 900 AND purchase_date
< '11/11/2002' ORDER BY purchase date DESC;
51. A company has the following departments:
Marketing, Designing, Production, Packing
What will the following query return?
<cfquery name="GetDeptData"
datasource="myDSN">
select * from departments where department
< 'Marketing'
</cfquery>
Answers:
• The query will
return "Designing, Marketing"
• The query will
return "Designing, Production, Packing"
• The query will
return "Packing"
• Strings cannot
be compared using < operator
• The query will
return "Designing"
52. What is the output of the following code:
<CFPARAM DEFAULT="ProjectManager"
NAME="Status">
<CFPARAM DEFAULT="Six Sigma"
NAME="ProjectType">
<CFIF
IsDefined("FORM.Status")>
Welcome
<CFOUTPUT>#FORM.Status#</CFOUTPUT>
<CFELSEIF IsDefined("Status")>
You are not a
<CFOUTPUT>#Status#</CFOUTPUT>
<CFELSE>
Welcome
</CFIF>
Answers:
• Welcome
ProjectManager
• You are not a
ProjectManager
• Welcome
• Six Sigma
ProjectManager
• You are not a
Six Sigma
• None of the
above
53. Which of the following constitute the
common characteristics shared by most of the Coldfusion Tags?
Answers:
• They start with
cf
• They have a
closing tag as well
• They have
attributes and most attributes have values
• All of the
above
• Both a and b
54. Which of the following characters need
escaping?
Answers:
• #
• "
• '
• @
• All of the
above
• a, b, and c
55. What is the output of the following code:
<cfscript>
function autoLeadIn(string,count) {
output = '';
if(Trim(string) NEQ '') {
textarray = ListToArray(string, "
");
if(ArrayLen(textarray) LTE count) {
count = ArrayLen(textarray);
}
for(i=1; i LTE count; i=i+1)
{
output = output & textarray[i];
if(i neq count) {
output = output & " ";
}
}
}
return output;
}
</cfscript>
<cfoutput>#autoleadin("qwerty
asdfg, poiuy, zxcvb",3)#</cfoutput>
Answers:
• qwerty asdfg,
poiuy,
• qwerty asdfg,
poiuy
• qwerty asdfg
• qwerty asdfg,
poiuy, zxcvb
56. You have created an extension to
Coldfusion tag named "CalcClass." It needs one integer argument named
"IntValue." Which of the following enables you to call that in the
Coldfusion code?
Answers:
• <cftag
class=CalcClass IntValue=20>
• <cfx
name=CalcClass IntValue=20>
•
<cfx_CalcClass IntValue=20>
• <cfx
tag=CalcClass IntValue=20>
57. Your website has to display the personal
information of the user when he logs in. The table storing the personal details
is 'TbUser' (with primary key Uid) and the data source is 'UserDSN.' The user
id ('Uid') is passed by the login screen. Which of the following helps you
retrieve the information from the database?
Answers:
• <cfselect
name="GetUserDetails" DSN="UserDSN"> select * from
TbUser where Uid = #This.Uid# </cfselect>
• <cfquery
name="GetUserDetails" datasource="UserDSN"> select *
from TbUser where Uid = #URL.Uid# </cfquery>
• <cfselect
name="GetUserDetails" DSN="UserDSN"> select * from
TbUser where Uid = #Form.Uid# </cfselect>
• <cfquery
datasource="UserDSN"> select * from TbUser where Uid = #URL.Uid#
</cfquery>
58. What is the output of the following code:
<cfscript>
function calculateresult()
{
var a=55;
var b=5;
b=b-a*b+a;
return b;
}
</cfscript>
<cfoutput>#calculateresult()#</cfoutput>
Answers:
• -215
• 215
• -325
• 325
59. What is the output of the following code:
<cfoutput>reverse(6*2) equals
#reverse(6*2)#</cfoutput>
Answers:
• reverse(6*2)
equals 12
• reverse(2*6)
equals 21
• reverse(6*2)
equals 21
• reverse(2*6)
equals 12
60. Which of the following tags do not work in
the ColdFusion MX series?
Answers:
• cfauthenticate
• cfapplication
• cfloginuser
• cfmodule
61. What is the output of the following code:
<cfscript>
function calculateresult()
{
var a=55;
var b=5;
b=a+b;
b=b+b;
return b;
}
</cfscript>
<cfoutput>#calculateresult()#</cfoutput>
Answers:
• 100
• 120
• 10
• 65
62. What is the output of the following code:
<cfoutput>
<cfset stringToSearch =
"The quick brown fox jumped over the lazy dog.">
#find("the",stringToSearch)#
#find("the",stringToSearch,35)#
#find("no such
substring",stringToSearch)#
</cfoutput>
Answers:
• 3300
• 0 0 33
• 0 33 0
• 33 0 0
63. You need to create a website using
ColdFusion that spans across several servers. What will be the preferred
technique for maintaining session state across the servers considering that
some users might have cookies disabled on their browsers?
Answers:
• Use session
variables
• Use the CFID
and CFTOKEN cookies to track sessions
• Pass the CFID
and CFTOKEN variables to every URL, form action and hyperlink and set the
ClientManagement attribute of your CFApplication tag to "yes"
• Pass the CFID
and CFTOKEN variables to every URL, form action and hyperlink and set the
ClientManagement attribute of your CFApplication tag to "no". Set the
"ClientStorage" attribute of the CFAPPLICATION tag to your specified
datasource
• This cannot be
accomplished
64. What is the output of the following code:
<cfoutput>#IncrementValue(123.35)#</cfoutput>
Answers:
• 123
• 124
• 123.5
• 122
• 100
65. What is the output of the following code:
<cfset myArray = ArrayNew(1)>
<cfset myArray[1] = "Test
Value">
<cfset temp =
ArrayAppend(myArray, "Akash")>
<cfset temp =
ArrayAppend(myArray, "Peterson")>
<cfset temp
= ArrayAppend(myArray, "Dave Heartsdale")>
<cfset temp = ArrayAppend(myArray, "Aaron Smith")>
<cfoutput>
<p>This
array has #ArrayLen(MyArray)# elements.
</cfoutput>
Answers:
• This array has
1 elements
• This array has
5 elements
• Test Value,
Akash, Peterson, Dave Heartsdale, Aaron Smith
• This array has
Test Value, Akash, Peterson, Dave Heartsdale, Aaron Smith
66. Examine the data in the EMPLOYEES table
given below:
LAST_NAME
DEPTARTMENT_ID
SALARY
ALLEN
10
3000
MILLER
20
1500
King
20
2200
Davis
30
5000
Which of the following queries will execute without
error?
Answers:
• <cfquery
name="GetEmpInfo" datasource="myDSN"> SELECT * FROM
employees where salary > (SELECT MIN(salary) FROM employees GROUP BY
department_id) </cfquery>
• <cfquery
name="GetEmpInfo" datasource="myDSN"> SELECT * FROM
employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY
department_id) </cfquery>
• <cfquery
name="GetEmpInfo" datasource="myDSN"> SELECT distinct
department_id FROM employees Where salary IN (SELECT AVG(salary) FROM employees
GROUP BY department_id) </cfquery>
• <cfquery
name="GetEmpInfo" datasource="myDSN"> SELECT
department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM
employees GROUP BY AVG(SALARY)) </cfquery>
67. A coldfusion list is defined as follows:
<cfset list1="24,25,26,27,">
<cfset list2="24,,25,26,27">
<cfset
list3="24,,,,25,26,27,">
<cfset
list4="24,25,,26,,27,,">
What will you get on printing
"listlen" for all the above lists?
Answers:
• 4, 5, 7, 7
• 4, 4, 7, 7
• 4, 4, 4, 4
• 4, 5, 6, 6
68. You have written a cfquery ("HireSalaries")
to retrieve two derived columns "Year" and "AverageHike."
Which of the following is the right way to plot an area type line graph with
this cfquery?
Answers:
•
<cfchartseries chartWidth=380 show3D="yes"> <cfchart
type="area" query="HireSalaries"
valueColumn="AverageHike"
itemColumn="Year"/></cfchartseries>
• <cfchart
chartWidth=380 show3D="yes"> <cfchartseries
type="area" query="HireSalaries"
value="AverageHike" item="Year"/></cfchart>
• <cfchart
chartWidth=380 show3D="yes"> <cfchartseries type="area"
query="HireSalaries" valueColumn="AverageHike"
itemColumn="Year"/></cfchart>
69. Which of the following statements with
respect to the below code is correct?
<cfset RandomItem = RandRange(1,
greatoffers.recordcount)>
<CFOUTPUT QUERY="greatoffers"
MAXROWS=1 STARTROW=#RandomItem#>
<B>#ProductTitle#</B> -
#DollarFormat(greatoffers.Special_Price)#<BR>
</CFOUTPUT>
Answers:
• This code will
display the first record from the complete greatoffers table
• This code will
display a random record from the complete greatoffers table leaving out the
first record
• This code will
display a random record from the complete greatoffers table
• This code will
display the last record from the complete greatoffers table
• This code will
display a random record from the complete greatoffers table leaving out the
last record
70. Which of the following statements is
incorrect with regard to Coldfusion Tags?
Answers:
• Cold fusion has
vast library of in built tags
• CFX tags are
written using java or C++
• They must have
a closing tag
• The tags
without body can be closed using '/>' on the same line
71. Which of the following is not an in-built
complex data type in Coldfusion?
Answers:
• query
• array
• hashtable
• structure
72. Which function has been used to generated the
following output?
pro%20discount
Answers:
• URLEncode
• HtmlEditFormat
• UrlDecode
•
URLEncodedFormat
73. What is the output of the following code:
<cfset yourDate = CreateDate(2002, 11,
23)>
<cfoutput>
This is day #Day(YourDate)# in the month of
#MonthAsString(Month(yourDate))#, which has
#DaysInMonth(yourDate)#
days.
</cfoutput>
Answers:
• This is day 30
in the month of November, which has 30 days
• This is day 23
in the month of November, which has 30 days
• This is day 30
in the month of March, which has 30 days
• 23rd of
November, which has 30 days
74. An admin(role-type) function(ChkBalance)
has to be created for printing the account balance of all the users. Which of
the following ways helps one do this?
Answers:
• <cffunction
name="ChkBalance" returnType="numeric"
roles="admin" access="remote" output="yes">
• <function
name="ChkBalance" return="numeric" roles="admin"
access="local" output="no">
• <cffunction
name="ChkBalance" return="String" role="admin"
accessMode="remote" return=yes">
• <cffunction
id="ChkBalance" returnType="numeric" role="admin"
accessMode="local" return="no">
75. Which of the following is an incorrect
floop syntax:
Answers:
• <cfloop
index . . .
• <cfloop
counter . . .
• <cfloop
condition. . .
• <cfloop
query . . . <cfloop list . . .
76. What will the following code do when
included in a ColdFusion application?
<cfloop collection="#session#"
item="j">
<cfoutput>#j# has value of :
#session[j]#<br></cfoutput>
</cfloop>
Answers:
• It will list
out all the application variables
• It will list
out all the cookies
• It will list
out all the session variables
• It will list
out the Html header
77. What is the output of the following code:
<cfoutput>#REReplace("I love
jelly","jell(y|ies)","cookies")#</cfoutput>
Answers:
• I love jelly
• I love jellies
• I Love jelly,
cookies
• I love cookies
78. What is the output of the following code:
<cfset stringToSearch = "The quick
brown fox jumped over the lazy dog.">
<cfoutput>
#findoneof("aeiou",stringToSearch)#
#findoneof("aeiou",stringToSearch,4)#
#findoneof("@%^*()",stringToSearch)#
</cfoutput>
Answers:
• 3 6 0
• 360
• 3 6
• 3 6 0 0
79. What will the xInfo variable contain:
<cfset xInfo =
objXML.xmlRoot.xmlChildren[6]["info"].xmltext>
Answers:
• It returns the
text of the 6th tag named info
• It returns the
text of the 5th tag named info
• It returns the
attribute of the 5th tag named info
• It returns the
text of the 5th element named info surrounded by the <info></info>
tags
• None of the
above
80. Which of the following is not passed as
reference to the object?
Answers:
• structure
• array
• cfobject
• query
81. Which of the following statements is
correct with regard to Function?
Answers:
• Positional
arguments must be used in Function
• Named arguments
must be used in Function
• Either named or
positional arguments can be used in Function
• Both named and
positional arguments can be used in Function
82. Which of the following has the highest
operator precedence?
Answers:
• MOD
• *
• NOT
• +
83. Which of the following ColdFusion tags
aborts the processing of the current ColdFusion page?
Answers:
• cfabort
• cfabandon
• cfkill
• cfswitch
84. What is the output of the following code:
<cfoutput>
#dateformat(CreateDate(2001,08,10),"dd,mmm,yyyy")#
</cfoutput>
Answers:
• 8,OCT,2001
• 10,08,2001
• Aug,10,2001
• 10,Aug,2001
85. How will you test whether a cookie has
already been set on the clients browser?
Answers:
• <CFIF
IsDefined(COOKIE("VistorId"))>
• <CFIF
IsDefined("CFCOOKIE.VistorId")>
• <CFIF
IsDefined("COOKIE.VistorId")>
• None of the
above
86. Examine the code given below:
<cfquery name="GetEmpData"
datasource="myDSN">
SELECT employee_id FROM employees WHERE
commission_pct=.5 OR salary > 23000
</cfquery>
Which of the following statements is correct
with regard to this code?
Answers:
• It returns
employees whose salary is 50% more than $23,000
• It returns
employees who have 50% commission rate or salary greater than $23,000
• It returns
employees whose salary is 50% less than $23,000
• None of the
above
87. What will be the output of the given
expression:
evaluate("23" & 2 + 5)
Answers:
• 51
• 30
• 237
• 230
88. You have defined a field (EmailAd) on your
user registration form to get the user email. Which of the following helps you
validate the data before passing it to the database?
Answers:
•
IsValid("email", Form.EmailAd)
•
IsEmail(Form.EmailAd)
•
IsEmail(#Form.EmailAd#)
•
IsValidType("email", Form.EmailAd)
89. You wrote the following code to set the
prices of the items in an array:
<cfset numArray = ArrayNew(1)>
<cfset ArraySet(numArray, 1, 8 ,25)>
<cfset numArray[3] = "225">
<cfset PriceFound = False>
<cfset ElementNo = 0>
Storing the special price 225, you wrote the
following code to find the array number:
<cfloop condition = "(NOT PriceFound)
AND (ElementNo LT ArrayLen(numArray))">
<cfset ElementNo = ElementNo + 1>
<cfif
numArray[ElementNo] IS "225">
<cfoutput> PriceFound at ElementNo #ElementNo#<br></cfoutput>
<cfset PriceFound = true>
</cfif>
<cfoutput> Searching element . . . #ElementNo#<br></cfoutput>
</cfloop>
What will be the output?
Answers:
• Three lines for
'Searching element . . . ' and one line indicating the 'PriceFound at ElementNo
3'
• Two lines for
'Searching element . . . ' and one line indicating the 'PriceFound at ElementNo
2'
• Eight lines for
'Searching element . . . ' and one line indicating the 'PriceFound at ElementNo
3'
• A syntax error
90. Which of the following constitute the four
categories of the Coldfusion data types?
Answers:
• application,
binary, variant, and local
• simple,
complex, aggregate, and binary
• primary,
secondary, complex, and object
• simple,
complex, binary, and object
91. You have to pass a string named
"StrName" and an array named "ArrItems" to a custom tag.
Which of the following ways serves the purpose?
Answers:
• <cf_CustTag
StrName,ArrItems>
• <cf_CustTag
stringval=StrName arrayval=ArrItems>
• <cf_CustTag
stringval=#StrName# arrayval=#ArrItems#>
• <cf_CustTag
#StrName# #ArrItems#>
92. Which encryption algorithms are supported
by the encrypt/decrypt functions?
Answers:
• MD5
• SHA
• DES
• AES
• Blowfish
93. Which of the following functions are
specially used with regular expressions?
Answers:
• REFind
• REFindNoCase
• REReplace
• REReplaceNoCase
• All of the
above
94. Which encryption algorithms does the hash
function support?
Answers:
• CFMX_COMPAT
• MD5
• SHA
• SHA-256
• SHA-384
• SHA-512
• CBC
• Blowfish
95. Which of the following does not constitute
flow control tag in Coldfusion?
Answers:
• cfabort
• cfset
• cfdefaultcase
• cfloop
96. You have retrieved the list of all the customers
and the products bought for the day, using a cfquery. The structure
"CNameStr" stores the value of a customer's first, middle, and the
last name in the keys "First", "Middle", and
"Last." While printing the report, you want to create the following
label, only if the middle name exists:
<cfoutput>Middle Name:
#CNameStr.Middle#</cfoutput><br>
Which of the following code blocks serves this
purpose with <cfif></cfif> tags?
Answers:
• <cfif
StructKeyExists(CNameStr,Middle)>
• <cfif
StructKeyExists(CNameStr,"Middle")>
• <cfif
StructKeyExists("CNameStr","Middle")>
• <cfif
KeyExists("CNameStr",Middle)>
• <cfif
KeyExists(CNameStr,Middle)>
97. Which of the following is useful in
Dynamic Evaluation?
Answers:
• DEval
• Dynamic
• Evaluate
• Eval
98. With respect to the following code, which
option is correct?
<cfoutput>
#GetHttpTimeString(now())#
</cfoutput>
Answers:
• It will get the
current GMT time
• It will get the
current time of the users computer
• It converts the
current time into a string and stores it in a variable
• It will get the
current web server time
99. What is the output of the following code:
<cfsilent>
<cfset a = 100>
<cfset b = 99>
<cfset c = b-a>
<cfoutput>Inside cfsilent
block<br>
b-a = #c#</cfoutput><br>
</cfsilent>
<cfoutput>
b-a = #c#
</cfoutput>
Answers:
• -1=-1
• b-a=c
• b-a = -1
• Nothing will be
displayed
100. How do you decrypt text that has been
encrypted using the hash function?
Answers:
• By using the
unhash function
• By hashing the
encrypted text again
• It cannot be
done
• By using the
decrypt function
101. What is the output of the following code:
<cfset
strabc=setVariable("abc","abc123")>
<cfset
strxyz=setVariable("xyz","xyz321")>
<cfoutput>
strabc = #strabc# , strxyz =
#strxyz#
</cfoutput>
Answers:
• strabc = abc ,
strxyz = xyz
• strabc = 123 ,
strxyz = 321
• strabc = abc123
, strxyz = xyz321
• strabc = abc
123 , strxyz = xyz 321
• strabc =
abc,123 , strxyz = xyz,321
• None of the
above
102. Which ColdFusion tag is used to stop the
processing on the current page and opens a new ColdFusion or html file?
Answers:
• cfredirection
• cfrelocate
• cflocation
• cfnewpage
103. Which of the following statement(s) are
correct?
Answers:
• <cfdirectory
directory="//12.12.54.65/c/" name="dirQuery" action="LIST">
• <cfdirectory
directory="c:\inetpub\wwwroot" name="dirQuery"
action="LIST">
• <cfdirectory
directory="http://12.12.54.65/c/" name="dirQuery"
action="LIST">
• Both a and b
• Both b and c
104. Which of the following statements about
User defined functions (UDFs) are correct.
Answers:
•
<cfscript> code can call functions but not tags
• User defined
functions written in <cfscript> can call CFML tags
•
<cffunction> is one of the tags in ColdFusion MX used for creating UDFs
•
<cfreturn> is one of the tags in ColdFusion MX used for creating UDFs
105. Which of the following functions is not
available with Coldfusion arrays?
Answers:
• ArrayLen
• ArraySort
• ArrayDelete
• ArrayAppend
106. Which of the following constitutes CFML?
Answers:
• Functions and expressions
• Variables and
constants
• Flow control
structures
• All of the
above
• both a and b
107. Which of the following statements is
correct with regard to user defined functions?
Answers:
• Function
overloading is allowed in user defined functions
• Function
definitions can be nested in user defined functions
• Function name
must be different from the inbuilt function name, however it can be same as
some variable
• A user defined
function can be recursive
108. Which of the following attributes of the
cfquery tag was introduced in ColdFusion MX 7?
Answers:
• username
• debug
• result
• timeout
109. You created a Coldfusion form to get the
guest information from your website. The name of the input elements is same as
that in the database. The name of the data source is "GuestDSN" and
the table name is "TbGuest." Which of the following codes helps you
insert data in the table?
Answers:
• <cfinsert
DSN="GuestDSN" table="TbGuest">
• <cfinsert
datasource="GuestDSN" tablename="TbGuest">
• <insert
datasource="GuestDSN" tablename="TbGuest">
• <insert
DSN="GuestDSN" table="TbGuest">
110. Which of the following statements
regarding placing meta tags at the location *********** in the following code
are correct?
<cfset
browsers="MSIE,Mozilla">
<cfif
FindNoCase(browsers,#CGI.HTTP_USER_AGENT#)>
<**************>
</cfif>
Answers:
• The meta tags
will be hidden from all browser users
• The meta tags
will be hidden from Opera users
• The meta tags
will be hidden from unknown spiders
• The meta tags
will be hidden from MSIE and Mozilla users
• None of the
above
FindNoCase(browsers,#CGI.HTTP_USER_AGENT#)>
<**************>
</cfif>
Answers:
• The meta tags
will be hidden from all browser users
• The meta tags
will be hidden from Opera users
• The meta tags
will be hidden from unknown spiders
• The meta tags
will be hidden from MSIE and Mozilla users
• None of the
above