Strings Quiz
Editorial
13 questions across the three Strings lessons: how strings compare and split, characters as numbers, what a one-pass parser keeps, and which centers find a palindrome. Pick an answer to see whether it's right and why. Nothing is saved, so you can take it again.
If one trips you up, its lesson is Introduction to Strings, Parsing Strings in One Pass or Palindromes: Expand Around the Center.
Quiz
1 / 13Multiple choice
Java:
String a = new String("abc"); and String b = "abc";. What do a == b and a.equals(b) give?Multiple choice
Python:
' hi '.split(' '), with one space on each side of hi. What does it return?Multiple choice
C++:
char c = 'g';. What is char(c - 'a' + 'A')?Multiple choice
Longest Common Prefix of ["interview", "internet", "interval"]?
Multiple choice
Maximum Nesting Depth of "((a)(b(c)))"?
Multiple choice
Roman to Integer: what is CDXLIV?
Multiple choice
String to Integer (atoi) on "000000000000123", 15 digits?
Multiple choice
Java atoi does
value = value * 10 + d, then checks value > Integer.MAX_VALUE. What does it return for "2147483648"?Multiple choice
Count the substrings of s that read the same both ways, with n up to 1,000. Which approach fits?
Multiple choice
Longest Palindromic Substring of "bananas"?
Multiple choice
An expand-around-the-center that only tries letters as centers, never gaps. What does it return on "abba"?
Multiple choice
How many palindromic substrings does "abba" have?
Multiple choice
Longest Palindrome: the letters may be rearranged. How long can it be from "aaabbbcc"?