HumaneBITS
Biocon Limited Interview Questions and Answers
Q1. Table A has columns A-name, A-desc, A-BID, Table B has B-ID, B-name, A-BID is FK from B table, which JOIN to apply if want to get records which are A and B too.
Use INNER JOIN to get records from both Table A and Table B based on the foreign key A-BID.
Use INNER JOIN to combine records from Table A and Table B based on the common column A-BID.
Specify the join condition using ON clause.
Select the columns you want to retrieve from both tables.
Q2. Write PHP script to sort an array without PHP default functions
PHP script to sort an array without default functions
Create a function to implement a sorting algorithm like bubble sort, selection sort, or insertion sort
Loop through the array and compare each element with the next one to determine the order
Swap elements if they are in the wrong order until the array is sorted
Q3. Explain how login works in CodeIgniter/Laravel
Login in CodeIgniter/Laravel involves creating a form for users to input their credentials, validating the input, checking against database records, and setting a session for authenticated users.
Create a login form with fields for username and password
Validate user input to ensure it meets required criteria
Check the entered credentials against records in the database
Set a session for authenticated users to maintain their login status
Q4. How to set session for 5 mins
Use the session_set_cookie_params function to set session for 5 mins
Use session_set_cookie_params function to set the session cookie lifetime to 5 minutes
Example: session_set_cookie_params(300); // 300 seconds = 5 minutes
Q5. Difference between session & cookie
Session stores data on server side while cookie stores data on client side.
Session data is stored on the server, while cookie data is stored on the client's browser.
Sessions are more secure as the data is not exposed to the client, while cookies can be easily manipulated by the client.
Sessions are typically used for storing sensitive information like user credentials, while cookies are used for tracking user behavior or preferences.
Sessions expire when the user closes the bro...read more
Q6. Explain PDO in PHP
PDO in PHP is a PHP Data Objects extension that provides a consistent interface for accessing databases.
PDO stands for PHP Data Objects
It is a database access layer providing a uniform method of access to multiple databases
It is more secure than the traditional MySQL extension
PDO supports prepared statements to prevent SQL injection attacks
Reviews
Interviews
Salaries
Users/Month