
Quikr


50+ Quikr Interview Questions and Answers
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
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
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
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.
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
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.
Q4. 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
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.
Q5. 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
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.
Q6. 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
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
Q7. Consecutive Elements
Given an array arr
of N
non-negative integers, determine whether the array consists of consecutive numbers. Return true if they do, and false otherwise.
Input:
The first line of input conta...read more
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 moreSession 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.
Q9. GCD Sum Problem Statement
Given an integer 'N', the task is to find the sum of the greatest common divisor (GCD) of all pairs (i, j) such that 1 <= i < j <= N.
Input:
T
(the number of test cases)
For each test ...read more
Calculate the sum of GCD of all pairs of numbers from 1 to N.
Iterate through all pairs of numbers from 1 to N and calculate GCD
Add all the calculated GCDs to get the final sum
Optimize the GCD calculation using Euclidean algorithm
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.
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
Q12. Pair Sum Problem Statement
You are provided with an array ARR
consisting of N
distinct integers in ascending order and an integer TARGET
. Your objective is to count all the distinct pairs in ARR
whose sum equal...read more
Count the number of distinct pairs in an array whose sum equals a given target.
Iterate through the array and for each element, check if the complement (target - current element) exists in a hash set.
If the complement exists, increment the count of pairs and add the current element to the hash set.
Return the count of pairs at the end.
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
Q14. Find the first non repetitive character in a string?
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.
Q15. How to write a Connection class to MySQL database using PHP?
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
Q16. How to increase php memory at run time, if it exhausts?
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
Q17. Abstract class? How it is different from interface? Is multiple inheritance possible in php? How?
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.
Q18. 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 mai...
read moreSession is maintained through session affinity or sticky sessions.
Session affinity ensures that a user's session is always directed to the same server.
Sticky sessions use cookies to track the user's session and direct them to the same server.
Load balancers can also use IP-based affinity to maintain sessions.
Session persistence can be configured based on time or number of requests.
Without session affinity, users may experience issues with lost data or inconsistent behavior.
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.
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);
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
Q22. Given a no K and an array. Find pair of elements whose sum is equal to given no K
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.
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.
Q24. Find missing element in an array of elements from 0 to n-1?
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
Q25. WAP to check if linked list elements is a palindrome without using any extra space?
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
Q26. WAP to get smallest plindron number larger than the given no?
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.
Q27. Write a stored procedure from a given set of tables and conditions. Simple one
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
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
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
Q30. What are the different types of error in php?
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.
Q31. WAP to implement some basic Design Patterns like Singleton?
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
Q32. 1. Given a wood of some size. It burns from 1 end to another and takes 30 min. How to burn the same wood in 15 min.?
To burn a wood of some size in 15 min instead of 30 min, split it into two halves and burn them simultaneously.
Split the wood into two halves
Burn both halves simultaneously
Use a larger flame or accelerant to increase the burning rate
Q33. What all we can do with php.ini?
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
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
Q35. Jquery function to get domain from a url?
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
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.
Q37. How to implement Critical section in Java and on which variable?
To implement critical section in Java, use synchronized keyword on the shared variable.
Use synchronized keyword to ensure only one thread can access the shared variable at a time.
The shared variable should be the object on which the synchronized keyword is applied.
Example: synchronized(sharedObject) { //critical section code }
Q38. If a marketing campaign is not working as expected , what was the issue ? what steps did u take to understand the issue ?
The issue could be due to various factors such as targeting, messaging, or timing. Steps taken include analyzing data, conducting A/B testing, and adjusting strategies accordingly.
Identify the specific goals and KPIs of the campaign to determine where it may be falling short
Analyze data such as click-through rates, conversion rates, and engagement metrics to pinpoint areas of underperformance
Conduct A/B testing to test different variables such as ad copy, visuals, or targetin...read more
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
Q40. Find missing element in an array of elements from 0 to n-1. Different approaches asked(about 3 to 4 approaches)?
Find missing element in an array of elements from 0 to n-1 using different approaches.
Approach 1: Sum of n natural numbers - sum of array elements
Approach 2: XOR all array elements and XOR with n natural numbers
Approach 3: Binary search for missing element
Approach 4: Using a hash table to store array elements
Q41. HOW TO CONVERT FROM VIDEO TO AUDIO
To convert from video to audio, you can use various software and online tools.
Use software like VLC Media Player, Handbrake, or FFmpeg to convert video to audio.
Online tools like Online-Convert.com and CloudConvert.com can also be used for conversion.
Choose the desired audio format and quality before converting.
Ensure that the video file is compatible with the software or tool being used for conversion.
Q42. how to do targeting , what approach would you take to target a specific audience ?
Targeting specific audience involves identifying key demographics, interests, and behaviors to tailor marketing strategies.
Conduct market research to understand the target audience's demographics, interests, and behaviors.
Utilize data analytics tools to track and analyze customer behavior and preferences.
Create buyer personas to represent different segments of the target audience.
Use social media targeting options to reach specific demographics based on age, location, interes...read more
Q43. A/B test how is it done , what is the use of this test ?
A/B testing is a method used to compare two versions of a webpage or app to determine which one performs better.
A/B testing involves creating two versions (A and B) of a webpage or app with one differing element, such as a headline or call-to-action button.
Users are randomly shown either version A or B, and their interactions are measured to determine which version performs better in terms of conversions or other metrics.
The version that performs better is then implemented as...read more
Q44. Write a singleton class in php?
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
Q45. How session works in php?
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.
Q46. WHAT IS THE IMAGE FILE HEIGHT
The image file height refers to the vertical size of the image in pixels.
Image file height is measured in pixels.
It determines the vertical size of the image.
The height can be found in the image file's metadata or by opening the image in an image editor and checking its properties.
Q47. WHAT IS THE CODEC LAST NAME
The question is unclear and does not make sense in the context of a Wordpress Developer interview.
The question is likely a mistake or a joke.
There is no codec with the last name.
Codec is a term used in digital media to refer to a method of encoding and decoding data.
As a Wordpress Developer, knowledge of codecs may be useful for working with multimedia content on websites.
Q48. HOW TO CONVERT FROM OGG FROM MP3
OGG to MP3 conversion can be done using various online converters or software.
Use online converters like CloudConvert, Convertio, etc.
Use software like VLC media player, Audacity, etc.
Install FFmpeg and use command line to convert.
Check for copyright issues before converting.
Ensure quality of converted file is satisfactory.
Q49. what is your experience with google tag manager ?
I have extensive experience with Google Tag Manager, including setting up tracking codes, triggers, and variables.
Implemented various tracking codes for website analytics and conversion tracking
Created custom triggers and variables to track specific user interactions
Utilized Google Tag Manager to streamline the process of adding and updating tags on websites
Q50. Workflow of the integration and other application involved on integration
The integration workflow involves connecting different applications to enable seamless data exchange.
Identify the systems that need to be integrated
Define the data flow between the systems
Develop APIs or connectors for data exchange
Test the integration to ensure data accuracy and consistency
Monitor and maintain the integration for ongoing performance
Examples: Integrating CRM system with marketing automation platform, connecting e-commerce website with inventory management sys...read more
Q51. HOW TO CONVERT WAV TO MP3
Use a media converter software or an online converter tool to convert WAV to MP3.
Download and install a media converter software like Audacity or Freemake Audio Converter.
Open the software and import the WAV file.
Choose MP3 as the output format and select the desired quality.
Click on the convert button and wait for the process to complete.
Alternatively, use an online converter tool like Online-Convert or Zamzar.
Upload the WAV file and select MP3 as the output format.
Click on ...read more
Q52. Who is the ceo of Axis bank
Amitabh Chaudhry is the CEO of Axis Bank.
Amitabh Chaudhry became the CEO of Axis Bank in January 2019.
He was previously the MD and CEO of HDFC Life Insurance Company.
Under his leadership, Axis Bank has focused on digital transformation and customer-centric initiatives.
Q53. WHAT THE CROPPED IMAGE
A cropped image is an image that has been trimmed or cut to a specific size or shape.
Cropping an image removes unwanted parts of the image
Cropped images are often used for thumbnails or profile pictures
Cropping can be done manually or with software like Photoshop
Aspect ratio should be considered when cropping to avoid distortion
Q54. What is GST full from
GST stands for Goods and Services Tax.
GST stands for Goods and Services Tax
It is an indirect tax levied on the supply of goods and services in India
Implemented on 1st July 2017 to replace multiple indirect taxes like VAT, service tax, etc.
Q55. Write a java code to generate fibonacci series
Java code to generate fibonacci series
Use a loop to generate the series
Start with the first two numbers 0 and 1
Add the previous two numbers to get the next number
Q56. center div using 3 approaches
Three approaches to center a div element
Using CSS flexbox: set display property of parent element to flex and justify-content to center
Using CSS grid: set display property of parent element to grid and place the div in the center grid area
Using margin: set margin property of the div to auto
Q57. display use of setTimeout
setTimeout is a function in JavaScript used to execute a function after a specified amount of time.
setTimeout(function, milliseconds) is used to delay the execution of a function by a specified number of milliseconds.
Example: setTimeout(() => { console.log('Hello, world!'); }, 2000) will log 'Hello, world!' after 2 seconds.
More about working at Quikr

Top HR Questions asked in Quikr
Interview Process at Quikr

Top Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

