SYNTEL Previous Years Solved Sample Placement Papers
- A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear) is known as _____________
a) Queue
b) Stack
c) Tree
d) Linked list
Answer: a) Queue - The data structure required for Breadth First Traversal on a graph is?
a) Stack
b) Array
c) Queue
d) Tree
Answer: c) Queue - What would be the asymptotic time complexity to insert an element at the front of the linked list (head is known)?
a) O(1)
b) O(n)
c) O(n²)
d) O(n³)
Answer: a) O(1) - What would be the asymptotic time complexity to find an element in the linked list?
a) O(1)
b) O(n)
c) O(n²)
d) O(n⁴)
Answer: b) O(n) - What would be the asymptotic time complexity to insert an element at the second position in the linked list?
a) O(1)
b) O(n)
c) O(n²)
d) O(n³)
Answer: a) O(1) - Which one of the following statements is used to create a table?
a) CREATE TABLE table_name (column_name column_type);
b) CREATE table_name (column_type column_name);
c) CREATE table_name (column_name column_type);
d) CREATE TABLE table_name (column_type column_name);
Answer: a) CREATE TABLE table_name (column_name column_type); - Which one of the following statements can be used to select the database?
a) $mysqli=select_db('databasename');
b) mysqli=select_db('databasename');
c) mysqli->select_db('databasename');
d) $mysqli->select_db('databasename');
Answer: d) $mysqli->select_db('databasename'); - Which of the methods are used to manage result sets using both associative and indexed arrays?
a) get_array() and get_row()
b) get_array() and get_column()
c) fetch_array() and fetch_row()
d) fetch_array() and fetch_column()
Answer: c) fetch_array() and fetch_row() - Which two predefined variables are used to retrieve information from forms?
a) $GET & $SET
b) $_GET & $_SET
c) $__GET & $__SET
d) GET & SET
Answer: b) $_GET & $_SET - When you use the $_GET variable to collect data, the data is visible to..
a) none
b) only you
c) everyone
d) selected few
Answer: c) everyone - When you use the $_POST variable to collect data, the data is visible to..
a) none
b) only you
c) everyone
d) selected few
Answer: b) only you - Which function is used to check whether a variable is an array or not?
a) on_array()
b) is_array()
c) the_array()
d) None
Answer: b) is_array() - Which function adds a new element at the end of an array?
a) push()
b) pop()
c) stack()
d) None
Answer: a) push() - Which function returns the last element of an array?
a) push()
b) pop()
c) stack()
d) None
Answer: b) pop()