Add office photos
Employer?
Claim Account for FREE

PeopleStrong

3.4
based on 577 Reviews
Filter interviews by

20+ Piaggio Interview Questions and Answers

Updated 5 Jan 2025

Q1. Aggressive Cows Problem Statement

Given an array representing positions of stalls and an integer ‘K’ representing the number of aggressive cows, determine the largest minimum distance between any two cows when ...read more

Ans.

The problem requires assigning aggressive cows to stalls in a way that maximizes the minimum distance between any two cows.

  • Sort the array of stall positions in ascending order.

  • Use binary search to find the largest minimum distance between cows.

  • Check if it is possible to assign cows with this minimum distance by iterating through the sorted array.

  • If it is possible, update the maximum distance and continue binary search for a larger minimum distance.

  • Return the maximum distance ...read more

Add your answer

Q2. Count Set Bits Problem Statement

Given a positive integer N, compute the total number of '1's in the binary representation of all numbers from 1 to N. Return this count modulo 1e9+7 because the result can be ve...read more

Ans.

The task is to count the total number of '1' in the binary representation of all numbers from 1 to N.

  • Convert each number from 1 to N into its binary representation

  • Count the number of '1' bits in each binary representation

  • Sum up the counts of '1' bits for all numbers

  • Return the sum modulo 1e9+7

Add your answer

Q3. Reverse Words in a String: Problem Statement

You are given a string of length N. Your task is to reverse the string word by word. The input may contain multiple spaces between words and may have leading or trai...read more

Ans.

The task is to reverse the words in a given string, removing any leading or trailing spaces and replacing multiple spaces between words with a single space.

  • Split the string into words using spaces as delimiters

  • Reverse the order of the words

  • Join the reversed words with a single space between them

  • Remove any leading or trailing spaces

Add your answer

Q4. Remove Consecutive Duplicates From String Problem Statement

Given a string STR consisting of both lower and upper case characters, your task is to remove consecutive duplicate characters from the string and ret...read more

Ans.

The task is to remove consecutive duplicate characters from a given string and return the new string.

  • Iterate through the characters of the string

  • Compare each character with the next character

  • If they are the same, skip the next character

  • If they are different, add the current character to the new string

  • Return the new string

Add your answer
Discover Piaggio interview dos and don'ts from real experiences

Q5. Maximum Path Sum in a Matrix

Given an N*M matrix filled with integer numbers, determine the maximum sum that can be obtained from a path starting from any cell in the first row to any cell in the last row.

You ...read more

Ans.

The question asks to find the maximum sum that can be obtained from a path starting from any cell in the first row to any cell in the last row of a given matrix.

  • Iterate through each cell in the first row and calculate the maximum sum path ending at that cell

  • For each cell, calculate the maximum sum path ending at that cell by considering the three possible directions

  • Store the maximum sum path ending at each cell in a separate matrix

  • The maximum sum path ending at any cell in th...read more

Add your answer

Q6. Permutation In String Problem Statement

Given two strings, str1 and str2, determine whether str2 contains any permutation of str1 as a substring.

Input:

str1 = “ab”
str2 = “aoba”

Output:

True

Example:

Explanatio...read more

Add your answer
Are these interview questions helpful?

Q7. Shortest Path in an Unweighted Graph

The city of Ninjaland is represented as an unweighted graph with houses and roads. There are 'N' houses numbered 1 to 'N', connected by 'M' bidirectional roads. A road conne...read more

Ans.

The problem is to find the shortest path between two houses in an unweighted graph.

  • The graph represents the city of Ninjaland with houses connected by roads.

  • The input consists of the number of test cases, number of houses and roads, starting and ending house, and the roads between houses.

  • The output is a vector of nodes representing the shortest path from the starting house to the ending house.

  • If there are multiple shortest paths, any one of them can be returned.

  • The constraint...read more

Add your answer

Q8. Reverse Linked List in Groups of K

You are provided with a linked list containing 'N' nodes and an integer 'K'. The task is to reverse the linked list in groups of size K, which means reversing the nodes in eac...read more

Ans.

The task is to reverse a linked list in groups of size K.

  • Iterate through the linked list in groups of size K

  • Reverse each group using a helper function

  • Connect the reversed groups to form the final reversed linked list

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q9. Minimum Time Problem Statement

In a city with ‘N’ junctions and ‘M’ bi-directional roads, each junction is connected to other junctions with specified travel times. No road connects a junction to itself, and on...read more

Add your answer

Q10. Rat in a Maze Problem Statement

You need to determine all possible paths for a rat starting at position (0, 0) in a square maze to reach its destination at (N-1, N-1). The maze is represented as an N*N matrix w...read more

Add your answer

Q11. Use of primary key & foreign key

Ans.

Primary keys uniquely identify records in a table, while foreign keys establish relationships between tables.

  • Primary keys ensure data integrity by enforcing uniqueness and preventing duplicate records.

  • Foreign keys create relationships between tables, allowing data to be linked and referenced across multiple tables.

  • Primary keys are typically used as foreign keys in related tables to establish relationships.

  • Foreign keys can be used to enforce referential integrity, ensuring tha...read more

Add your answer

Q12. What are the key HR processes in an organization?

Ans.

Key HR processes in an organization include recruitment, onboarding, performance management, training and development, and employee relations.

  • Recruitment: Attracting, sourcing, and hiring new employees.

  • Onboarding: Introducing new employees to the organization and their roles.

  • Performance management: Setting goals, evaluating performance, and providing feedback.

  • Training and development: Providing opportunities for employees to learn and grow.

  • Employee relations: Handling conflic...read more

Add your answer

Q13. String is immutable or mutable in java

Ans.

String is immutable in Java

  • Immutable means once created, the value cannot be changed

  • String class in Java is final and cannot be extended

  • Any operation on a string creates a new string object

Add your answer

Q14. What is multi threading

Ans.

Multi threading is the ability of a program to perform multiple tasks concurrently.

  • It allows for efficient use of CPU resources

  • Threads share the same memory space

  • Synchronization is required to avoid race conditions

  • Examples include web servers handling multiple requests simultaneously

Add your answer

Q15. How to use inner joins

Ans.

Inner joins are used to combine rows from two or more tables based on a related column between them.

  • Inner joins return only the matching rows from both tables.

  • The join condition is specified using the ON keyword followed by the column(s) to join on.

  • Inner joins can be used to retrieve data from multiple tables based on a common column.

  • Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column;

Add your answer

Q16. Break sentence into list of string of words

Ans.

Break a sentence into a list of strings of words

  • Use the split() method to break the sentence into an array of strings

  • Specify the delimiter to split the sentence by spaces

  • Handle punctuation marks and special characters appropriately

Add your answer

Q17. How to create table

Ans.

To create a table, use the CREATE TABLE statement in SQL.

  • Specify the table name after the CREATE TABLE keyword.

  • List the column names and their data types within parentheses.

  • Add any constraints or indexes as needed.

  • Example: CREATE TABLE employees (id INT, name VARCHAR(50), age INT);

Add your answer

Q18. Vlookup working formula

Ans.

Vlookup is a function in Excel used to search for a value in a table and return a corresponding value.

  • Syntax: =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

  • lookup_value: The value to search for in the first column of the table.

  • table_array: The range of cells that contains the data.

  • col_index_num: The column number in the table from which to retrieve the value.

  • range_lookup: Optional. TRUE for approximate match, FALSE for exact match.

  • Example: =VLOOKUP(A2, B2:...read more

Add your answer

Q19. What is Boolean search

Ans.

Boolean search is a type of search that allows users to combine keywords with operators such as AND, OR, NOT to produce more relevant results.

  • Boolean search helps recruiters to narrow down their search results by using specific keywords and operators.

  • Operators like AND, OR, NOT can be used to refine search queries.

  • Example: Searching for 'Java AND Developer' will return results that include both keywords.

  • Example: Searching for 'Java OR Python' will return results that include ...read more

Add your answer

Q20. H lookup formula

Ans.

HLOOKUP is a function in Excel used to search for a value in the top row of a table and return a value in the same column from a specified row.

  • HLOOKUP stands for Horizontal Lookup.

  • It is used to search for a value in the top row of a table and return a value in the same column from a specified row.

  • Syntax: =HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])

  • Example: =HLOOKUP(123, A1:D4, 3, FALSE) will search for 123 in the top row of the table A1:D4 and return the...read more

Add your answer

Q21. Use of select command

Ans.

The SELECT command is used to retrieve data from a database table.

  • SELECT is a fundamental SQL command used in database management systems.

  • It allows you to specify the columns and rows you want to retrieve from a table.

  • You can use various clauses like WHERE, ORDER BY, GROUP BY, etc. to filter and sort the data.

  • The result of a SELECT query is a result set or a cursor containing the selected data.

  • Example: SELECT * FROM employees;

  • Example: SELECT name, age FROM customers WHERE age...read more

Add your answer

Q22. distance bw 2 nodes in binary tree

Ans.

To find the distance between two nodes in a binary tree, we can find the distance from the root to each node and then calculate the distance between the two nodes.

  • Calculate the distance from the root to each node using a recursive function

  • Find the lowest common ancestor of the two nodes

  • Calculate the distance from each node to the lowest common ancestor and add them together to get the total distance

Add your answer

Q23. Maximum sum of longest subarray

Ans.

Find the maximum sum of a subarray within an array of integers.

  • Iterate through the array and keep track of the current sum and maximum sum.

  • If the current sum becomes negative, reset it to 0.

  • Return the maximum sum found.

Add your answer

Q24. Find circle in linkedList

Ans.

Use Floyd's Tortoise and Hare algorithm to find a cycle in a linked list.

  • Initialize two pointers, slow and fast, at the head of the linked list.

  • Move slow pointer by one step and fast pointer by two steps until they meet.

  • If they meet, there is a cycle in the linked list.

  • Example: 1 -> 2 -> 3 -> 4 -> 2 (cycle at node 2)

Add your answer

Q25. Relocation is comfortable

Ans.

Relocation can be comfortable with proper planning and support.

  • Proper planning and research can help make the relocation process smoother

  • Having a support system in place can ease the transition to a new location

  • Utilizing relocation services provided by the company can also make the process more comfortable

Add your answer

Q26. Explain normalization in sql?

Ans.

Normalization in SQL is the process of organizing data in a database to reduce redundancy and improve data integrity.

  • Normalization is used to eliminate data redundancy by breaking up tables into smaller, related tables.

  • It helps in reducing data anomalies such as update anomalies, insert anomalies, and delete anomalies.

  • There are different levels of normalization - 1NF, 2NF, 3NF, BCNF, and 4NF, each with specific rules to follow.

  • Normalization ensures that each piece of data is ...read more

Add your answer

Q27. valid sudoku of 9*9

Ans.

A valid sudoku of 9*9 is a grid where each row, column, and 3x3 subgrid contains the numbers 1-9 without repetition.

  • Each row must contain the numbers 1-9 without repetition

  • Each column must contain the numbers 1-9 without repetition

  • Each 3x3 subgrid must contain the numbers 1-9 without repetition

Add your answer

Q28. Reversing a string

Ans.

Reversing a string involves flipping the order of characters in a given string.

  • Create an empty string to store the reversed string

  • Iterate through the original string from the end to the beginning

  • Append each character to the empty string

  • Return the reversed string

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at Piaggio

based on 45 interviews
Interview experience
4.1
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions from Similar Companies

4.2
 • 659 Interview Questions
3.8
 • 485 Interview Questions
3.7
 • 419 Interview Questions
4.2
 • 190 Interview Questions
3.4
 • 174 Interview Questions
View all
Top PeopleStrong Interview Questions And Answers
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 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