Showing posts with label test. Show all posts
Showing posts with label test. Show all posts

Thursday, November 9, 2017

Basic PHP - Quiz

Hola! Les dejo un quiz o test sobre PHP básico.

Preguntas y respuestas sobre PHP 

1. ¿Cuál es el operador en PHP para acceder a propiedades y métodos de una instancia de clase?. Seleccione una:
 a. -> (guión y mayor que).
 b. . (punto)
 c. _ (guión bajo).
 d. : (dos puntos).

2. ¿Selecciona dos funciones nombradas incorrectamente?
Seleccione una o más de una:
a. 2imprimirResultado().
b. *imprimirResultado().
c. _imprimirResultado().
d. ImprimirResultado().


3. Selecciona dos palabras reservadas de PHP para definir constantes.
Seleccione una o más de una:
a. const.
b. define.
c. cons.
d. constant.


4. ¿Cómo se recibe un archivo proveniente de un formulario en un script de PHP?
Seleccione una:
a. Mediante el arreglo asociativo $_FILES y la llave con que fue enviado desde la vista.
b. Mediante el arreglo asociativo $_POST y la llave con que fue enviado desde la vista.
c. Mediante el arreglo asociativo $_GET y la llave con que fue enviado desde la vista.
d. Mediante el arreglo asociativo $_FILE y la llave con que fue enviado desde la vista.


5. Selecciona las funciones de PHP que permiten realizar gestión de archivos.
Seleccione una o más de una:
a. fopen
b. fread
c. fscan
d. fwriting


6. ¿Qué se debe configurar para poder iniciar la programación de Scripts en PHP?
Seleccione una:
a. Contar con un servidor, ya sea real o simulado en la máquina local.
b. Instalar un compilador de PHP de la página oficial de este lenguaje.
c. No se necesita ninguna configuración, se puede iniciar con la programación de inmediato.
d. Tener una máquina adicional que cumpla las funciones de cliente.


7. Selecciona dos tipos de datos compuestos de variables en PHP.
Seleccione una o más de una:
a. array.
b. object.
c. resource.
d. boolean.


8. ¿Cómo se puede mostrar el contenido de una variable de PHP, inmersa en un documento HTML?
Seleccione una:
a. Con las etiquetas de apertura y cierre de php y en su interior la palabra echo seguida por la variable.
b. En el HTML se usa la palabra echo y luego el nombre de la variable.
c. Usar la etiqueta de HTML < php > < /php > y en su interior la variable a imprimir.
d. No es posible realizar tal cosa.


9. ¿Cuál de las siguientes afirmaciones sobre los ciclos en PHP es falsa?
Seleccione una:
a. El ciclo do while evalúa la condición antes de ejecutar las acciones y hacer la iteración.
b. El ciclo while ejecuta las acciones después de evaluar la condición.
c. El ciclo for define el contador de iteración, la condición y el incremento en una sóla sentencia..
d. El ciclo foreach se encarga de recorrer arreglos u objetos..


10. ¿Cómo se retorna una respuesta desde un archivo PHP hacia una función Ajax que hizo una petición a dicho script?
Seleccione una:
a. Se usa la palabra reservada echo y a continuación lo que se desea enviar como respuesta.
b. Se usa la palabra reservada return y a continuación lo que se desea enviar como respuesta.
c. Se usa la palabra reservada response y a continuación lo que se desea enviar como respuesta.
d. No es posible enviar una respuesta a Ajax desde un archivo PHP.

Sunday, August 6, 2017

Preguntas respuestas Android 4

1. If we add the following property to a Widget:

 


The result is:
The Widget will show a splash screen using the preview image
The preview image will be set as a background on the Widget
The user will be able to see a preview of what the app widget looks like 

2. What is a Keystore on Android?
Contains keys to decompile different builds of an Android application
Contain access to private files on the project
Is a binary file that contains one or more private keys

3. Is it possible that Google Play Store accept an APK signed with a debug certificate for publishing?
No 
Yes

4. If we create a Widget with the following specifications:

minWidth: 110dp

minHeight: 250dp

How many columns and rows the widget is going to take on the screen (https://developer.android.com/guide/practices/ui_guidelines/widget_design.html)?
2 columns, 4 rows 
3 columns, 4 rows
2 columns, 2 rows

5. If we are creating a Widget which of the following class we need to declare on the AndroidManifest.xml?
AppWidgetProvider 
AppWidgetProviderInfo
WidgetContentProvider

6. What is a AppWidgetProvider class
A class that defines the basic widget information
Defines the basic methods that allow you to programmatically interact with the widget 
Is a class that extends from an Activity

7. Which property we need to set on the AppWidgetProviderInfo to defines how often the App Widget should update?
android:update
android:updatePeriod
android:updatePeriodMillis 

8. Is it possible to use Android Studio to generate signed APKs ?
Yes 
No
It is only possible on the command line

9. What is a Widget?
A View that displays a constraint layout
Widgets are miniature application views that can be embedded in other applications 
Widgets are a complete application views that can be merged in other applications

10. Is it necessary to define a initial layout for a widget?
No
Yes 


Saturday, August 5, 2017

Preguntas respuestas Android 3

1. If your application requires to represent structured data, which of the following methods you should use to save data?
SharedPreferences
SQL Databases
File System

2. Which of the following methods are used to read from SharedPreferences:
readInt() and readString()
getInt() and writeString()
getInt() and getString() 

3 If you need just one shared preferences file for your activity, which method you should use?
context.getSharedPreferences
getActivity().getSinglePreference
getActivity().getPreferences 

4. How can you acquire the appropriate directory of your application if you want to save a file to internal storage ?
getFiles() or geInternalDir()
getInternalStorage() or getInternalDir()
getFilesDir() or getCacheDir() 

5. Which of the following provides a key-value system to read and write small collection of data:
SQL Database
Shared Preferences 
ArrayList

6. Which of the following methods are used to write to SharedPreferences:
putInt() and putString() 
putInt() and writeString()
writeInt() and writeString()

7. Since external storage could be unavailable, which method can query the external storage state ?
queryStorageState()
getExternalStorageState() 
getStorageState()

8. How can you check the available space without causing an IOException?
getFreeSpace() or getTotalSpace() 
getFreeSpace()
checkFreeSpace() or checkTotalSpace()

9. Which method you should use to read data from a data base?
query()
readFromDB()
read()

10. What is a contract class if we are talking about data bases ?
Is a container for string constants
Is a class that contains the permissions for a data base
Is a container for constants that define names for URIs, tables, and columns 


Friday, August 4, 2017

Preguntas respuestas Android 2

1. What is a navigation Drawer?
It is a widget that animate a ViewPager
Is a panel that display app’s main navigation options on the left edge of the screen 
Is a panel that display app’s main navigation options on the right edge of the screen

2. Which of the following is a design pattern that avoids frequent call of findViewById() during ListView scrolling?
ListView
RelativeLayout
ViewHolder


3. Examine the following code:
Which is the missing line to add succesfully the fragment to the Activity
fragmentTransaction.commit(); 
No need to add an extra line since fragmentTransaction.add() add the fragment to the Activity
fragmentTransaction.addToActivity();

4. Which three methods we must implement for a RecyclerView?
onCreateViewHolder(), onDraw() and getItemCount()
onCreateViewHolder(), onAttachView() and getItemCount()
ConCreateViewHolder(), onBindViewHolder() and getItemCount() 

5. What is the primary use of a CoordinatorLayout?
A container for animations
A container for a specific interaction with one or more child views 
A container for a specific interaction with snackBar and ReciclerView

6. What are unit test?
Is a block of code that helps to develop software faster
Is a block of code that validates another block of code that the result is expected 
Is code that Android auto generated to verify that java code is correct implemented

Suposse whe have the next UI test on Espresso


7. Which is the obtained result?
The code will throw an error
Unsuccessful
Successful 

8. Which widget let the user to swipe left or right showing an entire new screen?
ListView
ViewPager 
Intent

9. When is recomended to use a floating action button?
When we have space available on the screen
When we want to use an intent on a button
When we have a clear action on the screen, that represent a primary action 

10. A container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views.
RelativeLayout
RecyclerView 
LinearLayout

Thursday, August 3, 2017

Preguntas respuestas Android 1

1. What is an advantage to use a debugger on Android Studio?
Examine variables and evaluate expressions at runtime 
Automatically eliminate errors on the application
Eliminate errors when .APK is generated

2. What is an Intent?
Intent is a messaging object you can use to request an action from another app component
Intents facilitate communication between components in several ways
All of the above 

3. In which of the following Activity Lifecycle makes the activity visible to the user
onStart() 
onCreate()
onPause()

Examine the following code: 


4. Suppose savedInstanceState is different from null, which is the correct output on the Logcat:
onCreate() No saved state available
onCreate() Restoring previous state 
TAG onCreate() Restoring previous state

5. Suppose we have a project called “MyProject”, where is the path for the string file resources?
MyProject/res/strings/string.xml
MyProject/res/values/string.xml 
MyProject/res/drawable/string.xml 

6. What is a Service?
It is an application component that can perform communication between layouts 
Service facilitates communication between fragments
It is an application component that can perform long-running operations in the background 

After you execute this explicit intent:
7. The result will be:
Intent is going to start DownloadService class 
The system will examine all of the installed apps to determine which ones can handle DownloadService
The code just creates a new intent

8. What is a breakpoint?
It is a signal that tells the debugger to temporarily suspend execution of the application 
It Fixes an error when the application is running
It is a signal that tells the debugger to continue the execution of the application

9. What is a Layout on Android?
It defines the visual structure for a user interface using an XML file 
It is a class that references a TextView
A Layout defines an XML permission for an application

Given the next .XML containing a group of checkboxes:

10. Which attribute do we need to add in order to add click event?
android:onClick 
android:click
android:listenerOnClick