MODULE-03(WEB DESIGNING) PART-03
PHP,PYTHAN,CLOUD &DBMS QUESTIONS MCQ:118 Questions With Answers:
01.What PHP stands for?
A. Hypertext Preprocessor
B. Pre Hypertext Processor
C. Pre Hyper Processor
D. Pre Hypertext Process
ANSWER: D
02.Which of the following tags is not a valid way to begin and end a PHP code block?
A.<% %>
B.<? ?>
C.<?PHP ?>
D.<! !>
ANSWER: B
03. How does the identity operator === compare two values?
A. It converts them to a common compatible data type and then compares the resulting values
B. It returns True only if they are both of the same type and value
C. If the two values are strings, it performs a lexical comparison
D. It bases its comparison on the
C strcmp function exclusively
E. It converts both values to strings and compares them
ANSWER: A
04.Under what circumstance is it impossible to assign a default value to a parameter while declaring a function?
A. When the parameter is Boolean
B. When the function is being declared as a member of a class
C. When the parameter is being declared as passed by reference
D. When the function contains only one parameter
E. Never
ANSWER: C
05.Variables always start with a ........ in PHP
A. Pond-sign
B. Yen-sign
C. Dollar-sign
E. Euro-sign
ANSWER: C
06.What is the value displayed when the following is executed?
Assume that the code was executed using the following URL:
testscript.php?c=25 <?php function process($c, $d = 25) { global $e; $retval = $c + $d - $_GET['c'] - $e; return $retval; } $e = 10; echo process(5); ?>
A. 25
B. -5
C. 10
D. 5
E. 0
ANSWER: B
07.PHP is an open source software
A. True
B. False
ANSWER: A
08.Which of the following is not valid PHP code?
A. $_10
B. ${“MyVar”}
C. &$something
D. $10_somethings
E. $aVaR
ANSWER: D
09.Doubt What is the difference between print() and echo()?
A. print() can be used as part of an expression, while echo() can’t
B. echo() can be used as part of an expression, while print() can’t
C. echo() can be used in the CLI version of PHP, while print() can’t
D. print() can be used in the CLI version of PHP, while echo() can’t
E. There’s no difference: both functions print out some text!
ANSWER: A, B
10.PHP runs on different platforms (Windows, Linux, Unix, etc.)
A. True
B. False
ANSWER: A
11.Which of the following will not combine strings $s1 and $s2 into a single string?
A. $s1 + $s2
B. "{$s1}{$s2}"
C. $s1.$s2
D. implode(' ', array($s1,$s2))
E. All the mentioned options combine the strings
ANSWER: A
12.Given a variable $email containing the string user@example.com, which of the following statements would extract the string example.com?
A. substr($email, strpos($email, "@"));
B. strstr($email, "@");
C. strchr($email, "@");
D. substr($email, strpos($email, "@")+1);
E. strrpos($email, "@");
ANSWER: D
13.Given a comma-separated list of values in a string, which function from the given list can create an array of each individual value with a single call?
A. strstr()
B. Cannot be done with a single function
C. extract()
D. explode()
E. strtok()
ANSWER: D
14.What is the best all-purpose way of comparing two strings?
A. Using the strpos function
B. Using the == operator
C. Using strcasecmp()
D. Using strcmp()
ANSWER: D
15.Which of the following PCRE regular expressions best matches the string php|architect?
A. .*
B. ...|.........
C. \d{3}\|\d{8}
D. [az]{3}\|[az]{9}
E. [a-z][a-z][a-z]\|\w{9}
ANSWER: E
16.Doubt Which of the following functions can be used to determine the integrity of a string?
A. md5()
B. sha1()
C. str_rot13()
D. crypt()
E. crc32()
ANSWER: A,B,E
17.What happens if you add a string to an integer using the + operator?
A. The interpreter outputs a type mismatch error
B. The string is converted to a number and added to the integer
C. The string is discarded and the integer is preserved
D. The integer and string are concatenated together in a new string
E. The integer is discarded and the string is preserved
ANSWER: B
18.The ___________ function can be used to compare two strings using a case-insensitive binary algorithm
A. strcmp()
B. stricmp()
C. strcasecmp()
D. stristr()
E. None of the above
ANSWER: C
19.Doubt Which of the following functions can be used to convert the binary data stored in a string into its hexadecimal representation?
A. encode_hex()
B. pack()
C. hex2bin()
D. bin2hex()
E. printf()
ANSWER: B,D
20.Doubt ^[A-Za-z].* matches
A. play it again
B. I
C. 123
D. ?
ANSWER: A,B
21.^[0-9]{5}(\-[0-9]{4})?$ matches
A. 90001 and 90002-4323
B. 9001 and 12-4321
ANSWER: A
22.Array values are keyed by ______ values (called indexed arrays) or using ______ values (called associative arrays). Of course, these key methods can be combined as well.
A. Float, string
B. Positive number, negative number
C. Even number, string
D. String, Boolean
E. Integer, string
ANSWER: E
23.What will the following script output? <?php $array = array (1, 2, 3, 5, 8, 13, 21, 34, 55); $sum = 0; for ($i = 0; $i < 5; $i++) { $sum += $array[$array[$i]]; } echo $sum; ?>
A. 78
B. 19
C. NULL
D. 5
E. 0
ANSWER: A
24.What elements will the following script output? <?php $array = array (true => 'a', 1 => 'b'); var_dump ($array); ?>
A. 1 => 'b'
B. True => 'a', 1 => 'b'
C. 0 => 'a', 1 => 'b'
D. None
E. It will output NULL
ANSWER: E
25.Which array function checks if the specified key exists in the array
A. array_key_exist()
B. array_key_exists()
C. array_keys_exists()
D. arrays_key_exists()
ANSWER: B
26.There are three different kind of arrays:
A. Numeric array, String array, Multidimensional array
B. Numeric array, Associative array, Dimensional array
C. Numeric array, Associative array, Multidimensional array
D. Const array, Associative array, Multidimensional array
ANSWER: C
27.Absent any actual need for choosing one method over the other, does passing arrays by value to a read-only function reduce performance compared to passing them by reference?
A. Yes, because the interpreter must always create a copy of the array before passing it to the function. B. Yes, but only if the function modifies the contents of the array.
C. Yes, but only if the array is large.
D. Yes, because PHP must monitor the execution of the function to determine if changes are made to the array.
E. No.
ANSWER: E
28.Assume you would like to sort an array in ascending order by value while preserving key associations. Which of the following PHP sorting functions would you use?
A. ksort()
B. asort()
C. krsort()
D. sort()
E. usort()
ANSWER: B
29.What function computes the difference of arrays?
A. array_diff
B. diff_array
C. arrays_diff
D. diff_arrays
ANSWER: A
30.Doubt What functions count elements in an array?
A. count
B. Sizeof
C. Array_Count
D. Count_array
ANSWER: A,B
31.What array will you get if you convert an object to an array?
A. An array with properties of that object as the array's elements.
B. An array with properties of that array as the object's elements.
C. An array with properties of that object as the Key elements.
D. An array with keys of that object as the array's elements.
ANSWER: A
32.Doubt Which of the following functions do not return a timestamp?
A. time()
B. date()
C. strtotime()
D. localtime()
E. gmmktime()
ANSWER: B, D
33.The getdate() function returns
A. An integer
B. A floating-point number
C. An array
D. A string
E. A Boolean
ANSWER: C .
34.......... Returns the time of sunrise for a given day / location
A. datesunrise()
B. date_sunrise()
C. date-sunrise()
D. date.sunrise()
ANSWER: B
35.What will the following script output?
<?php $time = strtotime ('2004/01/01'); echo date ('H:\i:s', $time); ?>
A. 00:00:00
B. 12:00:00
C. 00:i:00
D. 12:i:00
E. -1
ANSWER: C .
.36...............Checks a date for numeric validity.
A. check_date
B. verifydate
C. Verify_date
D. checkdate
ANSWER: D
37.What is the difference, in seconds, between the current timestamp in the GMT time zone and the current timestamp in your local time zone?
A. It depends on the number of hours between the local time zone and GMT
B. There is no difference
C. The two will only match if the local time zone is GMT
D. The two will never match
E. None of the above
ANSWER: B
38.You must make a call to ................... to specify what time zone you want calculations to take place in before calling any date functions.
A. date_default_timezone_set()
B. datedefault_timezone_set()
C. date_defaulttimezone_set()
D. date_default_timezoneset()
ANSWER: A
39.What would happen if the following script were run on a Windows server set to Moscow, Russia’s time zone?
<?php echo gmmktime(0, 0, 0, 1, 1, 1970); ?>
A. It would output the number 0
B. It would output the number -1
C. It would output the number 1
D. It would raise an error
E. It would output nothing
ANSWER: B
40.The ......... function parses an English textual date or time into a Unix timestamp
A. strtodate()
B. stroftime()
C. strtotime()
D. str_to_time()
ANSWER: C
.41................ Formats a local time or date according to locale settings.
A. strftime
B. strgtime
C. strhtime
D. stritime
ANSWER: A
42.In PHP, the difference between double quote and single quote is that variables . . . . in single quoted strings whereas they . . . . . in double quoted strings.
A. are not parsed, are parsed
B. are parsed, are not parsed
ANSWER: A
43.PHP strings are binary-safe (i.e. they can contain null bytes) . Their size is limited only by the amount of memory that is available to PHP.
A. True
B. False
ANSWER: A
44.Print substr (‘watch out for that tree’,20,5); What is the output of above statement?
A. tree
B. tree’
C. ree
D. none of above
ANSWER: C
45.$var = 'HELLO WORLD!'; $var = ucfirst($var); What is the value of var?
A. Hello World!
B. hello world!
C. Hello world!
D. HELLO WORLD!
ANSWER: D
46.The functions strtolower() and strtoupper() work on individual characters and not on entire strings.
A. True
B. False
ANSWER: B
47.For trim, ltrim or rtrim, whitespace is defined as
A. newline
B. space
C. vertical tab
D. null
E. both a and B
F. all the mentioned options
ANSWER: F
48.Heredoc's are a great alternative to quoted strings because of increased readability and maintainability.
A. True
B. False
ANSWER: A
49.Which of the below is most useful for debugging:
A. print()
B. printf()
C. print_r()
D. echo
ANSWER: C
50.$name = “John”; $message = ‘Hello, $name’; What is the value of message?
A. Hello, John
B. it will print an error message
C. ‘Hello, $name’
D. none of above
ANSWER: C
51.$str = "Hello fri3nd, you're feeling happy today?”; echo str_word_count($str);
A. 7
B. 6
C. 5
D. 4
ANSWER: A
52.PYTHON What is answer of this expression, 22 % 3 is?
A. 7
B. 1
C. 0
D. 5
ANSWER: B
53.What is the output of this expression, 3*1**3?
A. 27
B. 9
C. 3
D. 1
ANSWER: C
54.Which of the following will run without errors ?
A. round(45.8)
B. round(6352.898,2,5)
C. round()
D. round(7463.123,2,1)
ANSWER: A
55.What dataype is the object below ? L = [1, 23, ‘hello’, 1].
A. list
B. dictionary
C. array
D. tuple
ANSWER: A
56.What does --------- 5 evaluate to?
A. +5
B. -11
C. +11
D. -5
ANSWER: A
57.What is the result of round(0.5) – round(-0.5)?
A. 1.0
B. 2.0
C. 0.0
D. None of the mentioned
ANSWER: B
58.What is the maximum possible length of an identifier?
A. 31 characters
B. 63 characters
C. 79 characters
D. none of the mentioned
ANSWER: D
59.All keywords in Python are in
A. lower case
B. UPPER CASE
C. Capitalized
D. None of the mentioned
ANSWER: D
60.Which of the following is an invalid statement?
A. abc = 1,000,000
B. a b c = 1000 2000 3000
C. a,b,c = 1000, 2000, 3000
D. a_b_c = 1,000,000
ANSWER: B
61.Which of these in not a core datatype?
A. Lists
B. Dictionary
C. Tuples
D. Class
ANSWER: D
62.What is the output when following code is executed ? print r"\nhello" The output is
A. a new line and hello
B. \nhello
C. the letter r and then hello
D. Error
ANSWER: B
63.What is the output of the following code ? example = "snow world" example[3] = 's' print example
A. snow
B. snow world
C. Error
D. snos world
ANSWER: C
64.What is the output of “hello”+1+2+3 ?
A. hello123
B. hello
C. Error
D. hello6
ANSWER: C
65.Suppose i is 5 and j is 4, i + j is same as
A. i.__add(j)
B. i.__add__(j)
C. i.__Add(j)
D. i.__ADD(j)
ANSWER: B
66.What is the output of the following? print('*', "abcdef".center(7), '*')
A. * abcdef *
B. * abcdef *
C. *abcdef *
D. * abcdef*
ANSWER: B
67.What is the output of the following? print("xyyzxyzxzxyy".count('xyy', 2, 11))
A. 2
B. 0
C. 1
D. Error
ANSWER: B
68.What is the output of the following? print("Hello {1} and {0}".format('bin', 'foo'))
A. Hello foo and bin
B. Hello bin and foo
C. Error
D. None of the mentioned
ANSWER: A
69.What is the output of the following? print('The sum of {0} and {1} is {2}'.format(2, 10, 12))
A. The sum of 2 and 10 is 12
B. Error
C. The sum of 0 and 1 is 2
D. None of the mentioned
ANSWER: A
70.What is the output of the following? print('ab'.isalpha())
A. True
B. False
C. None
D. Error
ANSWER: A
71.What is the output of the following? print('1.1'.isnumeric())
A. True
B. False
C. None
D. Error
ANSWER: B
72.What is the output of the following? print('a'.maketrans('ABC', '123'))
A. {97: 49, 98: 50, 99: 51}
B. {65: 49, 66: 50, 67: 51}
C. {97: 49}
D. 1
ANSWER: A
73.What is the output of the following? print('xyyxyyxyxyxxy'.replace('xy', '12', 100))
A. xyyxyyxyxyxxy
B. 12y12y1212x12
C. none of the mentioned
D. error
ANSWER: B
74.What is the output of the following? print('abcd'.translate({'a': '1', 'b': '2', 'c': '3', 'd': '4'}))
A. abcd
B. 1234
C. error
D. none of the mentioned
ANSWER: A
75.Cloud Computing When you add a software stack, such as an operating system and applications to the service, the model shifts to _____ model.
A. SaaS
B. PaaS
C. IaaS
D. All of the mentioned
ANSWER: A
76.Which of the following is most refined and restrictive service model ?
A. IaaS
B. CaaS
C. PaaS
D. All of the mentioned
ANSWER: C
77.All cloud computing applications suffer from the inherent _______ that is intrinsic in their WAN connectivity.
A. propagation
B. latency
C. noise
D. All of the mentioned
ANSWER: B
78.Cloud computing is a _______ system and it is necessarily unidirectional in nature.
A. stateless
B. stateful
C. reliable
D. 4
ANSWER: A
79. Which of the following is best known service model ?
A. SaaS
B. IaaS
C. PaaS
D. All of the mentioned
ANSWER: D
80.The __________ model originally did not require a cloud to use virtualization to pool resources.
A. NEFT
B. NIST
C. NIT
D. All of the mentioned
ANSWER: B
81.Which of the following is related to service provided by Cloud ?
A. Sourcing
B. Ownership
C. Reliability
D. AaaS
ANSWER: A
82.________ dimension corresponds to two different states in the eight possible cloud forms.
A. Physical location of data
B. Ownership
C. Security boundary
D. None of the mentioned
ANSWER: D
83._______ is a complete operating environment with applications, management, and the user interface.
A. IaaS
B. SaaS
C. PaaS
D. All of the mentioned
ANSWER: B
84.Which of the following cloud concept is related to pooling and sharing of resources?
A. Polymorphism
B. Abstraction
C. Virtualization
D. None of the mentioned
ANSWER: C
85.DBMS The candidate key is that you choose to identify each row uniquely is called ……………..
A. Alternate Key
B. Primary Key
C. Foreign Key
D. None of the above
ANSWER: B
86.…………….. is used to determine whether a table contains duplicate rows.
A. Unique predicate
B. Like Predicate
C. Null predicate
D. In predicate
ANSWER: A
87.To eliminate duplicate rows ……………… is used
A. NODUPLICATE
B. ELIMINATE
C. DISTINCT
D. None of these
ANSWER: C
88.State true or false i. A candidate key is a minimal super key. ii. A candidate key can also refer to a surrogate key.
A. i-true, ii-false
B. i-false, ii-true
C. i-true, ii-true
D. i-false, ii-false
ANSWER: C
89.DCL stands for
A. Data Control Language
B. Data Console Language
C. Data Console Level
D. Data Control Level
ANSWER: A
90.…………………… is the process of organizing data into related tables.
A. Normalization
B. Generalization
C. Specialization
D. None of the above
ANSWER: A
91.A ………………. Does not have a distinguishing attribute if its own and most are dependent entities, which are part of some another entity.
A. Weak entity
B. Strong entity
C. Non-attributes entity
D. Dependent entity
ANSWER: A
92.…………….. is the complex search criteria in the where clause.
A. Substring
B. Drop Table
C. Predict
D. Predicate
ANSWER: D
93.………………… is the preferred method for enforcing data integrity
A. Constraints
B. Stored Procedure
C. Triggers
D. Cursors
ANSWER: A
94.The number of tuples in a relation is called its …………. While the number of attributes in a relation is called it’s ………………..
A. Degree, Cardinality
B. Cardinality, Degree
C. Rows, Columns
D. Columns, Rows
ANSWER: B
95.The language that requires a user to specify the data to be retrieved without specifying exactly how to get it is
A. Procedural DML
B. Non-Procedural DML
C. Procedural DDL
D. Non-Procedural DDL
ANSWER: B
96.Which two files are used during the operation of the DBMS?
A. Query languages and utilities
B. DML and query language
C. Data dictionary and transaction log
D. Data dictionary and query language
ANSWER: C
98.The database schema is written in
A. HLL
B. DML
C. DDL
D. DCL
ANSWER: C
99.The way a particular application views the data from the database that the application uses is a
A. module
B. relational model
C. schema
D. subschema
ANSWER: D
100.The relational model feature is that there
A. is no need for primary key data
B. is much more data independence than some other database models
C. are explicit relationships among records.
D. are tables with many dimensions
ANSWER: B
101.Which one of the following statements is false?
A. The data dictionary is normally maintained by the database administrator
B. Data elements in the database can be modified by changing the data dictionary.
C. The data dictionary contains the name and description of each data element.
D. A data dictionary is a tool used exclusively by the database administrator.
ANSWER: B
102.Which of the following are the properties of entities?
A. Groups
B. Table
C. Attributes
D. Switchboards
ANSWER: C
103.Which database level is closest to the users?
A. External
B. Internal
C. Physical
D. Conceptual
ANSWER: A
104.Which are the two ways in which entities can participate in a relationship?
A. Passive and active
B. Total and partial
C. Simple and Complex
D. All of the above
ANSWER: B
105. …….. data type can store unstructured data
A. RAW
B. CHAR
C. NUMERIC
D. VARCHAR
ANSWER: A
106.DBMS is a collection of ………….. that enables user to create and maintain a database.
A. Keys
B. Translators
C. Program
D. Language Activity
ANSWER: C
107.In a relational schema, each tuple is divided into fields called
A. Relations
B. Domains
C. Queries
D. All of the above
ANSWER: B
108.In an ER model, ……………. is described in the database by storing its data.
A. Entity
B. Attribute
C. Relationship
D. Notation
ANSWER: A
109.DFD stands for
A. Data Flow Document
B. Data File Diagram
C. Data Flow Diagram
D. Non of the above
ANSWER: C
110.A top-to-bottom relationship among the items in a database is established by a
A. Hierarchical schema
B. Network schema
C. Relational Schema
D. All the mentioned options
ANSWER: A
111.……………… table store information about database or about the system.
A. SQL
B. Nested
C. System
D. None of these
ANSWER: C
112.…………..defines the structure of a relation which consists of a fixed set of attribute-domain pairs.
A. Instance
B. Schema
C. Program
D. Super Key
ANSWER: B
113. ……………… clause is an additional filter that is applied to the result.
A. Select
B. Group-by
C. Having
D. Order by
ANSWER: C
114.A logical schema
A. is the entire database
B. is a standard way of organizing information into accessible parts.
C. Describes how data is actually stored on disk.
D. All of the above
ANSWER: B
115.………………… is a full form of SQL.
A. Standard query language
B. Sequential query language
C. Structured query language
D. Server side query language
ANSWER: C
116.A relational database developer refers to a record as
A. a criteria
B. a relation
C. a tuple
D. an attribute
ANSWER: C
117.………. keyword is used to find the number of values in a column.
A. TOTAL
B. COUNT
C. ADD
D. SUM
ANSWER: B
118.An advantage of the database management approach is
A. data is dependent on programs
B. data redundancy increases
C. data is integrated and can be accessed by multiple programs
D. none of the above
ANSWER: C
-------------------------------------------Next Intermediate Questions coming soon-------------------------
Comments
Post a Comment