Dostoevsky began the idea of Crime and Punishment in the summer of 1865 . This was after he had gambled away much of his money . Dostoyevsky conceived the idea of Crime and Punishment in the summer of 1865 , having gambled away much of his fortune , unable to pay his bills or afford proper meals .