Wine and alcoholic drinks are sold in the few bar restaurants in the big cities, high end hotels, and night clubs. Some bar restaurants can be found in nice parks, so if you are in a nice wooded park, look for the restaurants.
The fast food restaurants open and affordable to the public do not sell beer, and the coffee shops do not sell alcohol.
If you visit Algiers or coastal cities, there are fish restaurants in almost every fishing port, the fishing is traditional and the fish sold is very fresh; usually, these restaurants sell alcohol but you have to ask (do not expect to see it, some times it is on the menu, some times not).
Finally, you can buy your own bottle of Algerian wine to take home in discrete shops that sell alcoholic drinks. It is better to buy it at the Algiers airport.
In smaller towns, buying alcohol can be challenging; you usually find them at the edge of the towns in sketchy areas and the conditions in which the alcohol was kept is sometimes questionable.
Some Muslims drink but they consider it a sin. It is in private but socially. If some one invites you into his home and does not offer alcohol, he expects you not to be drunk or smell alcohol, and does not expect you to bring your own bottle or even discuss drinking alcohol in front of his wife and kids.