The whole action of One Flew Over the Cuckoo's Nest takes place in a mental institution, with the main protagonist, R.P. McMurphy, himself being a patient at the institution: as R. P. McMurphy points out early in the text, "I must be crazy to be in a loony bin like this", and later in the text, he makes reference to his madness many times, with quotes such as, "Is that crazy enough for ya Want me to take a shit on the floor".
A further similarity in the two characters is the fact that both men are strongly motivated by outside events; Hamlet cannot cope with his mother re-marrying after the death of his father, and R.P. McMurphy is obstinately obsessed with needing to be the centre of attention in the institutional setting; as he says soon after we meet him, "I like to make a good impression on the right man if he can prove to me he is the right man", showing that R.P. McMurphy is egotistical and obsessed with assessing the characters of people he meets, just as Hamlet proves himself to be through the events in Shakespeare's play.
Further, Hamlet and R.P. McMurphy are both defined as characters by their need, their thirst, for revenge. For R.P. McMurphy, he wants revenge on Nurse Ratchet after she re-seizes possession of the ward; for Hamlet, the whole thrust of his character is to avenge the death of his father, as he says, "From this time forth/My thoughts be bloody or worth nothing". Indeed, it is revenge that ultimately drives the characters to their end, even though both characters try to cover their thirst for revenge with deviations at every opportunity, through manipulation and trickery.
Similarly, the ultimate downfall of each character occurred due to a protagonist: for Hamlet, this is Claudius, and for R. P. McMurphy, this is Nurse Ratchet. Without these protagonists, the main thrust of Hamlet and R. P. McMurphy, i.e., jealousy, revenge, would not be given full thrust in the texts, and so the protagonists are essential to the development of the story.
Both characters are similarly built up through their relationships with minor characters, essentially to the female characters in each of the stories. Both men are fond of women, and their characters are built, and reinforced, by their relationships with these women; R. P. McMurphy pays rather too much attention to a rape that is described by a Doctor, and Hamlet becomes obsessed with Ophelia, a young girl. Minor characters are used in the two texts to substantiate the characters of Hamlet and R. P. McMurphy, to bring out facets of the characters. Minor characters are thus an integral part of the two stories, tools used by the authors to define the characters.
Another major similarity of the two characters is that it can be thought that they are simply feigning madness, as Hamlet and R. P. McMurphy say things throughout the course of the text that lead us to think their madness is a tool, with which they can carry out the actions they wish to carry out, without responsibility. Hamlet suggests, at many times during the text, that he is simply feigning madness, for example, "Here, as never before, so help you mercy/how strange or odd some I bear myself (as I perchance hereafter shall think meet to put antic disposition