Add office photos
PayPal logo
Employer?
Claim Account for FREE

PayPal

3.9
based on 919 Reviews
Video summary
Filter interviews by
Designation
Fresher
Experienced
Clear (1)

30+ PayPal Interview Questions and Answers for Freshers

Updated 5 Feb 2024
Popular Designations

Q1. Cycle Detection in a Singly Linked List

Determine if a given singly linked list of integers forms a cycle or not.

A cycle in a linked list occurs when a node's next points back to a previous node in the list. T...read more

Ans.

Detect if a singly linked list forms a cycle by checking if a node's next points back to a previous node.

  • Traverse the linked list using two pointers, one moving one step at a time and the other moving two steps at a time.

  • If the two pointers meet at any point, it indicates the presence of a cycle in the linked list.

  • If one of the pointers reaches the end of the list (null), it means there is no cycle.

Add your answer
right arrow

Q2. Cycle Detection in Undirected Graph Problem Statement

You are provided with an undirected graph containing 'N' vertices and 'M' edges. The vertices are numbered from 1 to 'N'. Your objective is to determine whe...read more

Ans.

Detect cycles in an undirected graph with given vertices and edges.

  • Use Depth First Search (DFS) to traverse the graph and detect cycles.

  • Maintain a visited array to keep track of visited vertices and a parent array to keep track of the parent of each vertex.

  • If while traversing, you encounter a visited vertex that is not the parent of the current vertex, then a cycle exists.

  • Consider edge cases like disconnected graphs and self-loops.

Add your answer
right arrow

Q3. Merge Sort Problem Statement

You are given a sequence of numbers, ARR. Your task is to return a sorted sequence of ARR in non-descending order using the Merge Sort algorithm.

Explanation:

The Merge Sort algorit...read more

Ans.

Implement Merge Sort algorithm to sort a sequence of numbers in non-descending order.

  • Implement the Merge Sort algorithm using a Divide and Conquer approach

  • Recursively divide the input array into two halves until the size of each array is 1

  • Merge the sorted halves to produce a completely sorted array

  • Ensure the output is in non-descending order

Add your answer
right arrow

Q4. Palindrome Partitioning II Problem Statement

Given a string ‘str’, find the minimum number of partitions needed such that every segment of the string is a palindrome.

The task is to make cuts in the string to p...read more

Ans.

Find the minimum number of partitions needed in a string such that every segment is a palindrome.

  • Iterate through the string and check for palindromes at each possible partition point.

  • Use dynamic programming to keep track of the minimum cuts needed.

  • Consider edge cases where the string is already a palindrome or consists of different characters only.

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

Q5. Maximum Difference Problem Statement

Given an array ARR of N elements, your task is to find the maximum difference between any two elements in ARR.

If the maximum difference is even, print EVEN; if it is odd, p...read more

Ans.

Find the maximum difference between any two elements in an array and determine if it is even or odd.

  • Iterate through the array to find the maximum and minimum elements

  • Calculate the difference between the maximum and minimum elements

  • Check if the difference is even or odd and return the result

Add your answer
right arrow

Q6. DFS Traversal Problem Statement

Given an undirected and disconnected graph G(V, E), where V is the number of vertices and E is the number of edges, the connections between vertices are provided in the 'GRAPH' m...read more

Ans.

DFS traversal problem on an undirected and disconnected graph to find connected components.

  • Perform Depth First Search (DFS) on each vertex to find connected components

  • Use a visited array to keep track of visited vertices

  • Print the number of connected components and list vertices in ascending order for each component

Add your answer
right arrow
Are these interview questions helpful?
Q7. What is hashing and how can it be implemented?
Ans.

Hashing is a process of converting input data into a fixed-size string of bytes using a hash function.

  • Hashing is used to securely store passwords by converting them into a hash value before storing in a database.

  • Hashing is used in data structures like hash tables to quickly retrieve data based on a key.

  • Common hash functions include MD5, SHA-1, and SHA-256.

  • Hashing can be implemented in programming languages like Python using libraries like hashlib.

Add your answer
right arrow

Q8. find the and return if the given file path existing in the given file hierarcy(file system).

Ans.

Check if a given file path exists in the file system hierarchy and return the result.

  • Use file system APIs to check if the given file path exists in the hierarchy.

  • Traverse the file system hierarchy starting from the root directory to find the given file path.

  • Return true if the file path exists, false otherwise.

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop

Q9. How is MongoDB scalable?

Ans.

MongoDB is scalable due to its ability to horizontally partition data across multiple servers.

  • MongoDB uses sharding to distribute data across multiple servers.

  • Sharding allows for horizontal scaling by adding more servers to the cluster.

  • MongoDB also supports replica sets for high availability and fault tolerance.

  • Indexes can be created on any field in a MongoDB document, allowing for efficient querying of large datasets.

Add your answer
right arrow

Q10. Kth Largest Element Problem

Given an array containing N distinct positive integers and a number K, determine the Kth largest element in the array.

Example:

Input:
N = 6, K = 3, array = [2, 1, 5, 6, 3, 8]
Output...read more
Ans.

Find the Kth largest element in an array of distinct positive integers.

  • Sort the array in non-increasing order and return the Kth element.

  • Handle multiple test cases efficiently.

  • Ensure all elements in the array are distinct.

View 1 answer
right arrow

Q11. Delete a Node from a Linked List

You are provided with a linked list of integers. Your task is to implement a function that deletes a node located at a specified position 'POS'.

Input:

The first line contains a...read more
Ans.

Implement a function to delete a node from a linked list at a specified position.

  • Traverse the linked list to find the node at the specified position.

  • Update the pointers of the previous and next nodes to skip the node to be deleted.

  • Handle edge cases such as deleting the head or tail of the linked list.

  • Ensure to free the memory of the deleted node to avoid memory leaks.

Add your answer
right arrow

Q12. Reverse the String Problem Statement

You are given a string STR which contains alphabets, numbers, and special characters. Your task is to reverse the string.

Example:

Input:
STR = "abcde"
Output:
"edcba"

Input...read more

Ans.

Reverse a given string containing alphabets, numbers, and special characters.

  • Iterate through the string from the end to the beginning and append each character to a new string.

  • Use built-in functions like reverse() or slicing to reverse the string.

  • Handle special characters and numbers while reversing the string.

  • Ensure to consider the constraints on the input string length and number of test cases.

Add your answer
right arrow

Q13. One Away Transformation Problem

Given two strings, A and B, determine whether A can be transformed into B by performing at most one of the following operations (including zero operations):

1. Delete a character...read more
Ans.

Determine if one string can be transformed into another by performing at most one operation (insert, delete, replace).

  • Iterate through both strings simultaneously and check for differences.

  • Handle cases where a character needs to be inserted, deleted, or replaced.

  • Keep track of the number of operations performed and ensure it does not exceed one.

Add your answer
right arrow
Q14. In how many attempts can you find a defective ball among 10 given balls using a two-pan balance scale?
Ans.

You can find a defective ball among 10 given balls in 2 attempts using a two-pan balance scale.

  • Divide the 10 balls into two groups of 5 each.

  • Weigh the two groups on the balance scale.

  • If one group is heavier, it contains the defective ball. If they are equal, the defective ball is in the remaining 5 balls.

  • Divide the group of 5 balls with the defective one into two groups of 2 and 3 balls.

  • Weigh the two groups on the balance scale.

  • If one group is heavier, it contains the defecti...read more

Add your answer
right arrow

Q15. Remove Duplicates from String Problem Statement

You are provided a string STR of length N, consisting solely of lowercase English letters.

Your task is to remove all duplicate occurrences of characters in the s...read more

Ans.

Remove duplicate occurrences of characters in a given string.

  • Use a hash set to keep track of characters seen so far.

  • Iterate through the string and add non-duplicate characters to a new string.

  • Return the new string without duplicate characters.

Add your answer
right arrow
Q16. Can you explain the concepts of Object-Oriented Programming (OOP)?
Ans.

OOP is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.

  • OOP focuses on creating objects that interact with each other to solve problems.

  • Key concepts include encapsulation, inheritance, and polymorphism.

  • Encapsulation involves bundling data and methods that operate on the data into a single unit.

  • Inheritance allows classes to inherit attributes and methods from other classes.

  • Polymorphism enabl...read more

Add your answer
right arrow

Q17. Dijkstra's Shortest Path Problem

Given an undirected graph with ‘V’ vertices (labeled 0, 1, ... , V-1) and ‘E’ edges, where each edge has a weight representing the distance between two connected nodes (X, Y).

Y...read more

Ans.

Dijkstra's algorithm is used to find the shortest path from a source node to all other nodes in a graph with weighted edges.

  • Implement Dijkstra's algorithm to find the shortest path distances from the source node to all other nodes.

  • Use a priority queue to efficiently select the next node with the shortest distance.

  • Update the distances of neighboring nodes based on the current node's distance and edge weights.

  • Handle disconnected vertices by assigning a large value (e.g., 214748...read more

Add your answer
right arrow

Q18. How many A4 sheets are sold in India per day?

Ans.

It is impossible to accurately determine the number of A4 sheets sold in India per day.

  • There is no centralized data on the sales of A4 sheets in India.

  • The number of A4 sheets sold can vary greatly depending on the region and industry.

  • Factors such as digitalization and environmental concerns may also impact sales.

  • Estimates or projections may be available from specific companies or industries.

  • Market research firms may have data on the overall paper market in India.

Add your answer
right arrow
Q19. Write an SQL query to find the nth highest salary.
Ans.

SQL query to find the nth highest salary

  • Use the ORDER BY clause to sort salaries in descending order

  • Use the LIMIT and OFFSET clauses to skip the first n-1 highest salaries

  • Combine the above steps in a single query to find the nth highest salary

Add your answer
right arrow
Q20. Design a Cinema Ticket Reservation System.
Ans.

Design a Cinema Ticket Reservation System

  • Use a database to store movie information, showtimes, and seat availability

  • Allow users to search for movies, select showtimes, and choose seats

  • Implement a payment system for ticket purchases

  • Send confirmation emails with QR codes for ticket validation

Add your answer
right arrow
Q21. What are virtual functions?
Ans.

Virtual functions are functions in a base class that are overridden in derived classes to achieve runtime polymorphism.

  • Virtual functions are declared in a base class with the 'virtual' keyword.

  • They are overridden in derived classes using the 'override' keyword.

  • They allow a function to be called based on the runtime type of an object.

  • Virtual functions enable dynamic binding and late binding in C++.

  • Example: virtual void display() = 0; in base class and void display() override {...read more

Add your answer
right arrow
Q22. What is the difference between Stack and Heap in the context of Object-Oriented Programming (OOPS)?
Ans.

Stack is used for static memory allocation and stores local variables, while Heap is used for dynamic memory allocation and stores objects.

  • Stack is faster than Heap as it has a fixed size and memory allocation is done at compile time.

  • Heap is slower than Stack as memory allocation is done at runtime and requires more complex management.

  • Stack memory is limited and typically smaller in size, while Heap memory is larger and can grow as needed.

  • Objects in OOP are typically stored i...read more

Add your answer
right arrow
Q23. You have two hourglasses, one measuring 7 minutes and the other measuring 11 minutes. How can you measure exactly 15 minutes using only these hourglasses?
Ans.

To measure exactly 15 minutes using two hourglasses of 7 and 11 minutes, start both hourglasses together and then flip the 7-minute hourglass when it runs out.

  • Start both hourglasses at the same time.

  • When the 7-minute hourglass runs out, flip it immediately.

  • When the 11-minute hourglass runs out, 4 minutes will have passed on the 7-minute hourglass. This gives a total of 15 minutes.

Add your answer
right arrow

Q24. A recursive program to print numbers in ascending order

Ans.

A recursive program to print numbers in ascending order

  • Use a recursive function that takes a starting number and an ending number as parameters

  • Print the starting number and recursively call the function with starting number + 1 and the same ending number

  • Base case: stop recursion when starting number is greater than ending number

Add your answer
right arrow
Q25. Write a query to find the nth highest salary from a database.
Ans.

Query to find the nth highest salary from a database

  • Use the ORDER BY clause to sort salaries in descending order

  • Use the LIMIT clause to select the nth highest salary

  • Consider handling cases where there may be ties for the nth highest salary

Add your answer
right arrow
Q26. What is the difference between malloc and new?
Ans.

malloc is a function in C for dynamic memory allocation, while new is an operator in C++ for dynamic memory allocation and object creation.

  • malloc is a function in C, while new is an operator in C++.

  • malloc returns a void pointer, while new returns a pointer to the type being allocated.

  • malloc does not call constructors, while new calls constructors for object initialization.

  • malloc requires manual memory deallocation with free, while new automatically calls the destructor and de...read more

Add your answer
right arrow
Q27. What is the difference between C and C++?
Ans.

C is a procedural programming language while C++ is an object-oriented programming language with features like classes and inheritance.

  • C is a procedural programming language, while C++ is a multi-paradigm language with support for object-oriented programming.

  • C does not support classes and objects, while C++ does.

  • C does not have features like inheritance and polymorphism, which are present in C++.

  • C is a subset of C++, meaning that C++ includes all of C's features and adds new ...read more

Add your answer
right arrow
Q28. What is a virtual function?
Ans.

A virtual function is a function in a base class that is declared using the keyword 'virtual' and can be overridden by a function with the same signature in a derived class.

  • Virtual functions allow for dynamic polymorphism in C++

  • They are used in inheritance to achieve runtime polymorphism

  • Example: virtual void display() = 0; in a base class and void display() override in a derived class

Add your answer
right arrow

Q29. Any suggestions for Paypal or Ebay website?

Add your answer
right arrow

Q30. Projects in CS

Ans.

Projects in computer science involve developing software applications, algorithms, databases, and systems to solve various problems.

  • Developing software applications for specific purposes

  • Creating algorithms to optimize processes or solve complex problems

  • Designing databases to store and manage large amounts of data

  • Building systems to automate tasks or improve efficiency

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 Process at PayPal for Freshers

based on 9 interviews
Interview experience
4.3
Good
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

HDFC Bank Logo
3.9
 • 730 Interview Questions
Cisco Logo
4.1
 • 299 Interview Questions
Atos Logo
3.9
 • 185 Interview Questions
Indiamart Intermesh Logo
3.6
 • 181 Interview Questions
AU Small Finance Bank Logo
4.2
 • 179 Interview Questions
View all
Recently Viewed
INTERVIEWS
Accenture
No Interviews
SALARIES
DBS Bank
JOBS
Conneqt Business Solutions
No Jobs
JOBS
Hvantage Technologies
No Jobs
DESIGNATION
SALARIES
TCS
SALARIES
TCS
SALARIES
LTIMindtree
INTERVIEWS
Accenture
No Interviews
DESIGNATION
Top PayPal Interview Questions And Answers
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