Lead Developer Interview Questions

46,023 lead developer interview questions shared by candidates

Identify whether four sides (given by four integers) can form a square, a rectangle or neither. Input: Each line of the input describes a single polygon, and contains four space-separated integers, which represent the length of the sides of the polygon. The input lines will follow the 'A B C D' order as in the following representation: A ------| | D B | c ------| Output: A single line which contains 3 space-separated integers, representing the number of squares, number of rectangles and number of other polygons with 4 sides. Note that squares shouldn't be counted as rectangles. Invalid polygons should also be counted as 'other polygons'. Constraints The four integers representing the sides will be such that: -2000 <= X <= 2000 (Where X represents the integer)
avatar

Software Development Team Leader

Interviewed at Booking.com

4
Oct 17, 2017

Identify whether four sides (given by four integers) can form a square, a rectangle or neither. Input: Each line of the input describes a single polygon, and contains four space-separated integers, which represent the length of the sides of the polygon. The input lines will follow the 'A B C D' order as in the following representation: A ------| | D B | c ------| Output: A single line which contains 3 space-separated integers, representing the number of squares, number of rectangles and number of other polygons with 4 sides. Note that squares shouldn't be counted as rectangles. Invalid polygons should also be counted as 'other polygons'. Constraints The four integers representing the sides will be such that: -2000 <= X <= 2000 (Where X represents the integer)

Viewing 3421 - 3430 interview questions

Glassdoor has 46,023 interview questions and reports from Lead developer interviews. Prepare for your interview. Get hired. Love your job.