Coding Flashcards

1
Q

Write a function to reverse a string.

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Write function to compute Nth fibonacci number. Try recursion and iteration.

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Print out the grade-school multiplication table up to 12x12

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Write a function that sums up integers from a text file, one int per line

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Write function to print the odd numbers from 1 to 99

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Find the largest int value in an int array.

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Format an RGB value (three 1-byte numbers) as a 6-digit hexadecimal string.

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A k-palindrome is a string which transforms into a palindrome on removing at most k characters.

Given string S, and interger K, print “YES” if S is a k-palindrome; otherwise print “NO”.
Constraints:
S has at most 20,000 characters.
0

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Determine if a string has all unique characters.

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Reverse a string in place

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Remove duplicates in a string in place

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Write a method to decide if two strings are anagrams or not

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Assume you have a method isSubstring which checks if one word is a substring of another string. Given two strings s1, and s2. write code to check if s2 is a rotation of s1 using only one call to isSubstring (i.e., “waterbottle” is a rotation of “erbottlewat”).

A

Compile code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly