Intern Interview Questions

248,749 intern interview questions shared by candidates

Write a function called eval, which takes a string and returns a boolean. This string is allowed 6 different characters: 0, 1, &, |, (, and ). Eval should evaluate the string as a boolean expression, where 0 is false, 1 is true, & is an and, and | is an or. An example string might look like "(0 | (1 | 0)) & (1 & ((1 | 0) & 0))"
avatar

Software Engineer Intern

Interviewed at Dropbox

3.9
Nov 13, 2012

Write a function called eval, which takes a string and returns a boolean. This string is allowed 6 different characters: 0, 1, &, |, (, and ). Eval should evaluate the string as a boolean expression, where 0 is false, 1 is true, & is an and, and | is an or. An example string might look like "(0 | (1 | 0)) & (1 & ((1 | 0) & 0))"

Viewing 341 - 350 interview questions

Glassdoor has 248,749 interview questions and reports from Intern interviews. Prepare for your interview. Get hired. Love your job.