Consider the following hat guessing game: n players are placed on n vertices of a graph, each wearing a hat whose color is arbitrarily chosen from a set of q possible colors. Each player can see the hat colors of his neighbors, but not his own hat color. All of the players are asked to guess their own hat colors simultaneously, according to a predetermined guessing strategy and the hat colors they see, where no communication between them is allowed. Given a graph G, its hat guessing number HG(G) is the largest integer q such that there exists a guessing strategy guaranteeing at least one correct guess for any hat assignment of q possible colors.In 2008, Butler et al. asked whether the hat guessing number of the complete bipartite graph K n,n is at least some fixed positive (fractional) power of n. We answer this question affirmatively, showing that for sufficiently large n, the complete r-partite graph K n,...,n satisfies HG(K n,...,n ) = Ω(n r−1 r −o(1) ). Our guessing strategy is based on a probabilistic construction and other combinatorial ideas, and can be extended to show that HG( C n,...,n ) = Ω(n 1 r −o(1) ), where C n,...,n is the blow-up of a directed r-cycle, and where for directed graphs each player sees only the hat colors of his outneighbors.Additionally, we consider related problems like the relation between the hat guessing number and other graph parameters, and the linear hat guessing number, where the players are only allowed to use affine linear guessing strategies. Several nonexistence results are obtained by using well-known combinatorial tools, including the Lovász Local Lemma and the Combinatorial Nullstellensatz. Among other results, it is shown that under certain conditions, the linear hat guessing number of K n,n is at most 3, exhibiting a huge gap from the Ω(n 1 2 −o(1) ) (nonlinear) hat guessing number of this graph.