Alright, I'm less confident about the first problem, mainly because of steps 2-5. Many of them seem redundant to me. But step 1 is clear: the amine and the acetone combine in an acidic environment to give an enamine, which is a good nucleophile that adds to the nitrile:
Now, to me, the second and the third step seem redundant. I'm almost certain that the second step is going to hydrolyze the enamine and the imine to give a diketone. If this is the case, then the third and fourth steps together do nothing (one protonates the ketone and the other neutralizes it). However, I suspect that maybe what the professor was going for is that the second and third steps are two different hydrolysis steps, and the 4th step neutralizes the third step so that at the end of the sequence, you get the diketone:
However, your product looks significantly different from mine that I wonder if maybe these acid/base steps might cause some sort of dimerization? Regardless, assuming the hydrolysis gets you to the diketone above, steps 5 and 6 are clear. You deprotonate the very acidic carbon between the two ketones and perform an S
N2 reaction on the allyl bromide to give:
The proton on the methine carbon is still very acidic (more so than the other alpha carbon protons), which leads to steps 7 and 8. You deprotonate this carbon and add methyl bromide in another S
N2 reaction:
This is my best guess for the final product of problem 1. But again, if something funky is going on in steps 2-5, I can't be sure this is right.
Edit: one possibility is that steps 2-5 above are taken specifically to avoid self-condensation of the diketone (another possibility is that they facilitate self-condensation. I'm just not sure).