Algorithms 4: Symmetry in Parentheses

by JT Cho

'Tis the season for interviews and career preparation. So without further ado, let's do a welcome back post! Problem. Given an input string $s$ of length $n$ containing only left and right parentheses, determine whether or not it is a valid parenthetical expression. By definition, a parenthetical expression is valid . . .

Java Singletons

by JT Cho

This article is part of a series on coding interview topics. Design a type that can only be instantiated once. In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a type to only one object. public class Foo { private static final Foo fooInstance = new . . .