A k-path is a hypergraph P k = {e 1 , e 2 , . . . , e k } such that |e i ∩ e j | = 1 if |j − i| = 1 and e i ∩ e j = ∅ otherwise. A k-cycle is a hypergraph C k = {e 1 , e 2 , . . . , e k } obtained from a (k − 1)-path {e 1 , e 2 , . . . , e k−1 } by adding an edge e k that shares one vertex with e 1 , another vertex with e k−1 and is disjoint from the other edges.Let ex r (n, G) be the maximum number of edges in an r-graph with n vertices not containing a given r-graph G. We prove that for fixed r ≥ 3, k ≥ 4 and (k, r) = (4, 3), for large enough n:if k is even and we characterize all the extremal r-graphs. We also solve the case (k, r) = (4, 3), which needs a special treatment. The case k = 3 was settled by Frankl and Füredi.This work is the next step in a long line of research beginning with conjectures of Erdős and Sós from the early 1970's. In particular, we extend the work (and settle a conjecture) of Füredi, Jiang and Seiver who solved this problem for P k when r ≥ 4 and of Füredi and Jiang who solved it for C k when r ≥ 5. They used the delta system method, while we use a novel approach which involves random sampling from the shadow of an r-graph.