The interrelationship of science and engineering and the recent inclusion of engineering in K‐12 science standards have promoted the incorporation of engineering design in science classrooms. However, empirical studies on the impacts of engineering design on science learning show mixed findings and indicate that factors such as the complexity of design tasks, a lack of connections between design tasks and the underlying science concepts, and the limited experience with engineering among science teachers can influence learning gains from design activities. One useful approach for addressing these challenges is through the use of technologies such as interactive simulations, which have become increasingly prevalent in STEM education. In the present study, we used a simulation to investigate the effects of task context (science vs. engineering) on students' investigation behaviors and their understanding of science concepts. Furthermore, considering the relative novelty and complexity of an engineering context to many students, we examined how structuring students' responses in the engineering context affects their behaviors and learning. A total of 349 high school students were randomly assigned to one of three conditions: science, structured engineering, and unstructured engineering. In the science condition, students used the simulation to investigate the effects of four variables on the saturation concentration of solutions. Using the same simulation, students in the structured and unstructured engineering conditions were directed to recommend the optimal variable values that meet a set of given constraints and maximize the saturation concentration for a commercial product. The only difference between the two engineering conditions was whether structuring was provided in the response fields presented to students as they entered responses for the target variables. Results suggested that the engineering context stimulated students to engage in more comprehensive investigation behaviors as compared to the science context. In contrast, students in the science condition exhibited more systematic behaviors. However, the increased comprehensiveness of behaviors in the engineering conditions did not translate into significantly greater learning of the science content in these conditions, indicating that students might have focused on the surface features associated with the engineering goal without making deep connections between the two domains. Furthermore, structuring students' responses within an engineering context as used in the current study did not lead to significant differences in investigation behaviors or learning outcomes.