Software Interview Questions

551,546 software interview questions shared by candidates

Design an LRU cache. It's a data struct with a capacity. Beyond this capacity the least recently used item is removed. You should be able to insert an element, access an element given its key, and delete an element, in constant time. Note that when you access an element, even if it's just for a read, it becomes the most recently used.
avatar

Software Engineer

Interviewed at Dropbox

3.9
Nov 22, 2013

Design an LRU cache. It's a data struct with a capacity. Beyond this capacity the least recently used item is removed. You should be able to insert an element, access an element given its key, and delete an element, in constant time. Note that when you access an element, even if it's just for a read, it becomes the most recently used.

Given a string that looks like this: Fall2014 BIO110, return 4 pieces of information: Season - Winter, Spring, Summer, Fall Year - 20XX Subject - BIO, ENGR, etc Course number The season and year cluster may be space separated. Season always comes before year. The subject and course number cluster may also be space separated. Subject always comes before course number. The season/year and subject/course clusters are always space separated. You are guaranteed that season/year cluster comes first. Season can also be given like this: W = Winter Sp = Spring Su = Summer F = Fall Years can be given without their prefix of "20". So if you're given Fall14, you should be able to extract a year of 2014. Subject and course number come as they are. You are guaranteed that subjects are purely alphabetical. Examples: Input: F 13 ENGR 110 Season: Fall Year: 2013 Subject: ENGR Course #: 110 Input: Su2015 BIO340 Season: Summer Year: 2015 Subject: BIO Course #: 340
avatar

Software Engineer

Interviewed at Course Hero

3.9
Nov 11, 2017

Given a string that looks like this: Fall2014 BIO110, return 4 pieces of information: Season - Winter, Spring, Summer, Fall Year - 20XX Subject - BIO, ENGR, etc Course number The season and year cluster may be space separated. Season always comes before year. The subject and course number cluster may also be space separated. Subject always comes before course number. The season/year and subject/course clusters are always space separated. You are guaranteed that season/year cluster comes first. Season can also be given like this: W = Winter Sp = Spring Su = Summer F = Fall Years can be given without their prefix of "20". So if you're given Fall14, you should be able to extract a year of 2014. Subject and course number come as they are. You are guaranteed that subjects are purely alphabetical. Examples: Input: F 13 ENGR 110 Season: Fall Year: 2013 Subject: ENGR Course #: 110 Input: Su2015 BIO340 Season: Summer Year: 2015 Subject: BIO Course #: 340

Viewing 3051 - 3060 interview questions

Glassdoor has 551,546 interview questions and reports from Software interviews. Prepare for your interview. Get hired. Love your job.