Software Engineer Software Developer Interview Questions

467,049 software engineer software developer 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

See Interview Questions for Similar Jobs

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