Software Developer Engineer Interview Questions

466,934 software developer engineer interview questions shared by candidates

You are in charge of a classroom which has n seats in a single row, numbered 0 through n-1. During the day students enter and leave the classroom for the exam. In order to minimize the cheating, your task is to efficiently seat all incoming students. You're given 2 types of queries: add_student(student_id) -> seat index, and remove_student(student_id) -> void. The rules for seating the student is the following: 1) The seat must be unoccupied 2) The closest student must be as far away as possible 3) Ties can be resolved by choosing the lowest-numbered seat.
avatar

Software Engineer

Interviewed at Quora, Inc.

4.1
May 27, 2017

You are in charge of a classroom which has n seats in a single row, numbered 0 through n-1. During the day students enter and leave the classroom for the exam. In order to minimize the cheating, your task is to efficiently seat all incoming students. You're given 2 types of queries: add_student(student_id) -> seat index, and remove_student(student_id) -> void. The rules for seating the student is the following: 1) The seat must be unoccupied 2) The closest student must be as far away as possible 3) Ties can be resolved by choosing the lowest-numbered seat.

Given a nested list of integers, return the sum of all integers in the list weighted by their depth For example, given the list {{1,1},2,{1,1}} the function should return 10 (four 1's at depth 2, one 2 at depth 1)
avatar

Software Engineer

Interviewed at LinkedIn

3.8
Jul 9, 2015

Given a nested list of integers, return the sum of all integers in the list weighted by their depth For example, given the list {{1,1},2,{1,1}} the function should return 10 (four 1's at depth 2, one 2 at depth 1)

Viewing 1341 - 1350 interview questions

Glassdoor has 466,934 interview questions and reports from Software developer engineer interviews. Prepare for your interview. Get hired. Love your job.