Add office photos
PeopleStrong logo
Employer?
Claim Account for FREE

PeopleStrong

3.4
based on 581 Reviews
Video summary
Filter interviews by
Software Developer
Fresher
Clear (1)

PeopleStrong Software Developer Interview Questions and Answers

Updated 5 Feb 2024

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
right arrow

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
right arrow
PeopleStrong Software Developer Interview Questions and Answers for Freshers
illustration image

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
right arrow

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
right arrow
Discover PeopleStrong 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
right arrow

Q6. 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
right arrow

Q7. 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
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

Infosys Logo
3.6
 • 124 Interview Questions
Deloitte Logo
3.8
 • 45 Interview Questions
Xetech Logo
3.3
 • 19 Interview Questions
View all
Recently Viewed
INTERVIEWS
PeopleStrong
No Interviews
INTERVIEWS
PeopleStrong
No Interviews
INTERVIEWS
Skipper
No Interviews
INTERVIEWS
Team Lease
No Interviews
INTERVIEWS
Teamware Solutions
No Interviews
INTERVIEWS
HireRight
No Interviews
INTERVIEWS
PeopleStrong
No Interviews
INTERVIEWS
PeopleStrong
No Interviews
INTERVIEWS
Skipper
No Interviews
INTERVIEWS
PeopleStrong
No Interviews
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