Add office photos
Quikr logo
Engaged Employer

Quikr

Verified
3.7
based on 500 Reviews
Video summary
Filter interviews by
Software Developer
Skills
Clear (1)

30+ Quikr Software Developer Interview Questions and Answers

Updated 5 Feb 2024

Q1. Buy and Sell Stock Problem Statement

Imagine you are Harshad Mehta's friend, and you have been given the stock prices of a particular company for the next 'N' days. You can perform up to two buy-and-sell transa...read more

Ans.

The task is to determine the maximum profit that can be achieved by performing up to two buy-and-sell transactions on a given set of stock prices.

  • Iterate through the array of stock prices to find the maximum profit that can be achieved by buying and selling stocks.

  • Keep track of the maximum profit that can be obtained by performing up to two transactions.

  • Consider all possible combinations of buying and selling stocks to maximize profit.

  • Ensure to sell the stock before buying ag...read more

Add your answer
right arrow

Q2. Subsequences of String Problem Statement

You are provided with a string 'STR' that consists of lowercase English letters ranging from 'a' to 'z'. Your task is to determine all non-empty possible subsequences of...read more

Ans.

Generate all possible subsequences of a given string.

  • Use recursion to generate all possible subsequences by including or excluding each character in the string.

  • Maintain a current index to keep track of the characters being considered.

  • Append the current character to each subsequence generated so far.

  • Recursively call the function with the next index to include the next character in subsequences.

Add your answer
right arrow

Q3. Find Missing Number In String Problem Statement

You have a sequence of consecutive nonnegative integers. By appending all integers end-to-end, you formed a string S without any separators. During this process, ...read more

Ans.

Given a string of consecutive nonnegative integers with one missing number, find the missing integer.

  • Iterate through the string to find the missing number by checking the consecutive integers.

  • If there is more than one missing number, all integers are present, or the string is invalid, return -1.

  • Handle cases where the missing number is at the beginning or end of the sequence.

  • Consider edge cases such as single-digit numbers or the maximum length of the string.

Add your answer
right arrow

Q4. Pair Sum Problem Statement

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.

Note:

Each pa...read more

Ans.

Find pairs of elements in an array that sum up to a given value, sorted in a specific order.

  • Iterate through the array and use a hashmap to store the difference between the target sum and each element.

  • Check if the difference exists in the hashmap, if so, add the pair to the result list.

  • Sort the result list based on the criteria mentioned in the problem statement.

Add your answer
right arrow
Discover Quikr interview dos and don'ts from real experiences

Q5. Next Smallest Palindrome Problem Statement

Find the next smallest palindrome strictly greater than a given number 'N' represented as a string 'S'.

Explanation:

You are given a number in string format, and your ...read more

Ans.

Find the next smallest palindrome greater than a given number represented as a string.

  • Convert the string number to an integer for comparison.

  • Increment the number until a palindrome greater than the input is found.

  • Handle cases where the input is already a palindrome or has leading zeros.

  • Return the next greater palindrome as a string.

Add your answer
right arrow

Q6. Check If Linked List Is Palindrome

Given a singly linked list of integers, determine if the linked list is a palindrome.

Explanation:

A linked list is considered a palindrome if it reads the same forwards and b...read more

Ans.

Check if a given singly linked list of integers is a palindrome.

  • Create a function to reverse the linked list.

  • Use slow and fast pointers to find the middle of the linked list.

  • Compare the first half of the linked list with the reversed second half to determine if it's a palindrome.

Add your answer
right arrow
Are these interview questions helpful?

Q7. First Non-Repeating Character Problem Statement

You are given a string consisting of English alphabet characters. Your task is to identify and return the first character in the string that does not repeat. If e...read more

Ans.

The task is to find the first non-repeating character in a string, or return the first character if all characters repeat.

  • Iterate through the string to count the frequency of each character

  • Find the first character with a frequency of 1, or return the first character if no such character exists

  • Handle both uppercase and lowercase characters separately

  • Use a hashmap to store character frequencies efficiently

Add your answer
right arrow

Q8. If there is a website run by 2 servers. These 2 servers balances the load using Load Balancer. So, if 1 session is created on 1 server and say load is shift to another server immediately, then how session is ma...

read more
Ans.

Session is maintained using session affinity or sticky sessions.

  • Session affinity ensures that a user's session is always directed to the same server.

  • Load balancer uses a unique identifier to route requests to the same server.

  • Sticky sessions can be implemented using cookies or URL rewriting.

  • Session replication can also be used to maintain session data across multiple servers.

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop
Q9. How would you create a singleton design pattern in PHP 5?
Ans.

To create a singleton design pattern in PHP 5, use a private static variable to store the instance and a static method to retrieve it.

  • Create a private static variable to store the instance of the class.

  • Create a private constructor to prevent outside instantiation of the class.

  • Create a static method to check if an instance already exists and return it, or create a new instance if it doesn't.

Add your answer
right arrow
Q10. How can you extract the domain name from a URL using jQuery?
Ans.

Use jQuery to extract domain name from a URL

  • Use the 'a' element to create a temporary link with the URL

  • Access the 'hostname' property of the link to get the domain name

  • Use regular expressions to extract the domain name from the URL

Add your answer
right arrow
Q11. What is the difference between an abstract class and an interface in Object-Oriented Programming?
Ans.

Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.

  • Abstract class can have constructors, fields, and methods, while interface cannot have any implementation.

  • A class can only extend one abstract class, but can implement multiple interfaces.

  • Abstract classes are used to define common characteristics among subclasses, while interfaces are used to define a contract for classes to implement.

  • Example: Abstract class 'Animal'...read more

Add your answer
right arrow

Q12. Find the first non repetitive character in a string?

Ans.

Find the first non-repeating character in a string.

  • Create a hash table to store the frequency of each character in the string.

  • Iterate through the string and check the frequency of each character.

  • Return the first character with a frequency of 1.

View 2 more answers
right arrow

Q13. How to write a Connection class to MySQL database using PHP?

Ans.

To connect to MySQL database using PHP, create a Connection class.

  • Use mysqli_connect() function to establish a connection

  • Pass the database credentials as parameters to the function

  • Create a constructor method to initialize the connection

  • Create a query method to execute SQL queries

  • Close the connection using mysqli_close() method

Add your answer
right arrow

Q14. How to increase php memory at run time, if it exhausts?

Ans.

To increase PHP memory at run time, modify the php.ini file or use ini_set() function.

  • Edit the memory_limit value in php.ini file

  • Use ini_set('memory_limit', '256M') function to increase memory limit at run time

  • Check for memory leaks in the code

  • Use unset() function to free up memory after use

Add your answer
right arrow

Q15. Abstract class? How it is different from interface? Is multiple inheritance possible in php? How?

Ans.

Explaining abstract class, interface and multiple inheritance in PHP.

  • Abstract class is a class that cannot be instantiated and can have abstract methods.

  • Interface is a collection of abstract methods and constants that can be implemented by a class.

  • Multiple inheritance is not possible in PHP, but can be achieved using interfaces.

  • Interfaces can be implemented by multiple classes, allowing for multiple inheritance-like behavior.

Add your answer
right arrow
Q16. Can you explain the implementation of the Singleton Design pattern?
Ans.

Singleton Design pattern ensures a class has only one instance and provides a global point of access to it.

  • Ensure the class has a private static instance variable.

  • Provide a public static method to access the instance.

  • Make the constructor private to prevent instantiation from outside the class.

  • Lazy initialization can be used to create the instance only when needed.

  • Thread safety considerations may be necessary in a multi-threaded environment.

Add your answer
right arrow
Q17. Can you write code to connect PHP to MySQL?
Ans.

Yes, PHP can be used to connect to MySQL by using MySQLi or PDO extensions.

  • Use MySQLi extension to connect PHP to MySQL

  • Use PDO extension to connect PHP to MySQL

  • Example using MySQLi: $conn = new mysqli($servername, $username, $password, $dbname);

  • Example using PDO: $conn = new PDO('mysql:host=$servername;dbname=$dbname', $username, $password);

Add your answer
right arrow
Q18. What are the different types of errors in PHP?
Ans.

Different types of errors in PHP include syntax errors, runtime errors, and logical errors.

  • Syntax errors: Occur when there is a mistake in the code syntax, preventing the script from running.

  • Runtime errors: Happen during script execution, such as division by zero or calling a function that does not exist.

  • Logical errors: Difficult to detect as the code runs without errors, but produces incorrect results.

  • Fatal errors: Stop the script execution completely, such as calling an und...read more

Add your answer
right arrow

Q19. Given a no K and an array. Find pair of elements whose sum is equal to given no K

Ans.

Find pair of elements in an array whose sum is equal to a given number K.

  • Iterate through the array and for each element, check if K minus the element exists in the array.

  • Use a hash table to store the elements and their indices for faster lookup.

  • If multiple pairs exist, return any one of them.

  • If no pair exists, return null or an appropriate message.

Add your answer
right arrow
Q20. How does session management work in PHP?
Ans.

Session management in PHP involves storing user data on the server to maintain state between multiple requests.

  • Sessions are started using session_start() function in PHP.

  • Session data is stored on the server and a unique session ID is sent to the client's browser.

  • Session variables can be set, accessed, and unset using $_SESSION superglobal array.

  • Sessions can be destroyed using session_destroy() function.

Add your answer
right arrow

Q21. Find missing element in an array of elements from 0 to n-1?

Ans.

Find missing element in an array of elements from 0 to n-1

  • Calculate sum of all elements in array and subtract from sum of n natural numbers

  • Use XOR operation on all elements and n natural numbers

  • Sort the array and find the missing element

Add your answer
right arrow

Q22. WAP to check if linked list elements is a palindrome without using any extra space?

Ans.

WAP to check if linked list elements is a palindrome without using any extra space.

  • Traverse the linked list and reverse the second half of the list

  • Compare the first half with the reversed second half

  • Use two pointers to traverse the list, one at normal speed and other at double speed

Add your answer
right arrow

Q23. WAP to get smallest plindron number larger than the given no?

Ans.

WAP to find smallest palindrome number larger than given number.

  • Convert the given number to string and check if it is already a palindrome.

  • If not, increment the number and check if it is a palindrome.

  • Repeat until a palindrome number larger than the given number is found.

  • Use a while loop to implement the above steps.

Add your answer
right arrow

Q24. Write a stored procedure from a given set of tables and conditions. Simple one

Ans.

Write a stored procedure from given tables and conditions

  • Identify the tables and their relationships

  • Determine the conditions to be used in the stored procedure

  • Write the SQL code for the stored procedure

  • Test the stored procedure to ensure it returns the desired results

Add your answer
right arrow
Q25. What is the critical section problem?
Ans.

The critical section problem is a synchronization issue in concurrent programming where multiple processes access shared resources.

  • Critical section is a code segment that accesses shared resources and must be executed by only one process at a time.

  • The goal is to prevent race conditions and ensure mutual exclusion.

  • Solutions include using locks, semaphores, and mutex to control access to critical sections.

  • Example: Multiple threads accessing a shared variable in a multithreaded ...read more

Add your answer
right arrow
Q26. How can we create a thread in Java?
Ans.

A thread in Java can be created by extending the Thread class or implementing the Runnable interface.

  • Extend the Thread class and override the run() method

  • Implement the Runnable interface and provide the implementation for the run() method

  • Start the thread using the start() method

Add your answer
right arrow

Q27. What are the different types of error in php?

Ans.

There are three types of errors in PHP: syntax errors, runtime errors, and logical errors.

  • Syntax errors occur when the code is not written correctly, such as missing semicolons or parentheses.

  • Runtime errors occur during the execution of the code, such as trying to access an undefined variable.

  • Logical errors occur when the code runs without errors, but produces unexpected results, such as a miscalculation in a formula.

Add your answer
right arrow

Q28. WAP to implement some basic Design Patterns like Singleton?

Ans.

Singleton pattern ensures only one instance of a class is created and provides a global point of access to it.

  • Create a private constructor to prevent direct instantiation of the class

  • Create a private static instance of the class

  • Create a public static method to access the instance

  • Ensure thread safety by using synchronized keyword or static initialization block

  • Examples: Logger, Configuration Manager, Database Connection Manager

Add your answer
right arrow

Q29. What all we can do with php.ini?

Ans.

php.ini is a configuration file for PHP that allows users to customize various settings.

  • Change PHP settings such as memory limit, file upload size, and error reporting

  • Enable or disable extensions and modules

  • Set timezone and language settings

  • Configure email settings

  • Control caching and session settings

Add your answer
right arrow
Q30. What is connection pooling?
Ans.

Connection pooling is a technique used to manage a pool of database connections to improve performance and efficiency.

  • Connection pooling reduces the overhead of opening and closing database connections for each request.

  • It allows multiple clients to reuse a pre-established set of connections to the database.

  • Connection pooling helps in improving the scalability and performance of applications by efficiently managing database connections.

  • Example: In Java, frameworks like Apache ...read more

Add your answer
right arrow

Q31. Jquery function to get domain from a url?

Ans.

Use window.location to get domain from a url in jQuery.

  • Use window.location to get the full url

  • Use .hostname to get the domain name

  • Use .replace() to remove 'www.' if present

Add your answer
right arrow
Q32. Write a stored procedure to join two tables.
Ans.

A stored procedure to join two tables in a database.

  • Use the JOIN keyword to combine rows from two or more tables based on a related column between them.

  • Specify the columns to be selected from each table in the SELECT statement.

  • Use the ON keyword to specify the join condition.

  • Consider using INNER JOIN, LEFT JOIN, RIGHT JOIN, or FULL JOIN based on the desired result.

  • Test the stored procedure with sample data to ensure it returns the expected results.

Add your answer
right arrow
Q33. What are closures in JavaScript?
Ans.

Closures in JavaScript are functions that have access to variables from their outer scope even after the outer function has finished executing.

  • Closures allow functions to access variables from their parent function even after the parent function has finished executing.

  • They are created whenever a function is defined within another function.

  • Closures are commonly used to create private variables and functions in JavaScript.

  • Example: function outerFunction() { let outerVar = 'I am...read more

Add your answer
right arrow

Q34. Write a singleton class in php?

Ans.

A singleton class in PHP is a class that can only be instantiated once.

  • Create a private constructor to prevent direct instantiation

  • Create a private static variable to hold the instance of the class

  • Create a public static method to get the instance of the class

  • Ensure that the public static method always returns the same instance

Add your answer
right arrow

Q35. How session works in php?

Ans.

Session in PHP allows to store user data on the server for later use.

  • Session starts when a user logs in and ends when the user logs out or the session expires.

  • Session data is stored on the server and identified by a unique session ID.

  • Session variables can be set and accessed using the $_SESSION superglobal array.

  • Session can be destroyed using the session_destroy() function.

  • Session can be used to store user-specific data such as login credentials, shopping cart items, etc.

Add your answer
right arrow
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

Samsung Logo
3.9
 • 81 Interview Questions
View all
Recently Viewed
LIST OF COMPANIES
Discover companies
Find best workplace
INTERVIEWS
Honeywell Technology Solutions
No Interviews
JOBS
Honeywell Technology Solutions
No Jobs
INTERVIEWS
Honda Cars
No Interviews
SALARIES
Automotive Manufacturers
SALARIES
Hyundai Heavy Industries
SALARIES
Hyundai Motor India Limited
INTERVIEWS
Honda Cars
No Interviews
JOBS
Honeywell Technology Solutions
No Jobs
SALARIES
Hyundai Motor India Limited
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter