Major Depressive Disorder (MDD) affects a large portion of the population and levies a huge societal burden. It has serious consequences like decreased productivity and reduced quality of life, hence there is considerable interest in understanding and predicting it. As it is a mental disorder, neural measures like EEG are used to study and understand its underlying mechanisms. However most of these studies have either explored resting state EEG (rs-EEG) data or task-based EEG data but not both, we seek to compare their respective efficacy. We work with data from non-clinically depressed individuals who score higher and lower on the depression scale and hence are more and less vulnerable to depression, respectively. Forty participants volunteered for the study. Questionnaires and EEG data were collected from participants. We found that people who are more vulnerable to depression had on average increased EEG amplitude in the left frontal channel, and decreased amplitude in the right frontal and occipital channels for raw data (rs-EEG). Task-based EEG data from a sustained attention to response task used to measure spontaneous thinking, an increased EEG amplitude in the central part of the brain for individuals with low vulnerability and an increased EEG amplitude in right temporal, occipital and parietal regions in individuals more vulnerable to depression were found. In an attempt to predict vulnerability (high/low) to depression, we found that a Long Short Term Memory model gave the maximum accuracy of 91.42% in delta wave for task-based data whereas 1D-Convolution neural network gave the maximum accuracy of 98.06% corresponding to raw rs-EEG data. Hence if one has to look at the primary question of which data will be good for predicting vulnerability to depression, rs-EEG seems to be better than task-based EEG data. However, if mechanisms driving depression like rumination or stickiness are to be understood, task-based data may be more effective. Furthermore, as there is no consensus as to which biomarker of rs-EEG is more effective in the detection of MDD, we also experimented with evolutionary algorithms to find the most informative subset of these biomarkers. Higuchi fractal dimension, phase lag index, correlation and coherence features were also found to be the most important features for predicting vulnerability to depression using rs-EEG. These findings bring up new possibilities for EEG-based machine/deep learning diagnostics in the future.